Skip to content
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

fatal: 'origin' is not a commit and a branch 'v0.14.1' cannot be created from it #589

Open
Voxar opened this issue Feb 7, 2025 · 5 comments

Comments

@Voxar
Copy link

Voxar commented Feb 7, 2025

I got the asdf 0.16 notice a few days ago on our failing GHA builds. I Added the with: asdf_branch: v0.14.1 as 0.14.1 seemed to be the version used on our latest successful build, and that worked.

But since yesterday we are instead met with this message. Any ideas to what could possibly have changed?

Run asdf-vm/actions/install@v3
  with:
    asdf_branch: v0.14.1
    skip_install: false
  env:
    EXPO_BUILD_RELEASE: true
Updating asdf in ASDF_DIR "/Users/runner/.asdf" on branch "v0.14.1"
/opt/homebrew/bin/git remote set-branches origin v0.14.1
/opt/homebrew/bin/git fetch --depth 1 origin v0.14.1
From https://github.com/asdf-vm/asdf
 * tag               v0.14.1    -> FETCH_HEAD
/opt/homebrew/bin/git checkout -B v0.14.1 origin
fatal: 'origin' is not a commit and a branch 'v0.14.1' cannot be created from it
Error: Action failed with error Error: The process '/opt/homebrew/bin/git' failed with exit code 128

The build step

      - name: Install asdf & tools
        uses: asdf-vm/actions/install@v3
        with:
          asdf_branch: v0.14.1

Same result when I try asdf_branch: v0.15.0

@Voxar
Copy link
Author

Voxar commented Feb 7, 2025

Here's the log from the successful build 2 days ago

Run asdf-vm/actions/install@v3
  with:
    asdf_branch: v0.14.1
    skip_install: false
  env:
    EXPO_BUILD_RELEASE: true
Cloning asdf into ASDF_DIR "/Users/runner/.asdf" on branch "v0.14.1"
/opt/homebrew/bin/git clone --depth 1 --branch v0.14.1 --single-branch https://github.com/asdf-vm/asdf.git /Users/runner/.asdf
Cloning into '/Users/runner/.asdf'...
/Users/runner/.asdf/bin/asdf plugin-list
No plugins installed
Installing nodejs plugin...
/Users/runner/.asdf/bin/asdf plugin-add nodejs
initializing plugin repository...Cloning into '/Users/runner/.asdf/repository'...
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

@Voxar
Copy link
Author

Voxar commented Feb 7, 2025

How can the git commands be so different?

Working:

/opt/homebrew/bin/git clone --depth 1 --branch v0.14.1 --single-branch https://github.com/asdf-vm/asdf.git /Users/runner/.asdf`

Failing:

/opt/homebrew/bin/git remote set-branches origin v0.14.1
/opt/homebrew/bin/git fetch --depth 1 origin v0.14.1

@Voxar
Copy link
Author

Voxar commented Feb 7, 2025

Ah. I am cacheing the .asdf directory and the failing builds are trying to do an update instead of an install.

The update step is broken:

if (fs.existsSync(asdfDir)) {
core.info(`Updating asdf in ASDF_DIR "${asdfDir}" on branch "${branch}"`);
const options = {cwd: asdfDir};
await exec.exec('git', ['remote', 'set-branches', 'origin', branch], options);
await exec.exec('git', ['fetch', '--depth', '1', 'origin', branch], options);
await exec.exec('git', ['checkout', '-B', branch, 'origin'], options);
} else {

@Voxar
Copy link
Author

Voxar commented Feb 7, 2025

It might be a new minor git version that broke it

Working build with .asdf cache hit

  /opt/homebrew/bin/git version
  git version 2.47.1

Broken build with .asdf cache hit

  /opt/homebrew/bin/git version
  git version 2.48.1

@Voxar
Copy link
Author

Voxar commented Feb 7, 2025

And this is why we want to cache the .asdf directory

Cache miss
Image

Cache hit
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant