-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build_sysext: override FLATCAR_VERSION only for non-official builds #2276
Conversation
this is from commit: 5b70e83 Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
build_sysext
Outdated
VERSION_BOARD=$(source "${BUILD_DIR}/fs-root/usr/lib/os-release" && echo "$VERSION") | ||
|
||
if [ -z "$REPO_BUILD_ID" ] ; then | ||
if [[ -z $REPO_BUILD_ID ]] && [[ ! -f $BOARD_ROOT/etc/portage/package.use/official ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this rely on ${COREOS_OFFICIAL}
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure - COREOS_OFFICIAL
seems to be set conditionnaly from this result is_official "${vernum}"
- which just checks if the vernum
is like this: MAJOR.MINOR.PATCH
- so it's OK but not in the case of a rebuild: a rebuild from a released version will have this semver structure but it's not an official build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's only set from the ci-automation
, so a user rebuilding a release tag will not have it set unless they want to produce an "official" release. They would have to explicitly export it themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - I see some kind of similar logic here too:
Lines 357 to 363 in 61b0004
# Official builds must set COREOS_OFFICIAL=1 to use an official version. | |
# Unofficial builds always appended the build identifier. | |
if [[ ${COREOS_OFFICIAL:-0} -ne 1 && -n "${FLATCAR_BUILD_ID}" ]]; then | |
FLATCAR_VERSION="${FLATCAR_VERSION_ID}+${FLATCAR_BUILD_ID}" | |
else | |
FLATCAR_VERSION="${FLATCAR_VERSION_ID}" | |
fi |
Without this, official builds are failing: ``` This is a dev rebuild of an official release tag: No BUILD ID set in '/mnt/host/source/.repo/manifests/version.txt'. Will use base squasfs BUILD ID for version check. Repo root FLATCAR_VERSION is '4081.0.0', squashfs build ID is '2024-09-03-2245' Setting FLATCAR_VERSION to '4081.0.0+2024-09-03-2245' Base squashfs version: 4081.0.0 SDK board packages version: 4081.0.0+2024-09-03-2245 Version mismatch between board flatcar release and SDK container flatcar release. ``` The "base squashfs version" is the actual version for official release builds. Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
9c5af52
to
5a8ecab
Compare
cherry-picked to:
|
Build action triggered: https://github.com/flatcar/scripts/actions/runs/10703495878 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch, thank you! This one's on me, I should have checked for COREOS_OFFICIAL
/ an empty build ID in the squashfs to begin with.
Thank you for the fix, looks good!
In the current release, I noticed this error for all channels:
I assume it's a side effect of this PR: #2259.
From my understanding, the "Base squashfs version" is equals to the actual released version for release builds (e.g 4081.0.0) - in this case, if we override the FLATCAR_VERSION with "4081.0.0+2024-09-03-2245" we are creating a version mismatch.
I added an extra-check to assert that we are building an official release, we do not override the FLATCAR_VERSION for official releases -> so we shoud not get a mismatch.
EDIT: cc @t-lo if you can give a second look as you've worked in this area recently 🙏