Skip to content

Commit 4d815e6

Browse files
committed
cmd-build: drop logic for comparing image inputs
Let's drop the logic for comparing the definitions for image settings between two runs. The image.json/platform.json etc were added into the OSTree commit/container a while back (starting with [1]) and so if the image inputs change so will the OSTree commit. [1] 816ebae
1 parent 08787bc commit 4d815e6

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

src/cmd-build

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -345,28 +345,8 @@ if [ -f "${changed_stamp}" ] && [ -f "${composejson}" ]; then
345345
# Save this in case the image build fails
346346
cp-reflink "${composejson}" "${workdir}"/tmp/compose-"${commit}".json
347347
else
348-
commit="${previous_commit}"
349-
image_input_checksum=$( (echo "${commit}" && echo "${image_config_checksum}") | sha256sum_str)
350-
echo "commit: ${commit} image: ${image_input_checksum}"
351-
352-
# Grab the previous treecompose JSON (local developer case: treecompose succeeded but
353-
# image build failed) if possible, otherwise grab the previous build
354-
cached_previous_composejson=${workdir}/tmp/compose-${commit}.json
355-
if [ -f "${cached_previous_composejson}" ]; then
356-
echo "Resuming partial build from: ${commit}"
357-
cp-reflink "${cached_previous_composejson}" "${composejson}"
358-
else
359-
if [ -z "${previous_build}" ]; then
360-
# This can happen if building the bootable container worked on the first time,
361-
# but image creation failed, and then tmp/ was nuked before trying a
362-
# second time. Just recommend re-running with --force.
363-
fatal "compose tree had no changes, but no previous build or cached data; try rerunning with --force"
364-
fi
365-
echo "Commit ${commit} unchanged; reusing previous build's rpm-ostree metadata"
366-
# This will have all of the data from the previous build, but we'll
367-
# overwrite things.
368-
cp-reflink "${previous_builddir}"/meta.json "${composejson}"
369-
fi
348+
echo "No changes in build inputs."
349+
exit 0
370350
fi
371351

372352
if [ -n "${previous_build}" ]; then
@@ -388,8 +368,6 @@ else
388368
echo '{}' > tmp/parent-diff.json
389369
fi
390370

391-
image_input_checksum=$( (echo "${commit}" && echo "${image_config_checksum}") | sha256sum_str)
392-
echo "New image input checksum: ${image_input_checksum}"
393371
init_build_meta_json "${commit}" "${PARENT_BUILD:-}" tmp/
394372
buildid=$(jq -r '.["buildid"]' < tmp/meta.json)
395373
echo "New build ID: ${buildid}"
@@ -449,7 +427,6 @@ else
449427
runv rpm-ostree compose container-encapsulate --max-layers="$MAX_OSTREECONTAINER_LAYERS" --format-version=1 \
450428
--repo="${tmprepo}" \
451429
--label="coreos-assembler.image-config-checksum=${image_config_checksum}" \
452-
--label="coreos-assembler.image-input-checksum=${image_input_checksum}" \
453430
--label="org.opencontainers.image.source=${gitsrc}" \
454431
--label="org.opencontainers.image.revision=${config_gitrev}" \
455432
--copymeta-opt=fedora-coreos.stream \
@@ -479,7 +456,6 @@ cat > tmp/buildmeta.json <<EOF
479456
"summary": "${summary//\"/\\\"}",
480457
"coreos-assembler.build-timestamp": "${build_timestamp}",
481458
"coreos-assembler.image-config-checksum": "${image_config_checksum}",
482-
"coreos-assembler.image-input-checksum": "${image_input_checksum}",
483459
"coreos-assembler.code-source": "${src_location}",
484460
EOF
485461

0 commit comments

Comments
 (0)