Skip to content

Commit

Permalink
cmd-init: run git submodule update when --commit is used
Browse files Browse the repository at this point in the history
When building RHCOS, we first build for x86_64 on the latest commit
available on the stream's branch. When we trigger builds for other
arches, we want to make sure the same commit of the src config is used,
so we pass `--commit`.

However, `--commit` doesn't reset git submodule, so there's a race
condition where if a submodule bump landed between the x86_64 build and
the multi-arch builds, we would use the latest submodule, rather than
the older one.

Run `git submodule update` to fix this race.
  • Loading branch information
jlebon authored and dustymabe committed May 12, 2023
1 parent bda8db2 commit 1e5d8c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd-init
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ mkdir -p src
if [ -n "${COMMIT}" ]; then
git -C ./config fetch origin "$COMMIT"
git -C ./config reset --hard "$COMMIT"
git -C ./config submodule update --init --recursive
fi
(set +x; cd config && echo -n "Config commit: " && git describe --tags --always --abbrev=42)
;;
Expand Down

0 comments on commit 1e5d8c3

Please sign in to comment.