diff --git a/mozglue/static/rust/build.rs b/mozglue/static/rust/build.rs index 7e42b375e22c..62ee38e30684 100644 --- a/mozglue/static/rust/build.rs +++ b/mozglue/static/rust/build.rs @@ -16,7 +16,7 @@ fn main() { println!("cargo:rerun-if-changed=wrappers.cpp"); let ver = version().unwrap(); - let max_oom_hook_version = Version::parse("1.66.0-alpha").unwrap(); + let max_oom_hook_version = Version::parse("1.68.0-alpha").unwrap(); if ver < max_oom_hook_version { println!("cargo:rustc-cfg=feature=\"oom_with_hook\""); diff --git a/taskcluster/ci/searchfox/kind.yml b/taskcluster/ci/searchfox/kind.yml index 33a77eab9d80..2cf8e22ed64c 100644 --- a/taskcluster/ci/searchfox/kind.yml +++ b/taskcluster/ci/searchfox/kind.yml @@ -54,7 +54,7 @@ jobs: - linux64-clang - linux64-nasm - linux64-node - - linux64-rust + - linux64-rust-nightly - linux64-cbindgen - linux64-dump_syms - linux64-pkgconf @@ -94,7 +94,7 @@ jobs: - linux64-libdmg - linux64-nasm - linux64-node - - linux64-rust-macos + - linux64-rust-cross-nightly - linux64-cbindgen - linux64-dump_syms - macosx64-sdk @@ -135,7 +135,7 @@ jobs: toolchain: - linux64-binutils - linux64-clang - - linux64-rust-cross + - linux64-rust-cross-nightly - linux64-rust-size - linux64-nasm - linux64-node @@ -185,6 +185,9 @@ jobs: - android-sdk-linux - linux64-jdk - linux64-clang + # TODO: Change to rust-cross-nightly once + # https://github.com/rust-lang/rust/pull/104628 is merged + # (that'd provide better scip indexing). - linux64-rust-android - linux64-rust-size - linux64-cbindgen diff --git a/taskcluster/ci/toolchain/rust.yml b/taskcluster/ci/toolchain/rust.yml index ce8a3128f173..ae2aa84844b1 100644 --- a/taskcluster/ci/toolchain/rust.yml +++ b/taskcluster/ci/toolchain/rust.yml @@ -56,6 +56,23 @@ linux64-rust-1.65: toolchain: - linux64-clang-toolchain +linux64-rust-nightly: + treeherder: + symbol: TL(rust-nightly) + run: + arguments: [ + '--channel', 'nightly-2022-11-11', + '--host', 'x86_64-unknown-linux-gnu', + '--target', 'x86_64-unknown-linux-gnu', + '--target', 'i686-unknown-linux-gnu', + '--target', 'aarch64-unknown-linux-gnu', + '--target', 'wasm32-wasi', + '--compiler-builtins-hack', + ] + fetches: + toolchain: + - linux64-clang-toolchain + # A patched rust toolchain that allows us to use sanitizers in our vendored # build environment. See the rust fetch's comments for more details. linux64-rust-dev: @@ -78,7 +95,6 @@ linux64-rust-dev: - linux64-clang-toolchain - linux64-binutils - linux64-rust-cross-1.65: description: "rust repack with macos and windows cross support" treeherder: @@ -102,6 +118,28 @@ linux64-rust-cross-1.65: ] toolchain-alias: linux64-rust-cross +linux64-rust-cross-nightly: + description: "rust nightly repack with macos and windows cross support" + treeherder: + symbol: TL(rust-cross-nightly) + run: + arguments: [ + '--channel', 'nightly-2022-11-11', + '--host', 'x86_64-unknown-linux-gnu', + '--target', 'x86_64-unknown-linux-gnu', + '--target', 'i686-unknown-linux-gnu', + '--target', 'x86_64-apple-darwin', + '--target', 'aarch64-apple-darwin', + '--target', 'x86_64-pc-windows-msvc', + '--target', 'i686-pc-windows-msvc', + '--target', 'aarch64-pc-windows-msvc', + '--target', 'armv7-linux-androideabi', + '--target', 'thumbv7neon-linux-androideabi', + '--target', 'aarch64-linux-android', + '--target', 'i686-linux-android', + '--target', 'x86_64-linux-android', + ] + linux64-rust-static-1.65: description: "rust repack with static linking support" treeherder: diff --git a/taskcluster/scripts/misc/repack_rust.py b/taskcluster/scripts/misc/repack_rust.py index 2ed8dc1228da..889701685998 100755 --- a/taskcluster/scripts/misc/repack_rust.py +++ b/taskcluster/scripts/misc/repack_rust.py @@ -306,7 +306,13 @@ def fetch_manifest(channel="stable", host=None, targets=()): "available": requests.head(url).status_code == 200, } - for pkg in ("cargo", "rustc", "rustfmt-preview", "clippy-preview"): + for pkg in ( + "cargo", + "rustc", + "rustfmt-preview", + "clippy-preview", + "rust-analyzer-preview", + ): manifest["pkg"][pkg] = { "version": "bors", "target": { @@ -395,7 +401,7 @@ def build_src(install_dir, host, targets, patches): docs = false sanitizers = true extended = true - tools = ["analysis", "cargo", "rustfmt", "clippy", "src"] + tools = ["analysis", "cargo", "rustfmt", "clippy", "src", "rust-analyzer"] [rust] ignore-git = false @@ -489,6 +495,7 @@ def repack( rustsrc = fetch_package(manifest, "rust-src", host) rustfmt = fetch_optional(manifest, "rustfmt-preview", host) clippy = fetch_optional(manifest, "clippy-preview", host) + rust_analyzer = fetch_optional(manifest, "rust-analyzer-preview", host) log("Installing packages...") @@ -505,6 +512,8 @@ def repack( install(os.path.basename(rustfmt["url"]), install_dir) if clippy: install(os.path.basename(clippy["url"]), install_dir) + if rust_analyzer: + install(os.path.basename(rust_analyzer["url"]), install_dir) for std in stds: install(os.path.basename(std["url"]), install_dir) pass diff --git a/toolkit/mozapps/installer/package-name.mk b/toolkit/mozapps/installer/package-name.mk index 73c43f4de24c..dd2a2e33b073 100644 --- a/toolkit/mozapps/installer/package-name.mk +++ b/toolkit/mozapps/installer/package-name.mk @@ -93,6 +93,7 @@ MOZSEARCH_ARCHIVE_BASENAME = $(PKG_BASENAME).mozsearch-index MOZSEARCH_RUST_ANALYSIS_BASENAME = $(PKG_BASENAME).mozsearch-rust MOZSEARCH_RUST_STDLIB_BASENAME = $(PKG_BASENAME).mozsearch-rust-stdlib MOZSEARCH_INCLUDEMAP_BASENAME = $(PKG_BASENAME).mozsearch-distinclude +MOZSEARCH_SCIP_INDEX_BASENAME = $(PKG_BASENAME).mozsearch-scip-index # Mozharness naming MOZHARNESS_PACKAGE = mozharness.zip diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk index b5b05804a8ba..0010a2692b6a 100644 --- a/toolkit/mozapps/installer/packager.mk +++ b/toolkit/mozapps/installer/packager.mk @@ -90,6 +90,14 @@ ifdef ENABLE_MOZSEARCH_PLUGIN rustlib/$(RUST_TARGET)/analysis/ rustlib/src/ @echo 'Generating mozsearch distinclude map...' cd $(topobjdir)/ && cp _build_manifests/install/dist_include '$(ABS_DIST)/$(PKG_PATH)$(MOZSEARCH_INCLUDEMAP_BASENAME).map' + @echo 'Generating mozsearch scip index...' + $(RM) $(MOZSEARCH_SCIP_INDEX_BASENAME).zip + cd $(topsrcdir)/ && \ + CARGO=$(MOZ_FETCHES_DIR)/rustc/bin/cargo \ + RUSTC=$(MOZ_FETCHES_DIR)/rustc/bin/rustc \ + $(MOZ_FETCHES_DIR)/rustc/bin/rust-analyzer scip . && \ + zip -r5D '$(ABS_DIST)/$(PKG_PATH)$(MOZSEARCH_SCIP_INDEX_BASENAME).zip' \ + index.scip endif ifeq (Darwin, $(OS_ARCH)) @echo 'Generating macOS codesigning bundle ($(MACOS_CODESIGN_ARCHIVE_BASENAME).zip)' diff --git a/toolkit/mozapps/installer/upload-files.mk b/toolkit/mozapps/installer/upload-files.mk index 5db6a8f73f5a..c20feb7cca4d 100644 --- a/toolkit/mozapps/installer/upload-files.mk +++ b/toolkit/mozapps/installer/upload-files.mk @@ -393,6 +393,7 @@ ifdef ENABLE_MOZSEARCH_PLUGIN UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(MOZSEARCH_ARCHIVE_BASENAME).zip) UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(MOZSEARCH_RUST_ANALYSIS_BASENAME).zip) UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(MOZSEARCH_RUST_STDLIB_BASENAME).zip) + UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(MOZSEARCH_SCIP_INDEX_BASENAME).zip) UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(MOZSEARCH_INCLUDEMAP_BASENAME).map) endif