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 a reason to masquerade_as_nightly_cargo so it is searchable #10868

Merged
merged 1 commit into from Jul 16, 2022

Conversation

Muscraft
Copy link
Contributor

When I was working on the stabilization for workspace inheritance, it was very tedious to find all of the places to remove .masquerade_as_nightly_cargo(). I suggested to add a reason to .masquerade_as_nightly_cargo() so that it would be easier to find all of the places to remove it. By adding the reason it makes it easy to search for all places with the features name. This PR adds the reason(s) to all of the places .masquerade_as_nightly_cargo() is called, as well as updates the documentation so it talks about adding a reason when making the call.

@rust-highfive
Copy link

r? @ehuss

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 15, 2022
@@ -192,12 +192,12 @@ Be sure to check the snapshots to make sure they make sense.
#### Testing Nightly Features

If you are testing a Cargo feature that only works on "nightly" Cargo, then
you need to call `masquerade_as_nightly_cargo` on the process builder like
this:
you need to call `masquerade_as_nightly_cargo` on the process builder nd pass
Copy link
Contributor

Choose a reason for hiding this comment

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

nd -> and

@@ -273,7 +273,7 @@ target.\"cfg(target_os = \\\"linux\\\")\".runner = \"runme\" # [ROOT]/home/.carg

cargo_process("config get --show-origin build.rustflags -Zunstable-options")
.cwd(&sub_folder.parent().unwrap())
.masquerade_as_nightly_cargo()
.masquerade_as_nightly_cargo(&["cargo config"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Eh, guess its good enough

  • unstable-options is an umbrella feature
  • nothing else really to specify

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cargo config is unstable which is why I used it. The question I have is should we prefer dashes? as in cargo-config? It might be slightly better

@@ -19,7 +19,7 @@ fn feature_required() {
.file("src/lib.rs", "")
.build();
p.cargo("build")
.masquerade_as_nightly_cargo()
.masquerade_as_nightly_cargo(&["cargo_features"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, unsure what communicates intent best here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I debated with im-a-teapot or test-dummy-unstable but those don't really cover why. always_nightly or both might be better but I am unsure here as well

Comment on lines 55 to +56
p.cargo("build -v -Zcheck-cfg=features")
.masquerade_as_nightly_cargo()
.masquerade_as_nightly_cargo(&["check-cfg"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Haven't dealt with this one before, unsure if we should do it as check-cfg or check-cfg=features

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think check-cfg is better since that is that the unstable feature is called. If certain parts get stabilized before others (like features), at that point it should become check-cfg=features

@@ -32,7 +32,7 @@ fn gated() {
.build();

p.cargo("publish --no-verify")
.masquerade_as_nightly_cargo()
.masquerade_as_nightly_cargo(&["credential-process"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Something is non-obvious here since the -Zcredential-process is unspecified for this and the next test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll dig a bit but removing masquerade_as_nightly_cargo allows it to work but the test is called gated. Maybe it should have -Zcredential-process?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated everything but this. I honestly have no idea why masquerade_as_nightly_cargo is here.

@ehuss it looks like you wrote this, do you have any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

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

There's not really a strong reason to have it one way or the other. Switching to nightly mode makes extra sure that it does not implicitly use the feature without the -Z flag. There are some things that behave differently in nightly mode, and I was probably just trying to be extra paranoid here. But it is also unlikely for that to be a problem in practice.

@@ -2012,7 +2012,7 @@ fn minimal_download() {
// none
// Should be the same as `-Zfeatures=all`
p.cargo("check -Zfeatures=compare")
.masquerade_as_nightly_cargo()
.masquerade_as_nightly_cargo(&["features=compare"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be always_nightly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what this should be. This makes it seem like it shouldn't be nightly forever, or that it should at least be moved to its own command. The correct decision might be to tag it with both I am unsure

Copy link
Contributor

Choose a reason for hiding this comment

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

Either would be fine, this is a permanently unstable option. I'm fine with leaving it as-is.

@Muscraft Muscraft force-pushed the add-reason-for-nightly-tests branch from 3e4f94d to c239e40 Compare July 16, 2022 02:32
@ehuss
Copy link
Contributor

ehuss commented Jul 16, 2022

Thanks! I think I would have preferred just a string to avoid all the extra punctuation, but I don't feel strongly about that. I'm going to go ahead and approve, but if @epage has any other concerns or changes, feel free to comment or post a followup pr.

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 16, 2022

📌 Commit c239e40 has been approved by ehuss

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 16, 2022
@bors
Copy link
Collaborator

bors commented Jul 16, 2022

⌛ Testing commit c239e40 with merge bd5db30...

@bors
Copy link
Collaborator

bors commented Jul 16, 2022

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing bd5db30 to master...

@bors bors merged commit bd5db30 into rust-lang:master Jul 16, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 20, 2022
Update cargo

9 commits in 8827baaa781b37872134c1ba692a6f0aeb37890e..d8d30a75376f78bb0fabe3d28ee9d87aa8035309
2022-07-14 02:56:51 +0000 to 2022-07-19 13:59:17 +0000
- docs: fixing minor error in the default timing report filename (rust-lang/cargo#10879)
- Stabilize `--crate-type` flag for `cargo rustc` (rust-lang/cargo#10838)
- Stabilize `-Zmultitarget` (rust-lang/cargo#10766)
- Clean up leftover in unstable documentation (rust-lang/cargo#10874)
- Normalize path for `cargo vendor` output (rust-lang/cargo#10668)
- add a reason to `masquerade_as_nightly_cargo` so it is searchable (rust-lang/cargo#10868)
- Allow '.' in workspace.default-members in non-virtual workspaces. (rust-lang/cargo#10784)
- remove`.masquerade_as_nightly_cargo()` from various tests the no longer need it (rust-lang/cargo#10867)
- remove `.masquerade_as_nightly_cargo()` from build_script_extra_link_arg.rs (rust-lang/cargo#10866)
@ehuss ehuss added this to the 1.64.0 milestone Jul 20, 2022
@Muscraft Muscraft deleted the add-reason-for-nightly-tests branch August 17, 2022 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants