Skip to content

Commit da3e6e8

Browse files
committed
Revert "more complete backward compatibility (#775)"
This reverts commit 332e731.
1 parent 332e731 commit da3e6e8

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

scripts/build_layers.sh

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,21 @@ function search_wheel {
116116
}
117117

118118
function docker_build_zip {
119-
# Args: [python version] [zip destination] [wheel base name] [index]
119+
# Args: [python version] [zip destination]
120120

121121
destination=$(make_path_absolute $2)
122122
arch=$3
123-
wheel_basename=$4
124-
index=$5
125123

126124
# Restore pyproject.toml to a clean state for each build iteration
127125
cp pyproject.toml.bak pyproject.toml
128126

129127
# Replace ddtrace source if necessary
130128
if [ -n "$DD_TRACE_COMMIT" ]; then
131-
replace_ddtrace_dep "${wheel_basename} = { git = \"https://github.com/DataDog/dd-trace-py.git\", rev = \"$DD_TRACE_COMMIT\" }"
129+
replace_ddtrace_dep "ddtrace = { git = \"https://github.com/DataDog/dd-trace-py.git\", rev = \"$DD_TRACE_COMMIT\" }"
132130
elif [ -n "$DD_TRACE_COMMIT_BRANCH" ]; then
133-
replace_ddtrace_dep "${wheel_basename} = { git = \"https://github.com/DataDog/dd-trace-py.git\", branch = \"$DD_TRACE_COMMIT_BRANCH\" }"
131+
replace_ddtrace_dep "ddtrace = { git = \"https://github.com/DataDog/dd-trace-py.git\", branch = \"$DD_TRACE_COMMIT_BRANCH\" }"
134132
elif [ -n "$DD_TRACE_WHEEL" ]; then
135-
replace_ddtrace_dep "${wheel_basename} = { file = \"$DD_TRACE_WHEEL\" }"
133+
replace_ddtrace_dep "ddtrace = { file = \"$DD_TRACE_WHEEL\" }"
136134
elif [ -n "$UPSTREAM_PIPELINE_ID" ]; then
137135
S3_BASE="https://dd-trace-py-builds.s3.amazonaws.com/${UPSTREAM_PIPELINE_ID}"
138136
if [ "${arch}" = "amd64" ]; then
@@ -141,7 +139,10 @@ function docker_build_zip {
141139
PLATFORM="manylinux2014_aarch64"
142140
fi
143141
PY_TAG="cp$(echo "$1" | tr -d '.')"
144-
search_wheel ${wheel_basename} ${index}
142+
search_wheel "ddtrace_serverless" "serverless"
143+
if [ -z "${WHEEL_FILE}" ]; then
144+
search_wheel "ddtrace" "manylinux2014"
145+
fi
145146
if [ -z "${WHEEL_FILE}" ]; then
146147
echo "No S3 wheel found for ${PY_TAG} ${PLATFORM}, using default pyproject.toml version"
147148
fi
@@ -162,7 +163,6 @@ function docker_build_zip {
162163

163164
rm -rf $temp_dir
164165
echo "Done creating archive $destination"
165-
rm pyproject.toml.bak
166166
}
167167

168168
rm -rf $LAYER_DIR
@@ -173,10 +173,7 @@ do
173173
for architecture in "${ARCHS[@]}"
174174
do
175175
echo "Building layer for Python ${python_version} arch=${architecture}"
176-
docker_build_zip ${python_version} $LAYER_DIR/${LAYER_FILES_PREFIX}-${architecture}-${python_version}.zip ${architecture} "ddtrace_serverless" "serverless" || true
177-
if [ -f pyproject.toml.bak ]; then # true means the previous attempt failed
178-
docker_build_zip ${python_version} $LAYER_DIR/${LAYER_FILES_PREFIX}-${architecture}-${python_version}.zip ${architecture} "ddtrace" "manylinux2014"
179-
fi
176+
docker_build_zip ${python_version} $LAYER_DIR/${LAYER_FILES_PREFIX}-${architecture}-${python_version}.zip ${architecture}
180177
done
181178
done
182179

0 commit comments

Comments
 (0)