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

Mix git deps do not play nicely with CI caches #14425

Open
lukaszsamson opened this issue Apr 11, 2025 · 0 comments · May be fixed by #14428
Open

Mix git deps do not play nicely with CI caches #14425

lukaszsamson opened this issue Apr 11, 2025 · 0 comments · May be fixed by #14428

Comments

@lukaszsamson
Copy link
Contributor

Elixir and Erlang/OTP versions

1.18.2

Operating system

linux

Current behavior

When changing locked refs in git dependencies CI cache often leads to failing builds that need manual intervention and cache busting.

In my case I'm using CircleCI build pipeline with cache on

  • /home/circleci/project/_build/test
  • /home/circleci/project/deps

In this particular case switching dep version

  "salad_ui": {:git, "https://github.com/bluzky/salad_ui.git", "38065ed44b7705964c5acbd2fe0d9dc70330e8e2", []},

to

  "salad_ui": {:git, "https://github.com/bluzky/salad_ui.git", "1fb404637c872501ae781505160a3bc51031e5f5", [branch: "v0"]},

lead to untracked files in the dep working tree

mix deps.get
...
* Updating salad_ui (https://github.com/bluzky/salad_ui.git - v0)
error: The following untracked working tree files would be overwritten by checkout:
        .envrc
        flake.lock
        flake.nix
Please move or remove them before you switch branches.
Aborting
** (Mix) Command "git --git-dir=.git checkout --quiet 1fb404637c872501ae781505160a3bc51031e5f5" failed

Expected behavior

Mix could be more aggressive in overwriting cached deps. When checkout fails it could run git clean -fd.
I think the current behaviour is safer and should stay the default one. The aggressive one could be enabled by a flag, e.g. mix deps.get --ci

josevalim added a commit that referenced this issue Apr 11, 2025
@josevalim josevalim linked a pull request Apr 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant