Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .autover/changes/bootstrap-ambiguous-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Projects": [
{
"Name": "Amazon.Lambda.RuntimeSupport",
"Type": "Patch",
"ChangelogMessages": [
"Distinguish multiple dependency or runtime configuration files from missing files in bootstrap diagnostics."
]
}
]
}
10 changes: 10 additions & 0 deletions Libraries/src/Amazon.Lambda.RuntimeSupport/bootstrap.net8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ else
if ! [ -f "${DEPS_FILE}" ]; then
DEPS_FILES=( "${LAMBDA_TASK_ROOT}"/*.deps.json )

if [ "${#DEPS_FILES[@]}" -gt 1 ]; then
echo "Error: Found multiple .deps.json files in ${LAMBDA_TASK_ROOT}. Expected ${ASSEMBLY_NAME}.deps.json." 1>&2
exit 105
fi

# Check if there were any matches to the *.deps.json glob, and that the glob was resolved
# This makes the matching independent from the global `nullopt` shopt's value (https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html)
if [ "${#DEPS_FILES[@]}" -ne 1 ] || echo "${DEPS_FILES[0]}" | grep -q -F '*'; then
Expand All @@ -92,6 +97,11 @@ else
if ! [ -f "${RUNTIMECONFIG_FILE}" ]; then
RUNTIMECONFIG_FILES=( "${LAMBDA_TASK_ROOT}"/*.runtimeconfig.json )

if [ "${#RUNTIMECONFIG_FILES[@]}" -gt 1 ]; then
echo "Error: Found multiple .runtimeconfig.json files in ${LAMBDA_TASK_ROOT}. Expected ${ASSEMBLY_NAME}.runtimeconfig.json." 1>&2
exit 106
fi

# Check if there were any matches to the *.runtimeconfig.json glob, and that the glob was resolved
# This makes the matching independent from the global `nullopt` shopt's value (https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html)
if [ "${#RUNTIMECONFIG_FILES[@]}" -ne 1 ] || echo "${RUNTIMECONFIG_FILES[0]}" | grep -q -F '*'; then
Expand Down
12 changes: 11 additions & 1 deletion Libraries/src/Amazon.Lambda.RuntimeSupport/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ else
if ! [ -f "${DEPS_FILE}" ]; then
DEPS_FILES=( "${LAMBDA_TASK_ROOT}"/*.deps.json )

if [ "${#DEPS_FILES[@]}" -gt 1 ]; then
Comment thread
dscpinheiro marked this conversation as resolved.
Resolved
echo "Error: Found multiple .deps.json files in ${LAMBDA_TASK_ROOT}. Expected ${ASSEMBLY_NAME}.deps.json." 1>&2
exit 105
fi

# Check if there were any matches to the *.deps.json glob, and that the glob was resolved
# This makes the matching independent from the global `nullopt` shopt's value (https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html)
if [ "${#DEPS_FILES[@]}" -ne 1 ] || echo "${DEPS_FILES[0]}" | grep -q -F '*'; then
Expand All @@ -81,6 +86,11 @@ else
if ! [ -f "${RUNTIMECONFIG_FILE}" ]; then
RUNTIMECONFIG_FILES=( "${LAMBDA_TASK_ROOT}"/*.runtimeconfig.json )

if [ "${#RUNTIMECONFIG_FILES[@]}" -gt 1 ]; then
echo "Error: Found multiple .runtimeconfig.json files in ${LAMBDA_TASK_ROOT}. Expected ${ASSEMBLY_NAME}.runtimeconfig.json." 1>&2
exit 106
fi

# Check if there were any matches to the *.runtimeconfig.json glob, and that the glob was resolved
# This makes the matching independent from the global `nullopt` shopt's value (https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html)
if [ "${#RUNTIMECONFIG_FILES[@]}" -ne 1 ] || echo "${RUNTIMECONFIG_FILES[0]}" | grep -q -F '*'; then
Expand Down Expand Up @@ -118,4 +128,4 @@ else
else
exec -- "${AWS_LAMBDA_EXEC_WRAPPER}" "${DOTNET_BIN}" "${DOTNET_EXEC}" "${DOTNET_ARGS[@]}"
fi
fi
fi
Loading