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

Fix failing book build in docker due to git fatal error #447

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

crywolf
Copy link
Contributor

@crywolf crywolf commented Aug 9, 2023

When building the book in docker, the build has failed:

$ docker run --rm -it -v "$(realpath .)":/repo -u "$(id -u)" crypto101 ./make-lang en latexpdf

make: Entering directory '/repo'
make -C src/ -f Makefile.assets
make[1]: Entering directory '/repo/src'
make[1]: Nothing to be done for 'assets'.
make[1]: Leaving directory '/repo/src'
Running Sphinx v4.3.2
fatal: detected dubious ownership in repository at '/repo'
To add an exception for this directory, call:

	git config --global --add safe.directory /repo

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/config.py", line 329, in eval_config_file
    exec(code, namespace)
  File "/repo/src/conf.py", line 62, in <module>
    version = run_command("git", "rev-parse", "--short", "HEAD")
  File "/repo/src/conf.py", line 59, in run_command
    return subprocess.check_output(args).decode().strip()
  File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('git', 'rev-parse', '--short', 'HEAD')' returned non-zero exit status 128.

make: *** [Makefile:41: html] Error 2
make: Leaving directory '/repo'

This PR fixes the error.
(Note: I used --system instead of --global because there is not /home/runner/ directory in the docker image.)

@lvh
Copy link
Member

lvh commented Aug 10, 2023

Thanks!

@lvh lvh merged commit fdd5dbb into crypto101:master Aug 10, 2023
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

Successfully merging this pull request may close these issues.

2 participants