-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Undetected git version should be a run-time error #15636
Comments
Partially a dupe of #10851. Shallow checkouts or no-git builds are fine if you're building from a release tag, but going to hit this problem anywhere else. Feature testing would generally be a better idea than version number comparisons though, if you can come up with a reliable feature test for every change that Compat and others need to worry about. Considering how rarely this comes up I don't think there will be much support for being rigorous about adding tag constants though. Post-1.0, maybe. Usually "this would be a good candidate for Compat" isn't immediately apparent. |
much of the time, feature tests can be accomplished with a simple |
Maybe Compat could print a very explicit warning on load when version info is not available? (At least until we are able to replace all version checks with |
Compat doesn't work without version information. Why not abort with an error instead? Also, since Julia doesn't have version information, it should make this explicit in its version string. Silently reporting an incomplete (wrong) version is not a good idea. Maybe Julia could report the version as |
Exactly what criteria do you propose using for the abort? Some way of indicating that the precise build number is unknown wouldn't be a bad idea though. |
A version number that ends in |
#17434 may help alleviate some of your concerns here |
I built Julia from a shallow git repository. There was a build-time warning about not being able to determine the git version number, which I saw and ignored, since I didn't know the cause for the warning. At run time, many packages (e.g. HDF5, MPI) didn't install, and I received very strange warnings from Compat.
It turns out that Compat looks at the git version number to determine what features to provide in which way, and git needs a non-shallow repo to be able to determine the version number. I didn't know either of these facts initially.
With a shallow git repo, Julia reports its version as
0.5.0-dev
, which looks inconspicious. However, with a non-shallow repo, the version number is e.g.0.5.0-dev+3263
, and Compat requires this additional bit to work.Since Compat is so fundamental, this deserves a much more visible warning, or error, and an explanation when it occurs.
I can think of several solutions:
The text was updated successfully, but these errors were encountered: