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

Unlink geo-types from the rest of the crates #798

Closed
wants to merge 1 commit into from

Conversation

nyurik
Copy link
Member

@nyurik nyurik commented Apr 6, 2022

Remove geo-types patches in Cargo.toml files, so that geo-types is now completelly separated from the rest of the code.

This should be reverted once geo-types 0.8+ is released.

This PR makes it easier to review unlinking part, in preparation for #797 and #772

  • I agree to follow the project's code of conduct.
    - [ ] I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

@nyurik nyurik changed the title remove all deprecated geo-types features, unlink it Unlink geo-types from the rest of the crates Apr 6, 2022
Remove `geo-types` patches in `Cargo.toml` files, so that `geo-types` is now completelly separated from the rest of the code.

This should be reverted once geo-types 0.8+ is released.
@michaelkirk
Copy link
Member

What's the goal of removing patching?

It's a pretty commonly used approach. And if someone is building within the georust/geo workspace (as in they've checked out the code and are in that directory when they run cargo foo) it's likely they are wanting to use the code in that directory, not whatever has been published to crates.

@nyurik
Copy link
Member Author

nyurik commented Apr 6, 2022

@michaelkirk this method was initially suggested by @frewsxcv in #742 (comment) -- and it worked wonderfully, without requiring patches that pointed to unreleased git branches. This makes it possible to cleanly review, merge, and release geo-types without breaking or patching any other crates or their CI, and will allow us to work on updating other crates afterwards independently of all the 3D/M related breaking changes.

@michaelkirk
Copy link
Member

michaelkirk commented Apr 6, 2022

and it worked wonderfully, without requiring patches that pointed to unreleased git branches.

Just to make sure we're on the same page here, the changes in this commit will only affect people who have checked out this repository and are running cargo commands from within their checked out workspace. Right?

I don't think it's inherently bad to build unreleased dependencies when building unreleased code. And actually, I think it's what most people expect. That's why it's set up that way. I expect this change will be worse for most people.

@nyurik
Copy link
Member Author

nyurik commented Apr 6, 2022

Just to make sure we're on the same page here, the changes in this commit will only affect people who have checked out this repository and are running cargo commands from within their checked out workspace. Right?

yes -- only devs working with this repo will temporarily (until this PR is reverted) will be affected. But doing it this way we ensure that we can cleanly isolate the entire "PR→review→merge→publish" cycle for the geo-types crate without affecting other crates in this repo, as well as the proj and wkt repos. They can be modified/upgraded/released on its own schedule. Potentially we may even want to keep it cleanly separated this way going forward, but this is a separate TBD discussion outside of the scope here.

I don't think it's inherently bad to build unreleased dependencies when building unreleased code. And actually, I think it's what most people expect. That's why it's set up that way. I expect this change will be worse for most people.

I kinda agree with you here, but only if we would have had all round-about dependencies (proj & wkt) together in one mono-repo. All code would then be easily changed at once, and CI would ensure internal repo consistency. I think linking to other repo's unreleased/unmerged code violates this CI consistency, and might cause more concerns than to solve them.

@michaelkirk
Copy link
Member

To help me understand, can you lay out a specific "bad" scenario that might plausibly arise if we did not merge this PR?

@nyurik
Copy link
Member Author

nyurik commented Apr 6, 2022

To help me understand, can you lay out a specific "bad" scenario that might plausibly arise if we did not merge this PR?

The biggest issues I think are the scope creep, difficulty of review, less certainty in CI's results, and historical revision stability.

  • My approach only changes 24 files, which is actually 3 PRs - 798, 772, and 797. They are easier to review one by one, with stable publishable code base after each merge, and changes limited to just one crate. It is possible to go back in history and compile each revision and expect it to pass. It does not rely on ephemeral (unpublished) branches of any other repo. Lastly, CI does its job as it is suppose to -- it tells us that each crate in all repos can be safely published after each merge, and users can expect all of them to work properly. (this approach is not possible without this PR)

  • With the 742 approach you suggested, it requires changes to 35 files with a single PR that touches code in multiple crates, plus 3 files in wkt/85, and the main branch in this PR relies on the continuous presence of a non-main branch in wkt (it could be deleted at any moment without realizing that geo 's main branch CI depends on it -- so you cannot reliably revert to it and expect it to compile as before. CI in this case does not really tell us if geo-types or any other crate in this repo can be published because it only passes due to the patching hack, not because each crate's code is stable on its own.

@michaelkirk
Copy link
Member

As I understand it, the scenario of concern is:

If the unreleased commits in the dependency (e.g. proj) get deleted, then people might not be able to build the unreleased commits in this library.

Is that right?

@nyurik
Copy link
Member Author

nyurik commented Apr 11, 2022

It turns out this is a moot point! The moment proj is released, we can merge TZM changes without this PR -- all thanks to the default generic parameters as described in #797 (comment)

cc: @categulario @urschrei -- two latest contributors to proj

P.S. For the sake of completeness -- @michaelkirk , you are correct. Plus another scenario -- someone in the future tries to find the source of a bug using git bisect, and they are unable to use it because checking out and compiling an old revision would fail because old revision depends on external state.

@michaelkirk
Copy link
Member

michaelkirk commented Apr 17, 2022

I'm still not really sold on the changes in this PR. I expect people who have checked out the repo and are building the local workspace are going to be surprised when using geo-types other than what's in the repo.

The moment proj is released, we can merge TZM changes without this PR.

But I have no reservations about shepherding along a proj release, if that's helpful! georust/proj#123

bors bot added a commit to georust/proj that referenced this pull request Apr 18, 2022
123: Prepare for 0.26.0 release. r=urschrei a=michaelkirk

Anything else we should be waiting for before the 0.26.0 release?

`@nyurik` mentioned that releasing this makes some things simpler for them: georust/geo#798 (comment)



Co-authored-by: Michael Kirk <[email protected]>
@nyurik nyurik marked this pull request as draft April 21, 2022 17:27
@frewsxcv
Copy link
Member

Closing for inactivity. Feel free to reopen if you resume work on this.

@frewsxcv frewsxcv closed this Jul 29, 2023
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.

3 participants