Skip to content

coreos-base/coreos-init: add EGIT_BRANCH#2739

Merged
tormath1 merged 1 commit intoflatcar-4081from
tormath1/init
Mar 11, 2025
Merged

coreos-base/coreos-init: add EGIT_BRANCH#2739
tormath1 merged 1 commit intoflatcar-4081from
tormath1/init

Conversation

@tormath1
Copy link
Contributor

@tormath1 tormath1 commented Mar 11, 2025

As we are using the git eclass, we can't simply use a git ref if this one is on another branch, we need to pass the git branch as well.


Locally tested with:

$ ebuild coreos-init-0.0.1-r196.ebuild clean prepare
Appending /mnt/host/source/src/scripts/sdk_container/src/third_party/coreos-overlay to PORTDIR_OVERLAY...
 * Running stacked hooks for pre_pkg_setup
 *    sysroot_build_bin_dir ...                                                                                                                        [ ok ]
 * Checking whether python3_11 is suitable ...
 *   dev-lang/python:3.11 ...                                                                                                                          [ ok ]
 * Using python3.11 to build (via PYTHON_COMPAT iteration)
>>> Unpacking source...
 * Repository id: flatcar_init.git
 * To override fetched repository properties, use:
 *   EGIT_OVERRIDE_REPO_FLATCAR_INIT
 *   EGIT_OVERRIDE_BRANCH_FLATCAR_INIT
 *   EGIT_OVERRIDE_COMMIT_FLATCAR_INIT
 *   EGIT_OVERRIDE_COMMIT_DATE_FLATCAR_INIT
 *
 * Fetching https://github.com/flatcar/init.git ...
git fetch https://github.com/flatcar/init.git +refs/heads/flatcar-4081-backport:refs/heads/flatcar-4081-backport
git update-ref --no-deref refs/git-r3/coreos-base/coreos-init/0/__main__ 0900245444ab5a4af480805ab51986bbd58ffc7f
 * Checking out https://github.com/flatcar/init.git to /var/tmp/portage/coreos-base/coreos-init-0.0.1-r196/work/coreos-init-0.0.1 ...
git checkout --quiet 0900245444ab5a4af480805ab51986bbd58ffc7f
GIT update -->
   repository:               https://github.com/flatcar/init.git
   at the commit:            0900245444ab5a4af480805ab51986bbd58ffc7f
>>> Source unpacked in /var/tmp/portage/coreos-base/coreos-init-0.0.1-r196/work
>>> Preparing source in /var/tmp/portage/coreos-base/coreos-init-0.0.1-r196/work/coreos-init-0.0.1 ...
>>> Source prepared.

before (or CI: http://localhost:8080/job/container/job/packages/8837/consoleFull):

$ ebuild coreos-init-0.0.1-r196.ebuild clean prepare
Appending /mnt/host/source/src/scripts/sdk_container/src/third_party/coreos-overlay to PORTDIR_OVERLAY...
 * Running stacked hooks for pre_pkg_setup
 *    sysroot_build_bin_dir ...                                                                                                                        [ ok ]
 * Checking whether python3_11 is suitable ...
 *   dev-lang/python:3.11 ...                                                                                                                          [ ok ]
 * Using python3.11 to build (via PYTHON_COMPAT iteration)
>>> Unpacking source...
Initialized empty Git repository in /mnt/host/source/.cache/distfiles/git3-src/flatcar_init.git/
 * Repository id: flatcar_init.git
 * To override fetched repository properties, use:
 *   EGIT_OVERRIDE_REPO_FLATCAR_INIT
 *   EGIT_OVERRIDE_BRANCH_FLATCAR_INIT
 *   EGIT_OVERRIDE_COMMIT_FLATCAR_INIT
 *   EGIT_OVERRIDE_COMMIT_DATE_FLATCAR_INIT
 *
 * Fetching https://github.com/flatcar/init.git ...
git fetch https://github.com/flatcar/init.git +HEAD:refs/git-r3/HEAD
remote: Enumerating objects: 2649, done.
remote: Counting objects: 100% (290/290), done.
remote: Compressing objects: 100% (104/104), done.
remote: Total 2649 (delta 212), reused 188 (delta 186), pack-reused 2359 (from 3)
Receiving objects: 100% (2649/2649), 678.39 KiB | 5.95 MiB/s, done.
Resolving deltas: 100% (1302/1302), done.
From https://github.com/flatcar/init
 * [new ref]         HEAD       -> refs/git-r3/HEAD
git update-ref --no-deref refs/git-r3/coreos-base/coreos-init/0/__main__ 0900245444ab5a4af480805ab51986bbd58ffc7f
fatal: update_ref failed for ref 'refs/git-r3/coreos-base/coreos-init/0/__main__': cannot update ref 'refs/git-r3/coreos-base/coreos-init/0/__main__': trying to write ref 'refs/git-r3/coreos-base/coreos-init/0/__main__' with nonexistent object 0900245444ab5a4af480805ab51986bbd58ffc7f
 * ERROR: coreos-base/coreos-init-0.0.1-r196::coreos-overlay failed (unpack phase):
 *   Referencing 0900245444ab5a4af480805ab51986bbd58ffc7f failed (wrong ref?).
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_unpack
 *   environment, line 3187:  Called git-r3_src_unpack
 *   environment, line 2398:  Called git-r3_src_fetch
 *   environment, line 2392:  Called git-r3_fetch
 *   environment, line 2279:  Called die
 * The specific snippet of code:
 *                   die "Referencing ${remote_ref} failed (wrong ref?).";
 *
 * If you need support, post the output of `emerge --info '=coreos-base/coreos-init-0.0.1-r196::coreos-overlay'`,
 * the complete build log and the output of `emerge -pqv '=coreos-base/coreos-init-0.0.1-r196::coreos-overlay'`.
 * The complete build log is located at '/var/log/portage/coreos-base:coreos-init-0.0.1-r196:20250311-084718.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/coreos-base/coreos-init-0.0.1-r196/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/coreos-base/coreos-init-0.0.1-r196/temp/environment'.
 * Working directory: '/var/tmp/portage/coreos-base/coreos-init-0.0.1-r196/work'
 * S: '/var/tmp/portage/coreos-base/coreos-init-0.0.1-r196/work/coreos-init-0.0.1'

(or see CI)

This PR is the LTS version but it has to be adapted and backported to:

  • flatcar-4230
  • flatcar-4186
  • flatcar-4152

CI (OK at least the coreos-init emerging is OK): http://localhost:8080/job/container/job/packages_all_arches/5539/cldsv/

As we are using the `git` eclass, we can't simply use a git ref if this
one is on another branch, we need to pass the git branch as well.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
@tormath1 tormath1 merged commit dc4d7f8 into flatcar-4081 Mar 11, 2025
1 of 3 checks passed
@tormath1 tormath1 deleted the tormath1/init branch March 11, 2025 12:10
@tormath1
Copy link
Contributor Author

"Cherry-picked" to:

  • flatcar-4230
  • flatcar-4186
  • flatcar-4152

@github-actions
Copy link

Build action triggered: https://github.com/flatcar/scripts/actions/runs/13787795143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants