-
-
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
Get version number from CHANGELOG.md when cannot get it from git #4687
Get version number from CHANGELOG.md when cannot get it from git #4687
Conversation
It was working well. I always tagged the commit that I was using for doing a release. Omnibus checks out the repo from git so the tag would be there. I'm not sure we need to change anything. |
(it would be interesting to know why it started to give incorrect versions) |
@asterite this tries to cover the usecase of downloading a zip/tar from Github, without repo history. I think I'd just tag the version as Maybe mixing this with a But I'm not sure what I'd like the version to report on this builds - let alone the heuristics we apply. |
08df94f
to
fe35339
Compare
A zip file or any other method without git is probably not an official way of distribution, but it's still the source code of the compiler at a specific version. I think it should not depend on git being available on the build system. Additionally, I don't think it is wise to rely on The |
@matiasgarciaisaia However, this compiler is unofficial. We may tell about this is built outside of git repo. When |
I regularly compile from tarballs (e.g. alpine, raspbian, ...) not from git clones, so this change is welcomed! |
@makenowjust There is no way to tell if the code being build is from the released tar.gz or has a ton of other modifications, so I think it would make sense to assume it is not the release version by default. |
If we don't know the compiler version and have no way of telling we should fall back to "Unknown" not the version of the compiler it was compiled with. If you're compiling with a tarball you can always set |
Additionally, in such a case we should display a warning message: |
@ysbaddaden In fact I don't build crystal from tar balls, so I don't know how it works. How do you think about it in real world? |
That depends. Alpine's AKPBUILD automatically downloads the tarball for the version to compile. Since it's automated, I properly set the environment variable (but had to thought to set it). On Ubuntu I now just download a tarball and build. I don't have to think to switch branches or checkout a tag, and have a clean install, distinct from the git clone. Easier. But version number is wrong, because I always forget to set the environment variable beforehand. It's a tiny micro minor hitch. We shouldn't bother much, but having a wrong reported version number when building from an official tarball may lead to some confusion. |
Fixed #4642