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

Check if tier 2 targets build in the nightly cron job #3260

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

saethlin
Copy link
Member

@saethlin saethlin commented Jan 7, 2024

This PR adds a CI job that only runs nightly which will install Miri built from the latest commit, and try to build every Tier 2 without host tools target, as documented on https://doc.rust-lang.org/nightly/rustc/platform-support.html.

I'm not really excited about the idea of scraping the tier 2 without host tools list, but also keeping the list up-to-date by hand seems prone to forgetting to update it. And that update seems like the sort of manual maintenance we should automate.

@@ -128,11 +128,53 @@ jobs:
- name: rustdoc
run: RUSTDOCFLAGS="-Dwarnings" ./miri cargo doc --document-private-items

sysroots:
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to use a separate workflow (in a separate yml file) for this? It doesn't seem to share anything with the main workflow except the time of the cronjob.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tested this PR in my fork and ironed out a few issues. Let me see if I can cut-and-paste without breaking this...

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see any evidence that GitHub has picked up the new workflow. But it seems to have been picked up in my own repo? saethlin#1

Copy link
Member

Choose a reason for hiding this comment

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

It may be the case that it only gets picked up once it exists in master.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's what I thought too, but in my fork the workflow doesn't exist on master.

Copy link
Member

Choose a reason for hiding this comment

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

I believe for your own repo it will apply every workflow found on a local branch, but for a PR it will only apply those found on the target branch.

Copy link
Member Author

Choose a reason for hiding this comment

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

If you click the link you'll see the sysroots job running in a PR, no?

Copy link
Member

Choose a reason for hiding this comment

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

You are the owner of that repo, so your PRs are not regular PRs.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did not know that. That is very annoying.

ci/build-all-targets.sh Outdated Show resolved Hide resolved
cargo-miri/Cargo.lock Outdated Show resolved Hide resolved
from bs4 import BeautifulSoup
import requests

url = "https://doc.rust-lang.org/nightly/rustc/platform-support.html"
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way we can get this from the installed rustc rather than an online source?

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like we can install the docs and scrape a local HTML file? Trying this, it's a bit fiddly to test locally because ./miri toolchain -c rust-docs doesn't add them to the toolchain, but if the miri toolchain doesn't exist yet it looks like the component is installed.

Copy link
Member

Choose a reason for hiding this comment

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

Ah... well if it's complicated we can also stick to the URL and hope we don't get spurious failures from that.

Copy link
Member

Choose a reason for hiding this comment

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

./miri toolchain -c rust-docs doesn't add them to the toolchain

So this worked after all?

Copy link
Member Author

Choose a reason for hiding this comment

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

The CI job works because there is no pre-existing miri toolchain when we run ./miri toolchain -c rust-docs. It's functional, but awkward to test manually.

Copy link
Member

Choose a reason for hiding this comment

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

Ah that's what you mean.

I am not sure if RTIM supports adding components to an already installed toolchain.

Copy link
Member

Choose a reason for hiding this comment

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

Apart from scraping platform-support.html you could also look in https://static.rust-lang.org/dist/channel-rust-nightly.toml to find all targets for which we ship libstd (all tier 1 and tier 2 targets) In case of a rustup installed toolchain it is available locally under $(rustc --print sysroot)/lib/rustlib/multirust-channel-manifest.toml. This doesn't distinguish between tier 1 and tier 2 though, but you could distinguish between with and without host tools by looking if rustc is available for the target or not.

Copy link
Member

Choose a reason for hiding this comment

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

Or we just test tier 1 as well, it should only take a few extra minutes.

That would probably be more reliable than scraping html, yeah. Not a blocker to landing the initial experiment though.

# The tables are:
# Tier 1
# Tier 2 with host tools
# Tier 2 without host tools <-- we want this one
Copy link
Member

Choose a reason for hiding this comment

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

Why only tier 2 without host tools, and not also tier 2 with host tools?

Copy link
Member Author

@saethlin saethlin Jan 7, 2024

Choose a reason for hiding this comment

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

🤔 At one point I was thinking that the "with host tools" part of the build would ensure that the sysroot builds, but I suppose since we don't test the host tools, the lazily-built sysroot might not build.

Copy link
Member

Choose a reason for hiding this comment

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

Also this doesn't imply that the sysroot builds in Miri.

ci/scrape-targets.py Outdated Show resolved Hide resolved
ci/scrape-targets.py Outdated Show resolved Hide resolved
@RalfJung
Copy link
Member

RalfJung commented Jan 7, 2024

LGTM, r=me after squashing.

@saethlin
Copy link
Member Author

saethlin commented Jan 7, 2024

@bors r=RalfJung

@bors
Copy link
Contributor

bors commented Jan 7, 2024

📌 Commit cb10a73 has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jan 7, 2024

⌛ Testing commit cb10a73 with merge fa672fa...

@bors
Copy link
Contributor

bors commented Jan 7, 2024

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing fa672fa to master...

@bors bors merged commit fa672fa into rust-lang:master Jan 7, 2024
8 checks passed
@bors bors mentioned this pull request Jan 7, 2024
@saethlin saethlin deleted the build-all-tier-2 branch January 8, 2024 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants