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

Alleviate the need for ecosystem-wide upgrading to 0.4.1 #74

Merged
merged 2 commits into from
Nov 23, 2021

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Nov 19, 2021

This PR is opened against master, but in reality it should be merged into 5207e99.

Using the semver trick, we can make upgrading from 0.3 to 0.4.1 much less painful!
We simply add a v0.3 HasRawWindowHandle impl for a v0.4.1 HasRawWindowHandle, and release v0.3.4.

The idea is that this will allow crates whose purpose is to provide an HasRawWindowHandle implementation to upgrade first (e.g. winit, sdl2, glfw, fltk, ...). When a sufficient amount of "provider" crates have upgraded, "consumer" crates (e.g. gfx, wgpu, rfd, ...) can safely start upgrading while minimizing breakage for downstream users.

Uses the semver trick, see https://github.com/dtolnay/semver-trick

The idea is that this will allow crates whose purpose is to provide an `HasRawWindowHandle` implementation to upgrade first (e.g. `winit`, `sdl2`, `glfw`, `fltk`, ...). When a sufficient amount of "provider" crates have upgraded, "consumer" crates (e.g. `gfx`, `wgpu`, `rfd`, ...) can safely start upgrading without breaking for downstream users.
@madsmtm madsmtm changed the title Make implementors of HasRawWindowHandle v0.4.1 also implement v0.3's Alleviate the need for ecosystem-wide upgrading to 0.4.1 Nov 19, 2021
@madsmtm
Copy link
Member Author

madsmtm commented Nov 19, 2021

It would be helpful if someone could create a 0.3 branch targetting 5207e99, then it becomes much easier to review and discuss this PR

@maroider maroider changed the base branch from master to semver-trick November 19, 2021 10:40
@maroider
Copy link
Member

I hope this was what you wanted :)

@@ -16,6 +16,7 @@ appveyor = { repository = "rust-windowing/raw-window-handle" }

[dependencies]
libc = {version="0.2", features=[]}
new = { version = "0.4.1", package = "raw-window-handle" }
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if this, or by using extern crate raw_window_handle as new; is the most robust way to rename a crate?

@madsmtm madsmtm marked this pull request as ready for review November 19, 2021 12:15
@madsmtm
Copy link
Member Author

madsmtm commented Nov 19, 2021

If you agree that this is desirable, I'm thinking the way forward is to:

  • We merge this
  • Add a second PR (or just a commit) that releases v0.3.4 (and updates the changelog)
  • Finally merge the semver-trick branch into master again (and in the merge remove everything that this PR added, except the changelog entry)

@Lokathor
Copy link
Contributor

This all seems like a good idea, but i've never done the semver trick thing before.

First, I should just merge this, right?

@madsmtm
Copy link
Member Author

madsmtm commented Nov 21, 2021

Well, I haven't done it before either, but I'm fairly certain it will work, so yes, merge this and make a release v0.3.4, I can also open a PR for that (but since the changelog entry should include the release date it seems a bit brittle).

It should be noted that adding blanket implementations of HasRawWindowHandle is technically a breaking change in case a downstream crate manually implements both the old and new version of the trait. This is very, very unlikely, given how little time 0.4 has been released for.

@Lokathor
Copy link
Contributor

Okay, i'll merge this now then.

@Lokathor Lokathor merged commit 71f428d into rust-windowing:semver-trick Nov 23, 2021
@madsmtm madsmtm mentioned this pull request Nov 24, 2021
@madsmtm madsmtm deleted the 0.3-semver-trick branch November 27, 2021 09:55
msiglreith pushed a commit to rust-windowing/winit that referenced this pull request Nov 30, 2021
* Update raw-window-handle to `0.4.2`

See:
- rust-windowing/raw-window-handle#72
- rust-windowing/raw-window-handle#73
- rust-windowing/raw-window-handle#74

* Clean up raw_window_handle functions a bit
MarijnS95 added a commit to ash-rs/ash that referenced this pull request Jan 10, 2022
`raw-window-handle 0.3.4` was pushed as a "semver-trick-like" patch
release, implementing the `0.3` trait for the `0.4` crate release [74].
This allows `ash-window` as a window-handle "consumer" crate to accept
both `0.3` and `0.4` handles from consumer crates simultaneously.  To
ensure this patch release is available even when users omit regular
`cargo update` or build with `-Z minimal-versions`, set the minimal
patch version in `Cargo.toml` to it.

[74]: rust-windowing/raw-window-handle#74
Ralith pushed a commit to ash-rs/ash that referenced this pull request Jan 10, 2022
#553)

`raw-window-handle 0.3.4` was pushed as a "semver-trick-like" patch
release, implementing the `0.3` trait for the `0.4` crate release [74].
This allows `ash-window` as a window-handle "consumer" crate to accept
both `0.3` and `0.4` handles from consumer crates simultaneously.  To
ensure this patch release is available even when users omit regular
`cargo update` or build with `-Z minimal-versions`, set the minimal
patch version in `Cargo.toml` to it.

[74]: rust-windowing/raw-window-handle#74
madsmtm added a commit that referenced this pull request Aug 10, 2022
madsmtm added a commit that referenced this pull request Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants