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

Improve Crystal version detection #2856

Merged
merged 1 commit into from
Jun 16, 2016

Conversation

jhass
Copy link
Member

@jhass jhass commented Jun 16, 2016

  • Inherit parent compiler version if git is unavailable/failed and no explicit version is given
  • Handle shallow clones by assuming being compiled by the latest
    released compiler
  • Preserve commits since release in version number unless there are none

The last point means the head version now looks like this: Crystal 0.18.0+23 [adf408d] (2016-06-16), with Crystal::VERSION being 0.18.0+23. This is in accordance with http://semver.org/#spec-item-10

Travis does shallow clones, but it will always compile with the latest released compiler, that means with this the first std_spec run will have Crystal::VERSION be the latest released compiler, so currently 0.18.0, the second std_spec run will have Crystal::VERSION with the shallow clone case, so currently 0.18.0+?.

The build in this PR will fail as long as CRYSTAL_CONFIG_VERSION is set via Travis web interface. This is why it's always to prefer to set environment variables via .travis.yml or bin/ci.

@jhass jhass added this to the 0.18.1 milestone Jun 16, 2016
@asterite
Copy link
Member

Note that I'd like to release 0.18.1, not 0.18.0+15. Do your changes work with that in mind?

@jhass
Copy link
Member Author

jhass commented Jun 16, 2016

Yes. Note I just edited the description to clarify how versions on Travis now look like.

@asterite
Copy link
Member

I also wouldn't error in the first case. A library might depend on the compiler and it would be tedious if it didn't compile out of the box and one would have to set an ENV var for that.

@jhass
Copy link
Member Author

jhass commented Jun 16, 2016

What about inheriting Crystal::VERSION from the parent compiler too in that case?

@asterite
Copy link
Member

Good idea :-)

@jhass jhass force-pushed the sane_version_detection branch from adf408d to 360a7ec Compare June 16, 2016 20:01

Verified

This commit was signed with the committer’s verified signature.
jhass Jonne Haß
* Inherit parent compiler version if git is unavailable/failed and
  no explicit version is given
* Handle shallow clones by assuming being compiled by the latest
  released compiler
* Preserve commits since release in version number unless there are none
@jhass jhass force-pushed the sane_version_detection branch from 360a7ec to c10b977 Compare June 16, 2016 20:07
jhass added a commit that referenced this pull request Jun 16, 2016
@jhass jhass merged commit c10b977 into crystal-lang:release/0.18 Jun 16, 2016
@jhass jhass deleted the sane_version_detection branch June 16, 2016 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants