-
-
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
Configure Crystal compiler version in Makefile #6748
Configure Crystal compiler version in Makefile #6748
Conversation
Some complicated logic was used to detect the current compiler version from git tags. This method is unreliable and could produce invalid results. This is completely removed from Crystal source code and the version is set as env var `CRYSTAL_CONFIG_VERSION` in the `Makefile`. The value is determined from the most recent release listed in `CHANGELOG.md`. This is a reliable method even if the code is not checked out in a git repository. By default, `-dev` suffix is appended to the version. For creating a release build with a non-dev version, `CRYSTAL_CONFIG_VERSION` needs to be explicitly specified.
a107c84
to
b74af2d
Compare
Regarding the CI failures: How does |
I am not in favor of using the changelog as a source of information for the compiler or the build process. The current source code already allows a specific version to be used as branding (set a value in In other projects I worked in, having the literal version that is been built is nice as simple. Then we enforce that tagged build match that description and non tag build have a One issue I have with changing the tagging is that after a release, until some period of time we don't know if the next release will be a minor or patch. So there is some inconsistency if the version is not updated immediately after release. I understand the recent glitch in travis, and that the process can be changed/simplified, but this also affect the whole build process. I don't think we should invest effort in this area for the time being because:
Maybe we should document better how to create releases of other distros to help mainteners a bit more. I believe the core nature of the PR is that. |
Why not? It's always available when the compiler source code is and it reliably points to the most recent release of the source code. The currently used algorithm uses much weaker sources. Git is not always available and it doesn't reliably point to the most recent tag and the current compiler version doesn't necessarily have any connection to the source version.
And this doesn't change with this PR. In fact, the build processes should not require any modification at all (unless I'm missing something?).
I don't really understand hat concern. The version should only be updated at a release. This PR shouldn't break existing release build processes. |
Ideally the solution should be in a separate project – |
Some complicated logic was used to detect the current compiler version
from git tags. This method is unreliable and could produce invalid
results.
This is completely removed from Crystal source code and the version is
set as env var
CRYSTAL_CONFIG_VERSION
in theMakefile
. The value isdetermined from the most recent release listed in
CHANGELOG.md
. Thisis a reliable method even if the code is not checked out in a git
repository.
By default,
-dev
suffix is appended to the version. For creating arelease build with a non-dev version,
CRYSTAL_CONFIG_VERSION
needsto be explicitly specified.
Example usage (assuming inside a git repo):
Previously, the development version would have been
Crystal 0.26.1+64 [ga107c84]
, orCrystal 0.26.1+?
if not built inside a git repository. The release version would have beenCrystal 0.27.0 [ga107c84]
.The number of commits since release has been lost. But I don't think it has much meaning and is unreliable. It wouldn't be difficult to add it back, though. A maybe even more important option could be including the branch name in a development build, if inside a git repository.
An alternative or supplementary source for the most recent release could also be a
VERSION
file. ButCHANGELOG.md
should be pretty solid.Fixes #6715