Stream: MetaCoq

Topic: CI failure


view this post on Zulip Jason Gross (Mar 21 2023 at 14:02):

What's up with

Now run 'opam upgrade' to apply any package updates.
  + (script @ line 12) $ opam install --confirm-level=unsafe-yes -j 2 . --deps-only
  Error:  Command "/usr/bin/git ls-files" failed:
  "/usr/bin/git ls-files" exited with code 128

?

Seems to be happening systematically...

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 11:57):

I thought it would be fixed by your CI changes, apparently not

view this post on Zulip Yannick Forster (Mar 22 2023 at 11:59):

I debugged for about an hour this morning - no idea what's going on

view this post on Zulip Yannick Forster (Mar 22 2023 at 11:59):

I didn't find the problem reported on the Internet

view this post on Zulip Yannick Forster (Mar 22 2023 at 11:59):

I can't reproduce locally

view this post on Zulip Yannick Forster (Mar 22 2023 at 11:59):

MetaCoq doesn't use git ls-files

view this post on Zulip Yannick Forster (Mar 22 2023 at 12:00):

The Coq action also does not mention ls-files anywhere in its repo

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 12:01):

Darn

view this post on Zulip Yannick Forster (Mar 22 2023 at 12:03):

So I think it's really coming from within opam

view this post on Zulip Yannick Forster (Mar 22 2023 at 12:05):

It's used in the pin command (opamPinned.ml) via opams_of_dir_w_target, files_in_source_w_target, versioned_files`

view this post on Zulip Yannick Forster (Mar 22 2023 at 12:05):

Where there is a call git repo_root ~verbose:false [ "ls-files" ] @@> fun r ->

view this post on Zulip Yannick Forster (Mar 22 2023 at 12:06):

But given that we can't reproduce locally, this info doesn't help that much

view this post on Zulip Yannick Forster (Mar 22 2023 at 12:06):

Other Coq docker action based projects do not seem to have the issue

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 14:12):

Hmm, the mistery thickens

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:17):

I can find info online that applies to actions that want to commit to the repo: https://jonathansoma.com/everything/git/github-actions-403-error/

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:17):

But that's not what we're doing

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:19):

Ah, I also tried running the command git ls-files as part of the checktodos action - that also works fine

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:20):

So it's not just about any run of git ls-files

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:20):

Probably opam is using a specific one that fails...

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 14:23):

https://community.garden.io/t/command-git-ls-files-ignored-failed-with-code-128/117

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 14:23):

Probably that's it

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:24):

I saw that, but we don't have the fatal: ls-files -i must be used with either -o or -c part in the output

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:25):

For us it's just /usr/bin/git ls-files failed

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:25):

No additional args, especially not -i

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:26):

There's one other call of git ls-files in opam using (git dir ["ls-files"; "--others"; "--exclude-standard"]

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 14:27):

It was removed from opam two weeks ago: https://github.com/ocaml/opam/commit/7ebd76871e62334651009e6a8faadae9fbb80711

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 14:27):

The one in opamGit.mll

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:29):

That seems to be in fetch of opam

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:29):

That could be a hint

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:35):

But the commit message " git: differentiate non initialised repo and branch not found errors " does not really apply to our situation

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 14:44):

https://discuss.deepsource.io/t/breaking-deepsource-test-coverage-github-action/507

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 14:44):

This might be related too..

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:46):

Any ideas why it happens just now?

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 14:46):

I have no idea :)

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 14:46):

I tried using the checkout@v3 action, it might also be it

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:46):

https://github.com/actions/runner/issues/2033

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:48):

Maybe the sudo chown -R coq:coq breaks something? Because then the .git repo has the wrong owner?

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:54):

Ah no, that can't be it, because we're not even getting far enough for this to be run

view this post on Zulip Yannick Forster (Mar 22 2023 at 14:59):

yesssssssssssss

view this post on Zulip Yannick Forster (Mar 22 2023 at 15:00):

I think that was it

view this post on Zulip Yannick Forster (Mar 22 2023 at 15:00):

https://github.com/yforster/template-coq/actions/runs/4491296470

view this post on Zulip Yannick Forster (Mar 22 2023 at 15:09):

Indeed we need to run sudo chown -R coq:coq . before anything is executed. And a bit confusingly, even though it is defined later in our workflow file, before_script (where the chown happened) is executed after before_install (where it has to happen and happens now)

view this post on Zulip Yannick Forster (Mar 22 2023 at 15:09):

Why this only seems to affect MetaCoq, I have no idea...

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 15:18):

Wow, well done!

view this post on Zulip Matthieu Sozeau (Mar 22 2023 at 15:18):

I was about to give up again as Cléo has woken up :)

view this post on Zulip Jason Gross (Mar 22 2023 at 17:30):

I'm guessing that the version of git used by Coq's docker image(s) was recently updated? fiat-crypto's docker CI also started failing recently with issues related to https://github.com/actions/checkout/issues/766, see https://github.com/mit-plv/fiat-crypto/pull/1578

view this post on Zulip Jason Gross (Mar 22 2023 at 17:34):

(To add more detail: it used to be the case that you only needed the chown commands to get write access to the files. However, since around April 2022, the newer versions of git also fail on read-only commands (like ls-files) if the directory is owned by the wrong user. If the docker images only recently bumped their git versions, this would explain the issue.)

view this post on Zulip Erik Martin-Dorel (Mar 22 2023 at 21:31):

Hi @Jason Gross,

I think your latest explanation makes sense, indeed.

Does this mean that @Michael Soegtrop's suggestion in https://github.com/coq-community/docker-coq-action/issues/70 should not be applied to https://github.com/coq-community/docker-coq-action#permissions ?

view this post on Zulip Erik Martin-Dorel (Mar 22 2023 at 21:32):

Anyway, I won't have much time this week, so please feel free to open a PR in docker-coq-action (if you believe you did enough tests regarding the "necessary conditions" for the workaround to be applied :+1:)

view this post on Zulip Jason Gross (Mar 23 2023 at 00:27):

Yeah, I think https://github.com/coq-community/docker-coq-action/issues/70 is no longer sufficient given the new version of git, while sudo chown is still sufficient I believe

view this post on Zulip Erik Martin-Dorel (Mar 23 2023 at 13:28):

OK.
I opened an issue in https://github.com/coq-community/docker-coq-action/issues/86; stay tuned for the upcoming fix.

view this post on Zulip Yannick Forster (Mar 23 2023 at 13:28):

Thank you!


Last updated: Apr 20 2024 at 00:02 UTC