-
Notifications
You must be signed in to change notification settings - Fork 639
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
Run docker as the current user #1630
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks the build on my Mac.
waterman@Andrews-Mac-mini:~/riscv-isa-manual$ make build/riscv-privileged.html
id: illegal option -- -
usage: id [user]
id -A
id -F [user]
id -G [-n] [user]
id -P [user]
id -g [-nr] [user]
id -p [user]
id -u [-nr] [user]
rm -rf build/riscv-privileged.html.workdir && mkdir -p build/riscv-privileged.html.workdir && cp -r src docs-resources build/riscv-privileged.html.workdir
docker run --rm -v /Users/waterman/riscv-isa-manual/build/riscv-privileged.html.workdir:/build -w /build --user riscvintl/riscv-docs-base-container-image:latest /bin/sh -c " LANG=C.utf8 asciidoctor --trace -a compress -a mathematical-format=svg -a pdf-fontsdir=docs-resources/fonts -a pdf-theme=docs-resources/themes/riscv-pdf.yml -D build --failure-level=ERROR --require=asciidoctor-bibtex --require=asciidoctor-diagram --require=asciidoctor-lists --require=asciidoctor-mathematical src/riscv-privileged.adoc "
docker: invalid reference format.
See 'docker run --help'.
make: *** [build/riscv-privileged.html] Error 125
If you have real Docker (not Podman) then by default it will run everything as root, so your build directory is owned by root and the Makefile will not work at all because it tries to modify the build directory. This adds a flag so that Asciidoctor runs as the current user in Docker instead of root.
4cef106
to
4d3cac3
Compare
Ah I guess Mac doesn't support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I confirmed this version works. Thanks.
Reverting for now as this breaks Linux builds, i.e. my local Fedora 40, as well as the GH workflow to release on merge. |
This didn't break the GH workflow to release on merge. That is still working, e.g. here. All of the failures are in forks which obviously shouldn't be able to publish new releases. (Maybe that step should be skipped for forks to make it less confusing...) Also when you said you tried a clean checkout, did you actually delete the build directory or just do Please can you confirm and re-apply this? |
Actually this was after it merged; but the point still stands - the failures are expected. |
*before :-D |
Yep, I completely deleted the riscv-isa-manual repo locally and re-cloned it. The issue occurred again. Post revert, the broken GH workflow completed successfully. See here: https://github.com/riscv/riscv-isa-manual/actions I have to leave this reverted for now so that the merges successfully create releases when branches are merged. But I'll continue to investigate. |
Can you point me to the failed GH workflow though? I can't see any unexpected failures. Can you also tell me what command you are running that fails, and are you using Docker or Podman? |
Sure, here's a link to a failed workflow: https://github.com/riscv/riscv-isa-manual/actions/runs/10986155225/job/30499080610 And here's the actual error:
/home/runner/work/riscv-isa-manual/riscv-isa-manual/build/riscv-privileged.html
env: Locally, I was simply running make. It was erroring on permissions against the build directory. And I'm using Docker. |
Yeah that failure has nothing to do with this PR. It failed because it was running in a fork. Your recent workflow passed because it was not running in a fork: If you check the history of that action every run from a fork fails in the same way. To debug the other issue (which sounds very strange; I'm also using Docker, and the distro shouldn't make a difference), can you run these commands and post the output?
|
Sorry, ignore the last two
|
id /var/lib/gems/3.0.0/gems/asciidoctor-mathematical-0.3.5/lib/asciidoctor-mathematical/extension.rb:168:in write': Permission denied @ rb_sysopen - /build/src/images/stem-527c932105a6826cbbe80abc7f968d0b.svg (Errno::EACCES) from /var/lib/gems/3.0.0/gems/asciidoctor-mathematical-0.3.5/lib/asciidoctor-mathematical/extension.rb:168:in make_equ_image'from /var/lib/gems/3.0.0/gems/asciidoctor-mathematical-0.3.5/lib/asciidoctor-mathematical/extension.rb:141:in block in handle_inline_stem' from /var/lib/gems/3.0.0/gems/asciidoctor-mathematical-0.3.5/lib/asciidoctor-mathematical/extension.rb:124:in gsub'from /var/lib/gems/3.0.0/gems/asciidoctor-mathematical-0.3.5/lib/asciidoctor-mathematical/extension.rb:124:in handle_inline_stem' from /var/lib/gems/3.0.0/gems/asciidoctor-mathematical-0.3.5/lib/asciidoctor-mathematical/extension.rb:96:in handle_prose_block'from /var/lib/gems/3.0.0/gems/asciidoctor-mathematical-0.3.5/lib/asciidoctor-mathematical/extension.rb:40:in block in process' from /var/lib/gems/3.0.0/gems/asciidoctor-mathematical-0.3.5/lib/asciidoctor-mathematical/extension.rb:39:in each'from /var/lib/gems/3.0.0/gems/asciidoctor-mathematical-0.3.5/lib/asciidoctor-mathematical/extension.rb:39:in process' from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/document.rb:545:in []'from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/document.rb:545:in block in parse' from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/document.rb:544:in each'from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/document.rb:544:in parse' from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/load.rb:84:in load'from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/convert.rb:78:in convert' from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/convert.rb:190:in block in convert_file'from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/convert.rb:190:in open' from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/convert.rb:190:in convert_file'from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/cli/invoker.rb:129:in block in invoke!' from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/cli/invoker.rb:112:in each'from /var/lib/gems/3.0.0/gems/asciidoctor-2.0.23/lib/asciidoctor/cli/invoker.rb:112:in invoke!' from /var/lib/gems/3.0.0/gems/asciidoctor-pdf-2.3.18/bin/asciidoctor-pdf:46:in <top (required)>'from /usr/local/bin/asciidoctor-pdf:25:in load' from /usr/local/bin/asciidoctor-pdf:25:in 'make[2]: *** [Makefile:98: build/riscv-privileged.pdf] Error 1 make[2]: Leaving directory '/home/wmat/dev/riscv-isa-manual' make[1]: *** [Makefile:123: build-container] Error 2 make[1]: Leaving directory '/home/wmat/dev/riscv-isa-manual' make: *** [Makefile:113: build] Error 2 ls -ld build docker run --rm -v docker run --rm -v docker run --rm -v |
Ah I think maybe you're running rootless docker? What's the output of this command?
|
I am indeed running it rootless: I believe when I set it up I followed the instructions here: https://docs.docker.com/engine/install/linux-postinstall/ |
If you have real Docker (not Podman) then by default it will run everything as root, so your build directory is owned by root and the Makefile will not work at all because it tries to modify the build directory.
This adds a flag so that Asciidoctor runs as the current user in Docker instead of root.