-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Confusing assertion error when building docs without git installed #9789
Comments
You found the culprint of the build process on freebsd. That is great. I agree that either git should be optional or a better error message should be introduced. You are able to unlock the 0.35.1 package on freebsd then, right? For people that do not know @myfreeweb is the maintainer of the crystal and shards port on freebsd. |
Hm, the strict dependency on git should have been removed in 0.35.0 with #9119 and #8792 (maybe also others I don't remember). The doc generator should definitely work without git installed. I know I checked that and it worked. However, this issue definitely reproduces: $ sudo docker run --rm -it crystallang/crystal:0.35.1 bash
root@2f26525752d5:/# apt remove -yq git
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
git-man krb5-locales less libbsd0 libcurl3-gnutls libedit2 liberror-perl libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libnghttp2-14 libpsl5 librtmp1 libssl1.0.0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6
libxext6 libxmuu1 multiarch-support openssh-client publicsuffix xauth
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
git
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 32.3 MB disk space will be freed.
(Reading database ... 19825 files and directories currently installed.)
Removing git (1:2.17.1-1ubuntu0.7) ...
root@2f26525752d5:/# crystal docs
Unhandled exception: Crystal::Compiler#program cannot be nil (NilAssertionError)
from crystal/src/compiler/crystal/compiler.cr:157:5 in 'report_warnings'
from crystal/src/compiler/crystal/command.cr:142:5 in 'run'
from crystal/src/compiler/crystal.cr:11:1 in '__crystal_main'
from crystal/src/crystal/main.cr:105:5 in 'main'
from src/env/__libc_start_main.c:94:2 in 'libc_start_main_stage2' |
So it seems The actual error is this:
|
I posted a fix in #9867. The doc generator now correctly runs if git is not installed. Can you verify this @myfreeweb? The patch from #9867 should be sufficient, the other PR just fixes a subsequent bug. |
Building 0.35.1 in a clean environment (FreeBSD packaging) would fail with a confusing
turns out, right after it tries to execute git:
and installing git fixes it.
Would be nice to make git not required (probably there's already a way to provide the git rev or whatever it wants?) but at least please make a good error message!
The text was updated successfully, but these errors were encountered: