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 # min-llvm-version: 11.0 to force a minimum LLVM version #81688

Merged

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Feb 3, 2021

Use # min-llvm-version: 11.0 to force a minimum LLVM version, rather than ad-hoc internal solution.

In particular: the specific code to define LLVM_VERSION_11_PLUS here was, for some reason, using $(shell ...) with bash-specific variable replacement code. On non-bash platforms like dash, that shell invocation would fail, and the
LLVM_VERSION_11_PLUS check would always fail, the test would always be ignored, and thus be treated as a "success" (in the sense that --bless would never do anything).

  • Note in particular that GNU Make treats the SHELL variable as a very special case: it does not inherit the value of SHELL from the user's environment. Except on Windows. See more explanation in the GNU Make docs.
  • The effect of this is that these tests end up using /bin/sh (except on Windows) for their $(shell ...) invocations, and thus we see differing behaviors depending on whether your /bin/sh links to /bin/dash or to /bin/bash.

This was causing me a lot of pain.

…r than ad-hoc internal solution.

In particular: the specific code to define LLVM_VERSION_11_PLUS here was, for
some reason, using `$(shell ...)` with bash-specific variable replacement code.
On non-bash platforms like dash, that `shell` invocation would fail, and the
LLVM_VERSION_11_PLUS check would always fail, the test would always be ignored,
and thus be treated as a "success" (in the sense that `--bless` would never do
anything).

This was causing me a lot of pain.
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(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 Feb 3, 2021
@pnkfelix pnkfelix added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 3, 2021
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

r=me

@@ -14,10 +14,3 @@
# Therefore, `-C link-dead-code` is no longer automatically enabled.

UNAME = $(shell uname)

# Rust option `-Z instrument-coverage` uses LLVM Coverage Mapping Format version 4,
Copy link
Member

Choose a reason for hiding this comment

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

Presumably this file is not adding much value anymore and we should move the uname to tools.mk?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah but lets maybe leave that for a later PR. Or at least, this may need to be backported when I add the other beta backports that depend on it (maybe)?

Copy link
Member Author

@pnkfelix pnkfelix Feb 3, 2021

Choose a reason for hiding this comment

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

Hmm on second thought I guess the backport of this PR isn't actually necessary since all it will mean is that the tests on beta will continue to be incorrectly ignored

pnkfelix added a commit to pnkfelix/rust that referenced this pull request Feb 3, 2021
@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 3, 2021

@bors r+

(I was tempted to up the priority on this, since it is blocking other work I am doing, but I can just cherry-pick it on those PR's and run --bless with the cherry-pick, so I'll let it go into the queue normally)

@bors
Copy link
Contributor

bors commented Feb 3, 2021

📌 Commit 03c000e 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 3, 2021
@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 3, 2021

@bors r=simulacrum

@bors
Copy link
Contributor

bors commented Feb 3, 2021

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Feb 3, 2021

📌 Commit 03c000e has been approved by simulacrum

@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 3, 2021

(Namely, I needed this change to be able to bless output for PR #81257 and PR #81294 on my machine that is using /bin/dash instead of /bin/bash as its /bin/sh implementation.)

m-ou-se added a commit to m-ou-se/rust that referenced this pull request Feb 3, 2021
…run-make-tests, r=simulacrum

Use `# min-llvm-version: 11.0` to force a minimum LLVM version

Use `# min-llvm-version: 11.0` to force a minimum LLVM version, rather than ad-hoc internal solution.

In particular: the specific code to define LLVM_VERSION_11_PLUS here was, for some reason, using `$(shell ...)` with bash-specific variable replacement code. On non-bash platforms like dash, that `shell` invocation would fail, and the
LLVM_VERSION_11_PLUS check would always fail, the test would always be ignored, and thus be treated as a "success" (in the sense that `--bless` would never do anything).

This was causing me a lot of pain.
@m-ou-se
Copy link
Member

m-ou-se commented Feb 3, 2021

@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 3, 2021
@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 3, 2021

Right: The problem here is that this has always been broken on CI, and my change here is fixing things so that we now actually observe the brokenness.

One quick fix could be to try to explicitly set the SHELL to /bin/bash in the coverage-reports Makefile.

But personally I would prefer to just outright disable the coverage-reports test in this PR, and leave fixing it's Makefile and re-enabling the test to a follow-up PR.

@Mark-Simulacrum
Copy link
Member

I think that's the right step; it's an unstable feature and we should not go out of our way to get its tests working.

cc @tmandry @richkadel

(Test was silently ignored on Linux CI prior to parent commit that switched to
using `# min-llvm-version`. But the switch made the ignoring stop, exposing
other brokenness in the form of bash-dependent syntax in the `$(shell ...)`
invocations.)
@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 3, 2021

@bors r=simulacrum rollup=never

@bors
Copy link
Contributor

bors commented Feb 3, 2021

📌 Commit 5ce6710 has been approved by simulacrum

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

bors commented Feb 3, 2021

⌛ Testing commit 5ce6710 with merge 89164fe516d4c71fb849a3559e61f1bdbb249a23...

@bors
Copy link
Contributor

bors commented Feb 4, 2021

💔 Test failed - checks-actions

@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)

@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 4, 2021
@wesleywiser
Copy link
Member

wesleywiser commented Feb 4, 2021

It looks to me like this might just need a retry? aarch64-gnu failed in the "run the build" step but I can't get any of the output, even though I can for previous steps.

@bors retry

@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 4, 2021
@m-ou-se
Copy link
Member

m-ou-se commented Feb 4, 2021

Yeah, the aarch64-gnu runner was having some problems a bit earlier. It seems to be working properly again now.

@bors
Copy link
Contributor

bors commented Feb 5, 2021

⌛ Testing commit 5ce6710 with merge 9e5d58f...

@bors
Copy link
Contributor

bors commented Feb 5, 2021

☀️ Test successful - checks-actions
Approved by: simulacrum
Pushing 9e5d58f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 5, 2021
@bors bors merged commit 9e5d58f into rust-lang:master Feb 5, 2021
@rustbot rustbot added this to the 1.51.0 milestone Feb 5, 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``
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 12, 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`
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 16, 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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants