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

git ls-files fails with exit code 128 during opam install --deps-only #87

Closed
artagnon opened this issue Apr 29, 2023 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@artagnon
Copy link

Of late, I've been seeing my builds fail for the following reason:

+ (script @ line 12) $ opam install --confirm-level=unsafe-yes -j 2 . --deps-only
[368](https://github.com/artagnon/bonak/actions/runs/4838247477/jobs/8622599444#step:4:373)
  Error:  Command "/usr/bin/git ls-files" failed:
[369](https://github.com/artagnon/bonak/actions/runs/4838247477/jobs/8622599444#step:4:374)
  "/usr/bin/git ls-files" exited with code 128

I wonder if this is a permissions issue.

@erikmd
Copy link
Member

erikmd commented Apr 29, 2023

a permissions issue.

Maybe you're right

→ as suggested in https://github.com/coq-community/docker-coq-action#permissions and #86 :

could you try adding this code in your workflow.yml ?

      before_install: |
        startGroup "Workaround permission issue"
          sudo chown -R coq:coq .  # <--
        endGroup
        startGroup "Print opam config"
          opam config list; opam repo list; opam list
        endGroup

If this work, I'll commit to make this workaround implied and permanent.

@erikmd erikmd added the bug Something isn't working label Apr 29, 2023
@erikmd erikmd self-assigned this Apr 29, 2023
@artagnon
Copy link
Author

Works and the build passes, but the Post Run actions/checkout fails (soft failure):

error: could not lock config file .git/config: Permission denied
[14](https://github.com/artagnon/bonak/actions/runs/4838333751/jobs/8622724358#step:8:14)

See complete logs here: https://github.com/artagnon/bonak/actions/runs/4838333751/jobs/8622724358

@erikmd
Copy link
Member

erikmd commented Apr 29, 2023

OK! good news.

The remaining warning is standard, as mentioned in https://github.com/coq-community/docker-coq-action/#permissions, just add a final step:

  - name: Revert permissions
    # to avoid a warning at cleanup time
    if: ${{ always() }}
    run: sudo chown -R 1001:116 .  # <--

@artagnon
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants