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

Rollup of 6 pull requests #124337

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/tracking_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

### Steps
<!--
Expand Down
31 changes: 2 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,96 +88,70 @@ jobs:
run: "echo \"[CI_PR_NUMBER=$num]\""
env:
num: "${{ github.event.number }}"
if: "success() && !env.SKIP_JOB && github.event_name == 'pull_request'"
if: "success() && github.event_name == 'pull_request'"
- name: add extra environment variables
run: src/ci/scripts/setup-environment.sh
env:
EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
if: success() && !env.SKIP_JOB
- name: decide whether to skip this job
run: src/ci/scripts/should-skip-this.sh
if: success() && !env.SKIP_JOB
- name: ensure the channel matches the target branch
run: src/ci/scripts/verify-channel.sh
if: success() && !env.SKIP_JOB
- name: collect CPU statistics
run: src/ci/scripts/collect-cpu-stats.sh
if: success() && !env.SKIP_JOB
- name: show the current environment
run: src/ci/scripts/dump-environment.sh
if: success() && !env.SKIP_JOB
- name: install awscli
run: src/ci/scripts/install-awscli.sh
if: success() && !env.SKIP_JOB
- name: install sccache
run: src/ci/scripts/install-sccache.sh
if: success() && !env.SKIP_JOB
- name: select Xcode
run: src/ci/scripts/select-xcode.sh
if: success() && !env.SKIP_JOB
- name: install clang
run: src/ci/scripts/install-clang.sh
if: success() && !env.SKIP_JOB
- name: install tidy
run: src/ci/scripts/install-tidy.sh
if: success() && !env.SKIP_JOB
- name: install WIX
run: src/ci/scripts/install-wix.sh
if: success() && !env.SKIP_JOB
- name: disable git crlf conversion
run: src/ci/scripts/disable-git-crlf-conversion.sh
if: success() && !env.SKIP_JOB
- name: checkout submodules
run: src/ci/scripts/checkout-submodules.sh
if: success() && !env.SKIP_JOB
- name: install MSYS2
run: src/ci/scripts/install-msys2.sh
if: success() && !env.SKIP_JOB
- name: install MinGW
run: src/ci/scripts/install-mingw.sh
if: success() && !env.SKIP_JOB
- name: install ninja
run: src/ci/scripts/install-ninja.sh
if: success() && !env.SKIP_JOB
- name: enable ipv6 on Docker
run: src/ci/scripts/enable-docker-ipv6.sh
if: success() && !env.SKIP_JOB
- name: disable git crlf conversion
run: src/ci/scripts/disable-git-crlf-conversion.sh
if: success() && !env.SKIP_JOB
- name: ensure line endings are correct
run: src/ci/scripts/verify-line-endings.sh
if: success() && !env.SKIP_JOB
- name: ensure backported commits are in upstream branches
run: src/ci/scripts/verify-backported-commits.sh
if: success() && !env.SKIP_JOB
- name: ensure the stable version number is correct
run: src/ci/scripts/verify-stable-version-number.sh
if: success() && !env.SKIP_JOB
- name: run the build
run: src/ci/scripts/run-build-from-ci.sh 2>&1
env:
AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
if: success() && !env.SKIP_JOB
- name: create github artifacts
run: src/ci/scripts/create-doc-artifacts.sh
if: success() && !env.SKIP_JOB
- name: upload artifacts to github
uses: actions/upload-artifact@v4
with:
name: "${{ env.DOC_ARTIFACT_NAME }}"
path: obj/artifacts/doc
if-no-files-found: ignore
retention-days: 5
if: success() && !env.SKIP_JOB
- name: upload artifacts to S3
run: src/ci/scripts/upload-artifacts.sh
env:
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
if: "success() && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
master:
name: master
runs-on: ubuntu-latest
Expand All @@ -202,7 +176,6 @@ jobs:
shell: bash
env:
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
if: success() && !env.SKIP_JOB
try-success:
needs:
- job
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_fs_util/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(absolute_path)]

use std::ffi::CString;
use std::fs;
use std::io;
Expand Down
9 changes: 6 additions & 3 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1888,9 +1888,12 @@ fn collect_print_requests(
let prints =
PRINT_KINDS.iter().map(|(name, _)| format!("`{name}`")).collect::<Vec<_>>();
let prints = prints.join(", ");
early_dcx.early_fatal(format!(
"unknown print request `{req}`. Valid print requests are: {prints}"
));

let mut diag =
early_dcx.early_struct_fatal(format!("unknown print request: `{req}`"));
#[allow(rustc::diagnostic_outside_of_impl)]
diag.help(format!("valid print requests are: {prints}"));
diag.emit()
}
};

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_span/src/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ struct HygieneDecodeContextInner {
// global `HygieneData`. When we deserialize a `SyntaxContext`, we need to create
// a new id in the global `HygieneData`. This map tracks the ID we end up picking,
// so that multiple occurrences of the same serialized id are decoded to the same
// `SyntaxContext`. This only stores `SyntaxContext`s which are completly decoded.
// `SyntaxContext`. This only stores `SyntaxContext`s which are completely decoded.
remapped_ctxts: Vec<Option<SyntaxContext>>,

/// Maps serialized `SyntaxContext` ids that are currently being decoded to a `SyntaxContext`.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_type_ir/src/ty_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pub enum TyKind<I: Interner> {
/// A placeholder type, used during higher ranked subtyping to instantiate
/// bound variables.
///
/// It is conventional to render anonymous placeholer types like `!N` or `!U_N`,
/// It is conventional to render anonymous placeholder types like `!N` or `!U_N`,
/// where `N` is the placeholder variable's anonymous index (which corresponds
/// to the bound variable's index from the binder from which it was instantiated),
/// and `U` is the universe index in which it is instantiated, or totally omitted
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/fmt/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl<'a> Argument<'a> {
///
/// # Safety
///
/// This argument must actually be a placeholer argument.
/// This argument must actually be a placeholder argument.
///
// FIXME: Transmuting formatter in new and indirectly branching to/calling
// it here is an explicit CFI violation.
Expand Down
4 changes: 1 addition & 3 deletions library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3332,7 +3332,6 @@ impl Error for StripPrefixError {
/// ## Posix paths
///
/// ```
/// #![feature(absolute_path)]
/// # #[cfg(unix)]
/// fn main() -> std::io::Result<()> {
/// use std::path::{self, Path};
Expand All @@ -3357,7 +3356,6 @@ impl Error for StripPrefixError {
/// ## Windows paths
///
/// ```
/// #![feature(absolute_path)]
/// # #[cfg(windows)]
/// fn main() -> std::io::Result<()> {
/// use std::path::{self, Path};
Expand All @@ -3382,7 +3380,7 @@ impl Error for StripPrefixError {
///
/// [posix-semantics]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13
/// [windows-path]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfullpathnamew
#[unstable(feature = "absolute_path", issue = "92750")]
#[stable(feature = "absolute_path", since = "CURRENT_RUSTC_VERSION")]
pub fn absolute<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
let path = path.as_ref();
if path.as_os_str().is_empty() {
Expand Down
20 changes: 17 additions & 3 deletions src/ci/github-actions/calculate-job-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@

import yaml

CI_DIR = Path(__file__).absolute().parent.parent
JOBS_YAML_PATH = Path(__file__).absolute().parent / "jobs.yml"

Job = Dict[str, Any]

def name_jobs(jobs: List[Dict], prefix: str) -> List[Dict]:

def name_jobs(jobs: List[Dict], prefix: str) -> List[Job]:
"""
Add a `name` attribute to each job, based on its image and the given `prefix`.
"""
Expand All @@ -29,7 +32,7 @@ def name_jobs(jobs: List[Dict], prefix: str) -> List[Dict]:
return jobs


def add_base_env(jobs: List[Dict], environment: Dict[str, str]) -> List[Dict]:
def add_base_env(jobs: List[Job], environment: Dict[str, str]) -> List[Job]:
"""
Prepends `environment` to the `env` attribute of each job.
The `env` of each job has higher precedence than `environment`.
Expand Down Expand Up @@ -77,7 +80,7 @@ def find_job_type(ctx: GitHubCtx) -> Optional[JobType]:
return None


def calculate_jobs(job_type: JobType, job_data: Dict[str, Any]) -> List[Dict[str, Any]]:
def calculate_jobs(job_type: JobType, job_data: Dict[str, Any]) -> List[Job]:
if job_type == JobType.PR:
return add_base_env(name_jobs(job_data["pr"], "PR"), job_data["envs"]["pr"])
elif job_type == JobType.Try:
Expand All @@ -88,6 +91,13 @@ def calculate_jobs(job_type: JobType, job_data: Dict[str, Any]) -> List[Dict[str
return []


def skip_jobs(jobs: List[Dict[str, Any]], channel: str) -> List[Job]:
"""
Skip CI jobs that are not supposed to be executed on the given `channel`.
"""
return [j for j in jobs if j.get("only_on_channel", channel) == channel]


def get_github_ctx() -> GitHubCtx:
return GitHubCtx(
event_name=os.environ["GITHUB_EVENT_NAME"],
Expand All @@ -107,9 +117,13 @@ def get_github_ctx() -> GitHubCtx:
job_type = find_job_type(github_ctx)
logging.info(f"Job type: {job_type}")

with open(CI_DIR / "channel") as f:
channel = f.read().strip()

jobs = []
if job_type is not None:
jobs = calculate_jobs(job_type, data)
jobs = skip_jobs(jobs, channel)

logging.info(f"Output:\n{yaml.dump(jobs, indent=4)}")
print(f"jobs={json.dumps(jobs)}")
36 changes: 2 additions & 34 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ x--expand-yaml-anchors--remove:
- &job-aarch64-linux
os: [self-hosted, ARM64, linux]

- &step
if: success() && !env.SKIP_JOB

- &base-ci-job
defaults:
run:
Expand Down Expand Up @@ -151,7 +148,7 @@ x--expand-yaml-anchors--remove:
run: echo "[CI_PR_NUMBER=$num]"
env:
num: ${{ github.event.number }}
if: success() && !env.SKIP_JOB && github.event_name == 'pull_request'
if: success() && github.event_name == 'pull_request'

- name: add extra environment variables
run: src/ci/scripts/setup-environment.sh
Expand All @@ -161,71 +158,51 @@ x--expand-yaml-anchors--remove:
# are passed to the `setup-environment.sh` script encoded in JSON,
# which then uses log commands to actually set them.
EXTRA_VARIABLES: ${{ toJson(matrix.env) }}
<<: *step

- name: decide whether to skip this job
run: src/ci/scripts/should-skip-this.sh
<<: *step

- name: ensure the channel matches the target branch
run: src/ci/scripts/verify-channel.sh
<<: *step

- name: collect CPU statistics
run: src/ci/scripts/collect-cpu-stats.sh
<<: *step

- name: show the current environment
run: src/ci/scripts/dump-environment.sh
<<: *step

- name: install awscli
run: src/ci/scripts/install-awscli.sh
<<: *step

- name: install sccache
run: src/ci/scripts/install-sccache.sh
<<: *step

- name: select Xcode
run: src/ci/scripts/select-xcode.sh
<<: *step

- name: install clang
run: src/ci/scripts/install-clang.sh
<<: *step

- name: install tidy
run: src/ci/scripts/install-tidy.sh
<<: *step

- name: install WIX
run: src/ci/scripts/install-wix.sh
<<: *step

- name: disable git crlf conversion
run: src/ci/scripts/disable-git-crlf-conversion.sh
<<: *step

- name: checkout submodules
run: src/ci/scripts/checkout-submodules.sh
<<: *step

- name: install MSYS2
run: src/ci/scripts/install-msys2.sh
<<: *step

- name: install MinGW
run: src/ci/scripts/install-mingw.sh
<<: *step

- name: install ninja
run: src/ci/scripts/install-ninja.sh
<<: *step

- name: enable ipv6 on Docker
run: src/ci/scripts/enable-docker-ipv6.sh
<<: *step

# Disable automatic line ending conversion (again). On Windows, when we're
# installing dependencies, something switches the git configuration directory or
Expand All @@ -234,19 +211,15 @@ x--expand-yaml-anchors--remove:
# appropriate line endings.
- name: disable git crlf conversion
run: src/ci/scripts/disable-git-crlf-conversion.sh
<<: *step

- name: ensure line endings are correct
run: src/ci/scripts/verify-line-endings.sh
<<: *step

- name: ensure backported commits are in upstream branches
run: src/ci/scripts/verify-backported-commits.sh
<<: *step

- name: ensure the stable version number is correct
run: src/ci/scripts/verify-stable-version-number.sh
<<: *step

- name: run the build
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
Expand All @@ -255,11 +228,9 @@ x--expand-yaml-anchors--remove:
AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
<<: *step

- name: create github artifacts
run: src/ci/scripts/create-doc-artifacts.sh
<<: *step

- name: upload artifacts to github
uses: actions/upload-artifact@v4
Expand All @@ -269,7 +240,6 @@ x--expand-yaml-anchors--remove:
path: obj/artifacts/doc
if-no-files-found: ignore
retention-days: 5
<<: *step

- name: upload artifacts to S3
run: src/ci/scripts/upload-artifacts.sh
Expand All @@ -281,8 +251,7 @@ x--expand-yaml-anchors--remove:
# adding the condition is helpful as this way CI will not silently skip
# deploying artifacts from a dist builder if the variables are misconfigured,
# erroring about invalid credentials instead.
if: success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')
<<: *step
if: success() && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')

# These snippets are used by the try-success, try-failure, auto-success and auto-failure jobs.
# Check out their documentation for more information on why they're needed.
Expand Down Expand Up @@ -399,7 +368,6 @@ jobs:
shell: bash
env:
TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
<<: *step

# These jobs don't actually test anything, but they're used to tell bors the
# build completed, as there is no practical way to detect when a workflow is
Expand Down
Loading
Loading