-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Leverage the --workspace
flag when running cargo command against cargo itself
#11987
Comments
I feel like I'm missing the distinction between #11526 and #5220, they look like duplicates to me. I also feel that conceptually, conditional workspace members are a bad idea and both should be rejected. As the syntax is laid out, I read it as cargo resolving differently depending on the platform which means the lockfile is no longer cross-platform. For me, I'd like a variant of #9406 which is instead #9406 and That said, I see this as short-term and long-term. Longer-term, we should do something like this but we likely don't want to wait on design and stablizxation, so we should do conditional builds in the short term. |
Totally valid. I was waiting for a response from #11526 but no. Closed. And yep, clarified the short-term and long-term fixes in the PR descriptions. Thanks for the reply! |
fix: Allow win/mac credential managers to build on all platforms ### What does this PR try to resolve? This is a step towards #11987 by making two of the platform-specific credential managers build on all platforms using `cfg`. I haven't done `gnome-secret` yet because that is more of an oddball in that it isn't just platforms-specific but dependent on what is installed on that platform. ### How should we test and review this PR? ```console $ cargo check --workspace --exclude cargo-credential-gnome-secret ``` Note that the commits are broken down so you can view the movements of code separate from the functionality being changed. ### Additional information Other information you want to mention in this PR, such as prior arts, future extensions, an unresolved problem, or a TODO list. --> <!-- homu-ignore:end -->
I'll try to solve the |
Hey, I wanted to work on this. I just had a couple of questions before I get started.
When you say target, this is talking about platform targets, correct? |
Yes. Please read relevant issues to track their progress. This pull request is more like blocked on other pull requests or features. For exammple, I don't think there is an easy way to skip |
Ok. Thanks. I was just thinking of adding an option to the package field to set the required platforms and having that be the filter of whether a package needs to be built. I read through the previous suggestions, and from my understanding, this is what seems to be the expected solution? |
Thanks for being interested in this! However Note that this is labeled as Sorry for the confusion 😔. |
chore(ci): Automatically test new packages by using `--workspace` ### What does this PR try to resolve? This is a part of #11987 that was unblocked by #12321 and #11993 ### How should we test and review this PR? Relying on CI to verify this I'd prefer to move the `cargo test --workspace` step earlier but we run out of disk space if we do (we currently only have 661 MB of headroom of windows-gnu) See the individual commits for smaller chunks and explanations for why changes were made.
chore(ci): Automatically test new packages by using `--workspace` ### What does this PR try to resolve? This is a part of #11987 that was unblocked by #12321 and #11993 ### How should we test and review this PR? Relying on CI to verify this I'd prefer to move the `cargo test --workspace` step earlier but we run out of disk space if we do (we currently only have 661 MB of headroom of windows-gnu) See the individual commits for smaller chunks and explanations for why changes were made.
chore(ci): Automatically test new packages by using `--workspace` ### What does this PR try to resolve? This is a part of #11987 that was unblocked by #12321 and #11993 ### How should we test and review this PR? Relying on CI to verify this I'd prefer to move the `cargo test --workspace` step earlier but we run out of disk space if we do (we currently only have 661 MB of headroom of windows-gnu) See the individual commits for smaller chunks and explanations for why changes were made.
This should be resolved by |
Problem
After #11851 Cargo becomes a Cargo workspace. That means we can dogfood ourselves finally 🎉.
We left some TODOs in that pull request, one of them are making
--workspace
usable for cargo itself. That is, makingcargo build
and other subcommands happy with--workspace
flag, instead of using-p
flag everywhere in our CI workflow yaml.Some workspace members are platform-dependant inside cargo workspace, i.e.,
cargo-credential-gnome-secret
and friends. We don't really have a good programming way to get the list other thancargo metadata | jq .workspace_members[] -r | cut -d' ' -f1
. As a consequence, we expands the list manually in a ugly way:cargo/.github/workflows/main.yml
Lines 117 to 128 in 5861176
We want to make running command like
cargo test --workspace
as easy as possible to reduce the friction in CI also in contributor experience.Proposed Solution
In the long term, we could look into #5220 and also the comment here #11987 (comment).
An alternative workaround in the short term would be making those subcrates and dependencies platform specific via conditional compilation. For example, dependencies could be listed in
target."cfg(not(windows))".dependencies
section. And have alib.rs
doing nothing but delegating tounix/lib.rs
orwindows/lib.rs
with#[cfg(…)]
, and one of them also does nothing.Notes
I think at least the follow commands should be able to run with
--workspace
for cargo itself.cargo build
/cargo check
cargo test
cargo doc
cargo clippy
(this is blocked on Add a[lints]
table toCargo.toml
rfcs#3389, so we can more easily propagate our clippy settings)The text was updated successfully, but these errors were encountered: