Skip to content

Commit 6784ec5

Browse files
author
Marco Magdy
committed
Use the Lambda executable as the bootstrap when glibc is not required
1 parent e08ca6e commit 6784ec5

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

packaging/packager

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,22 +171,13 @@ exec \$LAMBDA_TASK_ROOT/lib/$PKG_LD --library-path \$LAMBDA_TASK_ROOT/lib \$LAMB
171171
EOF
172172
)
173173

174-
bootstrap_script_no_libc=$(cat <<EOF
175-
#!/bin/bash
176-
set -euo pipefail
177-
export AWS_EXECUTION_ENV=lambda-cpp
178-
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$LAMBDA_TASK_ROOT/lib
179-
exec \$LAMBDA_TASK_ROOT/bin/$PKG_BIN_FILENAME \${_HANDLER}
180-
EOF
181-
)
182-
183-
cp "$PKG_BIN_PATH" "$PKG_DIR/bin"
184174
if [[ $INCLUDE_LIBC == true ]]; then
175+
cp "$PKG_BIN_PATH" "$PKG_DIR/bin"
185176
echo -e "$bootstrap_script" > "$PKG_DIR/bootstrap"
177+
chmod +x "$PKG_DIR/bootstrap"
186178
else
187-
echo -e "$bootstrap_script_no_libc" > "$PKG_DIR/bootstrap"
179+
cp "$PKG_BIN_PATH" "$PKG_DIR/bootstrap"
188180
fi
189-
chmod +x "$PKG_DIR/bootstrap"
190181
# some shenanigans to create the right layout in the zip file without extraneous directories
191182
pushd "$PKG_DIR" > /dev/null
192183
zip --symlinks --recurse-paths "$PKG_BIN_FILENAME".zip -- *

0 commit comments

Comments
 (0)