Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

usezlibVersion() instead of aconst for the version#491

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 1 commit intorust-lang:mainfromfolkertdev:zlib-version
Jun 14, 2025

Conversation

folkertdev
Copy link
Contributor

I don't think there is any downside to just using these functions really. Technically it's an extra function call (unless LTO is able to remove it, I guess). For zlib-rs, the function can just be inlined (it's aconst fn even).

CosminPerRam reacted with thumbs up emoji
Copy link
Member

@ByronByron left a comment

Choose a reason for hiding this comment

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

Thanks a lot, it's great to see that this could work!

I am a bit afraid that this could be a breaking change, as I am pretty sure the the value returned byzlibVersion() won't be exactly the same in all cases.

It's certainly OK to mark this as breaking change and increment the minor version, after all it's probably not many people relying on it.

If we go in that direction, it would probably be helpful to document the new version string format so it can go into the changelog.

Also, I think it's worth it to have another opinion on this.

@folkertdev
Copy link
ContributorAuthor

I am a bit afraid that this could be a breaking change, as I am pretty sure the the value returned byzlibVersion() won't be exactly the same in all cases.

This mechanism is for the library to ensure that 1) everything was linked correctly and 2) the required features in zlib are supported. Generally that means that certain symbols are available that weren't in earlier versions. So the one failure mode I can see is ifflate2 is used with a much older system zlib, and that somehow causing e.g. linker issues.

I believe though that the symbols/functions thatflate2 uses in practice have been unchanged since at least the early 2000s? So I don't think this change is observable.

@oyvindln
Copy link
Contributor

As far as I can see it's not something that's ever accessible externally, the version string is just accessed and passed into the function where in case of the original zlib, there is acheck whether the first byte matches with the internal version number and that the string pointer is notNULL so it shouldn't be any issue changing it.

The underlying zlib version isn't something that can be relied on in any case unless you control the full distrubution since e.g some linux distros like fedora swap out zlib for zlib-ng and debian (and by extension ubuntu)patches flate2 to remove all zlib variations and zlib-rs to only use system stock zlib.

Copy link
Member

@ByronByron left a comment

Choose a reason for hiding this comment

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

Thanks so much for elaborating,@folkertdev and@oyvindln!

Then it should be good to go and in future,zlib-rs andflate2 don't have to be published in lock-step anymore.

However, I will give it till Friday for more comments, and then merge it should there be nothing else coming up.

@folkertdev
Copy link
ContributorAuthor

Sounds good!

I think that, because zlib-rs is pre 1.0, we'll need to change the version bound to (to0.5, or perhaps even>=0.5 because having the C abi and not changing anything about that is kind of the point of that crate.)

Byron reacted with thumbs up emoji

@ByronByron merged commita9d220a intorust-lang:mainJun 14, 2025
15 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ByronByronByron approved these changes

@jongiddyjongiddyAwaiting requested review from jongiddy

@joshtriplettjoshtriplettAwaiting requested review from joshtriplett

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@folkertdev@oyvindln@Byron

[8]ページ先頭

©2009-2025 Movatter.jp