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

Use glob syntax when probing members in [workspace] for Cargo itself #11988

Closed
weihanglo opened this issue Apr 17, 2023 · 7 comments · Fixed by #11996
Closed

Use glob syntax when probing members in [workspace] for Cargo itself #11988

weihanglo opened this issue Apr 17, 2023 · 7 comments · Fixed by #11996
Labels
A-building-cargo-itself Area: issues with building cargo A-workspaces Area: workspaces C-enhancement Category: enhancement E-easy Experience: Easy S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@weihanglo
Copy link
Member

This is just for the record of making it happen in Cargo the project itself. The actual feature request is in #11405 and other issues listed there.

The problem in cargo itself is that both crates/* and crates/credential/* contain crates, but when probing with crates/* Cargo expects crates/credential to be a workspace member.

@weihanglo weihanglo added A-building-cargo-itself Area: issues with building cargo C-enhancement Category: enhancement A-workspaces Area: workspaces labels Apr 17, 2023
@epage
Copy link
Contributor

epage commented Apr 18, 2023

Should we move credential/ into the root to unblock this?

Longer term, #11362 fits this situation.

@weihanglo
Copy link
Member Author

I think yes in the short-term moving crates is a better approach. It's relatively easy to rollback so let's do it.

Keep in mind that we also need to update code here in rust-lang/rust accordingly.

BTW I found that cargo-credential-gnome-secret is not built in rust-lang/rust. Perhaps just an oversight when updating cargo submodule?

@weihanglo weihanglo added E-mentor E-easy Experience: Easy S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review and removed E-mentor labels Apr 19, 2023
@ehuss
Copy link
Contributor

ehuss commented Apr 19, 2023

BTW I found that cargo-credential-gnome-secret is not built in rust-lang/rust. Perhaps just an oversight when updating cargo submodule?

That was intentional. At the time, the version of Linux used in the dist builders was too old for libsecret. I'm not sure if that is still the case. However, it needs to be linked dynamically, and I'm not sure how that would work when transferred to various different distros. The current intent is that if someone wants to use cargo-credential-gnome-secret, they need to manually build it (cargo install cargo-credential-gnome-secret). There is some documentation for this in the unstable chapter.

bors added a commit that referenced this issue Apr 19, 2023
chore: Use globs for workspace members

This is a short-term option until we can have a better solution for globbing.  This does not update `benches/` to support which has a README in there preventing globbing; this seems low-churn enough not to find a solution for it.

On the next sync-up with rust-lang/rust, we'll need to update https://github.com/rust-lang/rust/blob/4e463012580415a932ae4fc255aff45982c70369/src/bootstrap/tool.rs#L588-L603

Fixes #11988
@bors bors closed this as completed in 895435f Apr 19, 2023
heisen-li pushed a commit to heisen-li/cargo that referenced this issue Apr 21, 2023
This is a short-term option until we can have a better solution for
globbing.  This does not update `benches/` to support which has a README
in there preventing globbing; this seems low-churn enough not to find a
solution for it.

On the next sync-up with rust-lang/rust, we'll need to update https://github.com/rust-lang/rust/blob/4e463012580415a932ae4fc255aff45982c70369/src/bootstrap/tool.rs#L588-L603

Fixes rust-lang#11988
@kornelski
Copy link
Contributor

Are you sure about this change? I can't run workspace commands since that has been changed:

cargo test
error: failed to load manifest for workspace member `/Users/user/www/cargo/crates/credential`

Caused by:
  failed to read `/Users/user/www/cargo/crates/credential/Cargo.toml`

Caused by:
  No such file or directory (os error 2)


cargo fmt
`cargo metadata` exited with an error: error: failed to load manifest for workspace member `/Users/user/www/cargo/crates/credential`

Caused by:
  failed to read `/Users/user/www/cargo/crates/credential/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
cargo-fmt
This utility formats all bin and lib files of the current crate using rustfmt.

USAGE:
    cargo fmt [OPTIONS] [-- <rustfmt_options>...]

ARGS:
    <rustfmt_options>...    Options passed to rustfmt

@weihanglo
Copy link
Member Author

Hmm… in which commit you ran these commands? 🤔

Mine looks fine with dcc4702. CI also reported it without failures.

- run: cargo fmt --all --check

@weihanglo
Copy link
Member Author

Maybe you need to rm -r crates/credential?

@kornelski
Copy link
Contributor

I was using master branch of a pre-existing cargo checkout. rm -rf did solve the problem! I guess that was the pitfall of git not managing directories directly.

charles-r-earp pushed a commit to charles-r-earp/cargo that referenced this issue May 3, 2023
This is a short-term option until we can have a better solution for
globbing.  This does not update `benches/` to support which has a README
in there preventing globbing; this seems low-churn enough not to find a
solution for it.

On the next sync-up with rust-lang/rust, we'll need to update https://github.com/rust-lang/rust/blob/4e463012580415a932ae4fc255aff45982c70369/src/bootstrap/tool.rs#L588-L603

Fixes rust-lang#11988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-building-cargo-itself Area: issues with building cargo A-workspaces Area: workspaces C-enhancement Category: enhancement E-easy Experience: Easy S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants