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

Properly (de)serialize VersionSpec to JSON #93

Merged
merged 2 commits into from
Jan 8, 2021

Conversation

fingolfin
Copy link
Member

This changes Dependency objects to always (?) store a full VersionSpec, not just a VersionNumber, and (de)serialize that properly. Fixes #89 (well, I hope).

Before this, JuliaPackaging/BinaryBuilder.jl#981 should be merged.

CC @benlorenz @thofma

Comment on lines +117 to +118
version(d::AbstractDependency) = getpkg(d).version
version(d::Dependency) = d.pkg.version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference? Isn't the first method sufficient?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is (and was) not enough, which I tried to explain in the comment I added above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any suggestions on how to make this clearer are welcome :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make this explicit: this trick is not by me, it was added by @staticfloat as part of the build_version support; I merely dropped the (now unnecessary) __version and added a comment in an attempt to clarify what's going on (well, or at least give a hint as to what's going on). It can probably be phrased better (and I just noticed a typo).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was missing that getpkg(d::Dependency) isn't as simple as d.pkg. At this point I find a bit questionable that method, since this is basically undoing it.

src/Dependencies.jl Outdated Show resolved Hide resolved
@fingolfin
Copy link
Member Author

@staticfloat @giordano it would be really good to get this or something equivalent merged and used on Yggdrasil; it is starting to seriously bite me in the a... now

@staticfloat staticfloat merged commit 3c5dc11 into JuliaPackaging:master Jan 8, 2021
@staticfloat
Copy link
Member

Thanks Max! We can fix up the getpkg() stuff later. :)

@fingolfin fingolfin deleted the mh/VersionSpec branch January 8, 2021 19:05
fingolfin added a commit to fingolfin/Yggdrasil that referenced this pull request Jan 8, 2021
... and all their deps, while at it.

I need this for JuliaPackaging/BinaryBuilderBase.jl#93
giordano added a commit to JuliaPackaging/Yggdrasil that referenced this pull request Jan 9, 2021
* Update to latest BB and BBB

... and all their deps, while at it.

I need this for JuliaPackaging/BinaryBuilderBase.jl#93

* [.ci] Update from an older version of Julia

Co-authored-by: Mosè Giordano <mose@gnu.org>
giordano added a commit that referenced this pull request Jan 9, 2021
giordano added a commit to giordano/Yggdrasil that referenced this pull request Jan 9, 2021
We had to revert JuliaPackaging/BinaryBuilderBase.jl#93
because it breaks registration of the LLVM package.
giordano added a commit to JuliaPackaging/Yggdrasil that referenced this pull request Jan 9, 2021
We had to revert JuliaPackaging/BinaryBuilderBase.jl#93
because it breaks registration of the LLVM package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meta JSON serialization does not preserve VersionSpec
3 participants