From ad75ebb6b6273af8d024c4d90ad0a099272eac8f Mon Sep 17 00:00:00 2001 From: clubby789 Date: Thu, 22 Feb 2024 16:25:08 +0000 Subject: [PATCH 1/3] Bump `memchr` to 2.6 --- .github/workflows/ci.yml | 9 ++++++--- Cargo.lock | 4 ++-- compiler/rustc_ast/Cargo.toml | 2 +- src/ci/github-actions/ci.yml | 17 +++++++++++------ 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b0a33841ad99..db4e54fefd72d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -607,10 +607,13 @@ jobs: strategy: matrix: include: - - name: dist-x86_64-linux + - name: x86_64-mingw env: - CODEGEN_BACKENDS: "llvm,cranelift" - os: ubuntu-20.04-16core-64gb + SCRIPT: make ci-mingw + RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler" + NO_DOWNLOAD_CI_LLVM: 1 + CUSTOM_MINGW: 1 + os: windows-2019-8core-32gb defaults: run: shell: "${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}" diff --git a/Cargo.lock b/Cargo.lock index 4e00c9034bd9b..c1f179a783bc6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2372,9 +2372,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "76fc44e2588d5b436dbc3c6cf62aef290f90dab6235744a93dfe1cc18f451e2c" dependencies = [ "compiler_builtins", "rustc-std-workspace-core", diff --git a/compiler/rustc_ast/Cargo.toml b/compiler/rustc_ast/Cargo.toml index 087f6a192b5c8..31502018325bd 100644 --- a/compiler/rustc_ast/Cargo.toml +++ b/compiler/rustc_ast/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" # FIXME: bumping memchr to 2.7.1 causes linker errors in MSVC thin-lto # tidy-alphabetical-start bitflags = "2.4.1" -memchr = "=2.5.0" +memchr = "=2.6.0" rustc_data_structures = { path = "../rustc_data_structures" } rustc_index = { path = "../rustc_index" } rustc_lexer = { path = "../rustc_lexer" } diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 58d5dec9ba520..d7b61e5e629c0 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -755,13 +755,18 @@ jobs: strategy: matrix: include: - - &dist-x86_64-linux - name: dist-x86_64-linux + - &x86_64-mingw + name: x86_64-mingw env: - CODEGEN_BACKENDS: llvm,cranelift - <<: *job-linux-16c - - + SCRIPT: make ci-mingw + RUST_CONFIGURE_ARGS: >- + --build=x86_64-pc-windows-gnu + --enable-profiler + # We are intentionally allowing an old toolchain on this builder (and that's + # incompatible with LLVM downloads today). + NO_DOWNLOAD_CI_LLVM: 1 + CUSTOM_MINGW: 1 + <<: *job-windows-8c master: name: master runs-on: ubuntu-latest From c4b7bdb4d5b69dee259267ed1f51c31cd90476b9 Mon Sep 17 00:00:00 2001 From: Philipp Krones Date: Tue, 27 Feb 2024 10:32:31 +0100 Subject: [PATCH 2/3] Use non-inline on windows memchr version --- Cargo.lock | 35 ++++++++++++++++++++--------------- compiler/rustc_ast/Cargo.toml | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c1f179a783bc6..ad05fe403a9d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -53,7 +53,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ - "memchr", + "memchr 2.6.0", ] [[package]] @@ -338,7 +338,7 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ - "memchr", + "memchr 2.6.0", "regex-automata 0.3.7", "serde", ] @@ -1514,7 +1514,7 @@ dependencies = [ "futures-macro", "futures-sink", "futures-task", - "memchr", + "memchr 2.6.0", "pin-project-lite", "pin-utils", "slab", @@ -1944,7 +1944,7 @@ dependencies = [ "globset", "lazy_static", "log", - "memchr", + "memchr 2.6.0", "regex", "same-file", "thread_local", @@ -2343,7 +2343,7 @@ dependencies = [ "env_logger", "handlebars", "log", - "memchr", + "memchr 2.6.0", "once_cell", "opener", "pulldown-cmark 0.10.0", @@ -2380,6 +2380,11 @@ dependencies = [ "rustc-std-workspace-core", ] +[[package]] +name = "memchr" +version = "2.7.1" +source = "git+https://github.com/flip1995/memchr.git#0310038cc28478514d7dc83d7fbdb8c68bb0ffb0" + [[package]] name = "memmap2" version = "0.2.3" @@ -2524,7 +2529,7 @@ version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "memchr", + "memchr 2.6.0", "minimal-lexical", ] @@ -2599,7 +2604,7 @@ dependencies = [ "flate2", "hashbrown", "indexmap", - "memchr", + "memchr 2.6.0", "rustc-std-workspace-alloc", "rustc-std-workspace-core", "ruzstd", @@ -2823,7 +2828,7 @@ version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" dependencies = [ - "memchr", + "memchr 2.6.0", "thiserror", "ucd-trie", ] @@ -3011,7 +3016,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ "bitflags 2.4.2", - "memchr", + "memchr 2.6.0", "unicase", ] @@ -3022,7 +3027,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dce76ce678ffc8e5675b22aa1405de0b7037e2fdf8913fea40d1926c6fe1e6e7" dependencies = [ "bitflags 2.4.2", - "memchr", + "memchr 2.6.0", "pulldown-cmark-escape", "unicase", ] @@ -3170,7 +3175,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" dependencies = [ "aho-corasick", - "memchr", + "memchr 2.6.0", "regex-automata 0.3.7", "regex-syntax 0.7.5", ] @@ -3190,7 +3195,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9368763f5a9b804326f3af749e16f9abf378d227bcdee7634b13d8f17793782" dependencies = [ - "memchr", + "memchr 2.6.0", ] [[package]] @@ -3200,7 +3205,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" dependencies = [ "aho-corasick", - "memchr", + "memchr 2.6.0", "regex-syntax 0.7.5", ] @@ -3431,7 +3436,7 @@ name = "rustc_ast" version = "0.0.0" dependencies = [ "bitflags 2.4.2", - "memchr", + "memchr 2.7.1", "rustc_data_structures", "rustc_index", "rustc_lexer", @@ -6332,7 +6337,7 @@ version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ - "memchr", + "memchr 2.6.0", ] [[package]] diff --git a/compiler/rustc_ast/Cargo.toml b/compiler/rustc_ast/Cargo.toml index 31502018325bd..6763d1d16d4d3 100644 --- a/compiler/rustc_ast/Cargo.toml +++ b/compiler/rustc_ast/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" # FIXME: bumping memchr to 2.7.1 causes linker errors in MSVC thin-lto # tidy-alphabetical-start bitflags = "2.4.1" -memchr = "=2.6.0" +memchr = { git = "https://github.com/flip1995/memchr.git" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_index = { path = "../rustc_index" } rustc_lexer = { path = "../rustc_lexer" } From 182164a401bfb36bdb9076bb0d1de64301ca7bf1 Mon Sep 17 00:00:00 2001 From: Philipp Krones Date: Tue, 27 Feb 2024 11:16:56 +0100 Subject: [PATCH 3/3] Make github/flip1995/memchr an allowed src --- src/tools/tidy/src/extdeps.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/tidy/src/extdeps.rs b/src/tools/tidy/src/extdeps.rs index ff71ca537256f..87ba3ff927db3 100644 --- a/src/tools/tidy/src/extdeps.rs +++ b/src/tools/tidy/src/extdeps.rs @@ -4,7 +4,10 @@ use std::fs; use std::path::Path; /// List of allowed sources for packages. -const ALLOWED_SOURCES: &[&str] = &["\"registry+https://github.com/rust-lang/crates.io-index\""]; +const ALLOWED_SOURCES: &[&str] = &[ + "\"registry+https://github.com/rust-lang/crates.io-index\"", + "\"git+https://github.com/flip1995/memchr.git#0310038cc28478514d7dc83d7fbdb8c68bb0ffb0\"", +]; /// Checks for external package sources. `root` is the path to the directory that contains the /// workspace `Cargo.toml`.