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

Add named path bases to cargo (v2) #3529

Merged
merged 10 commits into from
Aug 5, 2024
Merged

Conversation

dpaoliello
Copy link
Contributor

@dpaoliello dpaoliello commented Nov 14, 2023

Introduce shared base directories in Cargo configuration files that in turn enable base-relative path dependencies.

Rendered

Draft Implementation PR: rust-lang/cargo#12974

This is a resurrection of @jonhoo's RFC (#3074). Many thanks and kudos to him for the idea, original RFC text and original implementation.

FCP proposed: checkboxes at #3529 (comment)

Tracking Issue: rust-lang/cargo#14355

@ehuss ehuss added the T-cargo Relevant to the Cargo team, which will review and decide on the RFC. label Nov 14, 2023
@runiq
Copy link

runiq commented Nov 16, 2023

Mind fixing the 'Rendered' link in the OP? https://github.com/dpaoliello/rfcs/blob/basepath/text/3529-cargo-path-bases.md :)

@dpaoliello
Copy link
Contributor Author

Mind fixing the 'Rendered' link in the OP? https://github.com/dpaoliello/rfcs/blob/basepath/text/3529-cargo-path-bases.md :)

Oops, my bad, thanks!

@dpaoliello
Copy link
Contributor Author

Creating a thread on Rust internals to discuss alternative solutions for this issue: https://internals.rust-lang.org/t/integration-with-mono-repos-via-intermediate-directories/20160

@joshtriplett
Copy link
Member

We discussed this in today's @rust-lang/cargo meeting. We were generally in favor, but wanted to see a few changes made.

@rfcbot merge

First, this should be base-paths, rather than base_path, for consistency with other manifest fields which use plurals and dashes.

@rfcbot concern rename-to-base-paths

Second, it should be possible to define this in Cargo.toml, not only in config.toml. config.toml or environment variables can always override, but Cargo.toml should be able to define the default values.

@rfcbot concern define-in-manifest-override-in-config

Third, we should restrict the possible names for bases, to reserve space for extension in the future. We felt that base names should be restricted to the same naming as package names: "The name must use only alphanumeric characters or - or _, and cannot be empty."

@rfcbot concern base-names-alphanumeric-with-dash-or-underscore

Finally, this should define a mechanism for Cargo to provide built-in base paths. User-defined base paths should shadow built-in base paths, so that we can add more in the future without creating conflicts. And we should provide a built-in workspace base path that refers to your workspace root.

@rfcbot concern allow-built-in-base-paths-with-shadowing
@rfcbot concern define-built-in-workspace-base-path

@rfcbot
Copy link
Collaborator

rfcbot commented Jun 18, 2024

Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members:

Concerns:

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. disposition-merge This RFC is in PFCP or FCP with a disposition to merge it. labels Jun 18, 2024
Introduce shared base directories in Cargo configuration files that in turn enable base-relative path dependencies.
@dpaoliello
Copy link
Contributor Author

@joshtriplett I've updated the RFC to address these concerns

Also, I especially love the built-in workspace base path - that's super nice!

@joshtriplett
Copy link
Member

@rfcbot resolved rename-to-base-paths

@joshtriplett
Copy link
Member

@rfcbot resolved allow-built-in-base-paths-with-shadowing
@rfcbot resolved define-built-in-workspace-base-path

@joshtriplett
Copy link
Member

@rfcbot resolved base-names-alphanumeric-with-dash-or-underscore

@joshtriplett
Copy link
Member

@rfcbot resolved define-in-manifest-override-in-config

@joshtriplett
Copy link
Member

@dpaoliello Thank you for the updates!

@epage
Copy link
Contributor

epage commented Jul 25, 2024

@rfcbot resolved comments

@rfcbot rfcbot added the final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. label Jul 25, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Jul 25, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. label Jul 25, 2024
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this RFC. and removed final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. labels Aug 4, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Aug 4, 2024

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

Copy link
Contributor

@arlosi arlosi left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this @dpaoliello and all commentors and reviewers!

@arlosi arlosi merged commit 46781d0 into rust-lang:master Aug 5, 2024
@dpaoliello dpaoliello deleted the basepath branch August 5, 2024 19:22
bors added a commit to rust-lang/cargo that referenced this pull request Aug 14, 2024
Implement base paths (RFC 3529) 1/n: path dep and patch support

RFC: rust-lang/rfcs#3529
Tracking Issue: #14355

This PR add support in path dependencies and `patch` table and the `workspace` built-in path base.
dpaoliello added a commit to dpaoliello/cargo that referenced this pull request Aug 19, 2024
RFC: rust-lang/rfcs#3529
Tracking Issue: rust-lang#14355

This PR adds the `--base` option to `cargo add` to allow adding a path dependency with a path base.
dpaoliello added a commit to dpaoliello/cargo that referenced this pull request Aug 19, 2024
RFC: rust-lang/rfcs#3529
Tracking Issue: rust-lang#14355

This PR adds the `--base` option to `cargo add` to allow adding a path dependency with a path base.
dpaoliello added a commit to dpaoliello/cargo that referenced this pull request Aug 20, 2024
RFC: rust-lang/rfcs#3529
Tracking Issue: rust-lang#14355

This PR adds the `--base` option to `cargo add` to allow adding a path dependency with a path base.
dpaoliello added a commit to dpaoliello/cargo that referenced this pull request Aug 27, 2024
RFC: rust-lang/rfcs#3529
Tracking Issue: rust-lang#14355

This PR adds the `--base` option to `cargo add` to allow adding a path dependency with a path base.
dpaoliello added a commit to dpaoliello/cargo that referenced this pull request Sep 5, 2024
RFC: rust-lang/rfcs#3529
Tracking Issue: rust-lang#14355

This PR adds the `--base` option to `cargo add` to allow adding a path dependency with a path base.
dpaoliello added a commit to dpaoliello/cargo that referenced this pull request Sep 6, 2024
RFC: rust-lang/rfcs#3529
Tracking Issue: rust-lang#14355

This PR adds the `--base` option to `cargo add` to allow adding a path dependency with a path base.
bors added a commit to rust-lang/cargo that referenced this pull request Sep 6, 2024
Implement path-bases (RFC 3529) 2/n: `cargo [add|remove|update]` support

RFC: rust-lang/rfcs#3529
Tracking Issue: #14355

This PR adds the `--base` option to `cargo add` to allow adding a path dependency with a path base.
dingxiangfei2009 pushed a commit to dingxiangfei2009/cargo that referenced this pull request Sep 17, 2024
RFC: rust-lang/rfcs#3529
Tracking Issue: rust-lang#14355

This PR adds the `--base` option to `cargo add` to allow adding a path dependency with a path base.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This RFC is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this RFC. T-cargo Relevant to the Cargo team, which will review and decide on the RFC. to-announce
Projects
Archived in project
Status: Unreviewed
Development

Successfully merging this pull request may close these issues.

9 participants