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

Ensures make tests run under /bin/dash (if available), like CI, and fixes a Makefile #81734

Merged
merged 4 commits into from
Feb 16, 2021

Conversation

richkadel
Copy link
Contributor

Note: This cherrypicks #81688 (@pnkfelix)

Updates tools.mk to explicitly require SHELL := /bin/dash, since CI uses dash but other environments (including developer local machines) may default to bash.

Replaces bash-specific shell command in one Makefile with a dash-compatible alternative, and re-enables the affected Makefile test.

Removes apparently redundant definition of UNAME.

Also see: zulip discussion thread

r? @pnkfelix

FYI: @wesleywiser @tmandry

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 4, 2021
@Mark-Simulacrum
Copy link
Member

This seems like it would break on Windows? Maybe it's somehow magically accessible though.

@richkadel
Copy link
Contributor Author

My Windows VM is powered down, so I asked in the zulip thread if anyone else could confirm if /bin/dash is there.

But in the mean time, I'm bringing Windows back up, so I will check.

@richkadel
Copy link
Contributor Author

@Mark-Simulacrum - I can provide some confidence this will work on Windows in a Rust-configured development environment:

I have a pretty vanilla setup of Windows, set up specifically to test rustc and llvm, using the recommended steps on the rust-lang/rust README.md, and my msys2 setup has /bin/dash. I didn't install it specifically.

@bors
Copy link
Contributor

bors commented Feb 5, 2021

☔ The latest upstream changes (presumably #81688) made this pull request unmergeable. Please resolve the merge conflicts.

@richkadel richkadel changed the title Ensures make tests run under /bin/dash, like CI, and fixes a Makefile Ensures make tests run under /bin/dash (if available), like CI, and fixes a Makefile Feb 6, 2021
@richkadel
Copy link
Contributor Author

@pnkfelix - I checked this locally and it works as intended. If /bin/dash is not present, it does not change SHELL at all. If /bin/dash is present, it sets SHELL := /bin/dash, and scripts that are bash compliant but not dash compliant predictably fail.

@pnkfelix
Copy link
Member

Lets give this a whirl

@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 10, 2021

📌 Commit ca3a714 has been approved by pnkfelix

@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 Feb 10, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Feb 11, 2021
Ensures `make` tests run under /bin/dash (if available), like CI, and fixes a Makefile

Note: This cherrypicks rust-lang#81688 (`@pnkfelix)`

Updates `tools.mk` to explicitly require `SHELL := /bin/dash`, since CI uses `dash` but other environments (including developer local machines) may default to `bash`.

Replaces bash-specific shell command in one Makefile with a dash-compatible alternative, and re-enables the affected Makefile test.

Removes apparently redundant definition of `UNAME`.

Also see: [zulip discussion thread](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/how.20to.20run.2Fbless.20src.2Ftest.2Frun-make-fulldeps.2Fcoverage.20.3F)

r? `@pnkfelix`

FYI: `@wesleywiser` `@tmandry`
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Feb 11, 2021
Ensures `make` tests run under /bin/dash (if available), like CI, and fixes a Makefile

Note: This cherrypicks rust-lang#81688 (``@pnkfelix)``

Updates `tools.mk` to explicitly require `SHELL := /bin/dash`, since CI uses `dash` but other environments (including developer local machines) may default to `bash`.

Replaces bash-specific shell command in one Makefile with a dash-compatible alternative, and re-enables the affected Makefile test.

Removes apparently redundant definition of `UNAME`.

Also see: [zulip discussion thread](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/how.20to.20run.2Fbless.20src.2Ftest.2Frun-make-fulldeps.2Fcoverage.20.3F)

r? ``@pnkfelix``

FYI: ``@wesleywiser`` ``@tmandry``
@JohnTitor
Copy link
Member

Failed in rollup: #81983 (comment)
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 11, 2021
@richkadel
Copy link
Contributor Author

It looks like, since the coverage tests were recently disabled, some other change came in that SHOULD have forced re-blessing the coverage results, but since the test didn't run, it didn't fail, and coverage results were not updated.

I'll rebase and hopefully get that change, re-bless the output, and if the problem is resolved, hopefully we can get this merged quickly, to avoid this happening again.

Interestingly, whatever change it was seems to (at least partially) clean up a coverage discrepancy, mentioned at the bottom of the test program, with FIXME issue #79626. (I'm still not sure why there are two code regions for derived traits, but at least they are no longer inconsistent.)

But (whether from the same change or an unrelated change), coverage stats no longer appear on the struct fields. I didn't actually expect coverage stats for fields until we created this test, and now I'm not sure if it's appropriate to lose this coverage, or not. But I do think it's acceptable.

I'll need to change the comments in the test source to reflect these new results (assuming I can reproduce them):

--- expected_show_coverage.partial_eq.txt	2021-02-11 03:54:17.271247325 +0000
+++ /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/coverage-reports/coverage-reports/actual_show_coverage.partial_eq.txt	2021-02-11 04:39:04.423096295 +0000
@@ -2,11 +2,11 @@
     2|       |// structure of this test.
     3|       |
     4|      2|#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
-                       ^0            ^0      ^0 ^0  ^1       ^0 ^0^0
+                       ^0            ^0      ^0 ^0  ^1       ^1 ^0^0
     5|       |pub struct Version {
     6|       |    major: usize,
-    7|      1|    minor: usize, // Count: 1 - `PartialOrd` compared `minor` values in 3.2.1 vs. 3.3.0
-    8|      0|    patch: usize, // Count: 0 - `PartialOrd` was determined by `minor` (2 < 3)
+    7|       |    minor: usize, // Count: 1 - `PartialOrd` compared `minor` values in 3.2.1 vs. 3.3.0
+    8|       |    patch: usize, // Count: 0 - `PartialOrd` was determined by `minor` (2 < 3)
     9|       |}
    10|       |
    11|       |impl Version {

Updates `tools.mk` to explicitly require `SHELL := /bin/dash`, since CI
uses `dash` but other environments (including developer local machines)
may default to `bash`.

Replaces bash-specific shell command in one Makefile with a
dash-compatible alternative, and re-enables the affected Makefile test.

Removes apparently redundant definition of `UNAME`.
@richkadel
Copy link
Contributor Author

@pnkfelix I re-blessed the tests. I'm not sure what PR introduced the change that resulted in different (and fortunately, better) coverage counts for derived traits, but it was very recent, because my original commits were tested on the latest baseline at that time, and worked then, but don't work now, without today's update.

This is ready to re-submit to the bors queue.

Thanks!
Rich

@richkadel
Copy link
Contributor Author

r? @pnkfelix

@bors
Copy link
Contributor

bors commented Feb 13, 2021

📌 Commit cbe6c70 has been approved by pnkfelix

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 13, 2021
@bors
Copy link
Contributor

bors commented Feb 13, 2021

⌛ Testing commit cbe6c70 with merge 86d04a71a593d732fab156d5eb95e83664f16e0c...

@bors
Copy link
Contributor

bors commented Feb 14, 2021

💥 Test timed out

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

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@richkadel
Copy link
Contributor Author

Spurious?

test src/unit.rs - unit::() (line 8) ... ok
test src/num/mod.rs - num::i128::to_be_bytes (line 125) ... test src/num/mod.rs - num::i128::to_be_bytes (line 125) has been running for over 60 seconds
test src/num/mod.rs - num::i128::wrapping_rem_euclid (line 132) ... test src/num/mod.rs - num::i128::wrapping_rem_euclid (line 132) has been running for over 60 seconds
Error: The operation was canceled.

@richkadel
Copy link
Contributor Author

Note all CI platforms succeeded but one, which timed out

@Mark-Simulacrum
Copy link
Member

@bors retry - spurious timeout

@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 Feb 14, 2021
@bors
Copy link
Contributor

bors commented Feb 15, 2021

⌛ Testing commit cbe6c70 with merge 916508b3169603a8f0ced72d63fbf9a4288a91e3...

@bors
Copy link
Contributor

bors commented Feb 15, 2021

💥 Test timed out

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

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@richkadel
Copy link
Contributor Author

auto (i686-gnu-nopt, ubuntu-latest-xl):

test [ui] ui/zero-sized/zero-sized-binary-heap-push.rs ... ok
test [ui] ui/zero-sized/zero-sized-linkedlist-push.rs ... ok
test [ui] ui/zero-sized/zero-sized-btreemap-insert.rs ... ok
test [ui] ui/wrong-hashset-issue-42918.rs ... ok

== clock drift check ==
  local time: Mon Feb 15 07:27:19 UTC 2021
Session terminated, terminating shell.../checkout/src/ci/run.sh: line 117:  1864 Terminated              sh -x -c "$SCRIPT"
  network time: Sun, 14 Feb 2021 18:48:58 GMT
== end clock drift check ==
 ...terminated.
Error: The operation was canceled.

Another spurious timeout?

Same builder as last time?

Every other builder completes successfully.

@richkadel
Copy link
Contributor Author

Yes same builder in both cases

@pnkfelix
Copy link
Member

@bors retry - spurious timeout

@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 Feb 15, 2021
@bors
Copy link
Contributor

bors commented Feb 16, 2021

⌛ Testing commit cbe6c70 with merge 090dac0...

@bors
Copy link
Contributor

bors commented Feb 16, 2021

☀️ Test successful - checks-actions
Approved by: pnkfelix
Pushing 090dac0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 16, 2021
@bors bors merged commit 090dac0 into rust-lang:master Feb 16, 2021
@rustbot rustbot added this to the 1.52.0 milestone Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

10 participants