diff --git a/crate_universe/extensions.bzl b/crate_universe/extensions.bzl index e1c2e66f8e..b72d35bfbe 100644 --- a/crate_universe/extensions.bzl +++ b/crate_universe/extensions.bzl @@ -1229,7 +1229,7 @@ _spec = tag_class( doc = "A list of features to use for the crate.", ), "git": attr.string( - doc = "The Git url to use for the crate. Cannot be used with `version`.", + doc = "The Git url to use for the crate. Cannot be used with `version` or `path`.", ), "lib": attr.bool( doc = "If using `artifact = 'bin'`, additionally setting `lib = True` declares a dependency on both the package's library and binary, as opposed to just the binary.", @@ -1238,6 +1238,9 @@ _spec = tag_class( doc = "The explicit name of the package.", mandatory = True, ), + "path": attr.string( + doc = "The local path of the remote crate. Cannot be used with `version` or `git`.", + ), "repositories": attr.string_list( doc = "A list of repository names specified from `crate.from_cargo(name=...)` that this spec is applied to. Defaults to all repositories.", default = [], @@ -1249,7 +1252,7 @@ _spec = tag_class( doc = "The git tag of the remote crate. Tied with the `git` param. Only one of branch, tag or rev may be specified. Specifying `rev` is recommended for fully-reproducible builds.", ), "version": attr.string( - doc = "The exact version of the crate. Cannot be used with `git`.", + doc = "The exact version of the crate. Cannot be used with `git` or `path`.", ), }, ) diff --git a/crate_universe/private/crate.bzl b/crate_universe/private/crate.bzl index 749012c9a6..070b8d2bdf 100644 --- a/crate_universe/private/crate.bzl +++ b/crate_universe/private/crate.bzl @@ -27,7 +27,8 @@ def _spec( git = None, branch = None, tag = None, - rev = None): + rev = None, + path = None): """A constructor for a crate dependency. See [specifying dependencies][sd] in the Cargo book for more details. @@ -36,15 +37,16 @@ def _spec( Args: package (str, optional): The explicit name of the package (used when attempting to alias a crate). - version (str, optional): The exact version of the crate. Cannot be used with `git`. + version (str, optional): The exact version of the crate. Cannot be used with `git` or `path`. artifact (str, optional): Set to "bin" to pull in a binary crate as an artifact dependency. Requires a nightly Cargo. lib (bool, optional): If using `artifact = "bin"`, additionally setting `lib = True` declares a dependency on both the package's library and binary, as opposed to just the binary. default_features (bool, optional): Maps to the `default-features` flag. features (list, optional): A list of features to use for the crate - git (str, optional): The Git url to use for the crate. Cannot be used with `version`. + git (str, optional): The Git url to use for the crate. Cannot be used with `version` or `path`. branch (str, optional): The git branch of the remote crate. Tied with the `git` param. Only one of branch, tag or rev may be specified. Specifying `rev` is recommended for fully-reproducible builds. tag (str, optional): The git tag of the remote crate. Tied with the `git` param. Only one of branch, tag or rev may be specified. Specifying `rev` is recommended for fully-reproducible builds. rev (str, optional): The git revision of the remote crate. Tied with the `git` param. Only one of branch, tag or rev may be specified. + path (str, optional): The local path of the remote crate. Cannot be used with `version` or `git`. Returns: string: A json encoded string of all inputs @@ -59,6 +61,7 @@ def _spec( "git": git, "lib": lib, "package": package, + "path": path, "rev": rev, "tag": tag, "version": version, diff --git a/crate_universe/src/api/lockfile.rs b/crate_universe/src/api/lockfile.rs index d509f37d87..0cbf017419 100644 --- a/crate_universe/src/api/lockfile.rs +++ b/crate_universe/src/api/lockfile.rs @@ -176,7 +176,6 @@ mod test { }, target: String::from("anyhow"), alias: None, - local_path: None, }, CrateDependency { id: CrateId { @@ -185,7 +184,6 @@ mod test { }, target: String::from("reqwest"), alias: None, - local_path: None, }, ], ); diff --git a/crate_universe/src/context/crate_context.rs b/crate_universe/src/context/crate_context.rs index c8bc7a768e..a4e17addbd 100644 --- a/crate_universe/src/context/crate_context.rs +++ b/crate_universe/src/context/crate_context.rs @@ -2,7 +2,6 @@ use std::collections::{BTreeMap, BTreeSet}; -use camino::Utf8PathBuf; use cargo_metadata::{Node, Package, PackageId}; use serde::{Deserialize, Serialize}; @@ -26,11 +25,6 @@ pub struct CrateDependency { /// Some dependencies are assigned aliases. This is tracked here #[serde(default, skip_serializing_if = "Option::is_none")] pub alias: Option, - - /// Local path of this dependency if provided. This captures local paths from both the - /// `[dependencies]` table and the `[patches]` table so they can be used in rendering. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub(crate) local_path: Option, } #[derive(Debug, Default, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Clone)] @@ -392,10 +386,6 @@ impl CrateContext { id: CrateId::new(pkg.name.clone(), pkg.version.clone()), target, alias: dep.alias, - local_path: match source_annotations.get(&dep.package_id) { - Some(SourceAnnotation::Path { path }) => Some(path.clone()), - _ => None, - }, } }; @@ -493,10 +483,6 @@ impl CrateContext { id: current_crate_id, target: target.crate_name.clone(), alias: None, - local_path: match source_annotations.get(&annotation.node.id) { - Some(SourceAnnotation::Path { path }) => Some(path.clone()), - _ => None, - }, }, None, ); diff --git a/crate_universe/src/context/platforms.rs b/crate_universe/src/context/platforms.rs index 7ea36f2f0f..3a1656b1be 100644 --- a/crate_universe/src/context/platforms.rs +++ b/crate_universe/src/context/platforms.rs @@ -135,7 +135,6 @@ mod test { id: CrateId::new("mock_crate_b".to_owned(), VERSION_ZERO_ONE_ZERO), target: "mock_crate_b".to_owned(), alias: None, - local_path: None, }, None, ); @@ -194,7 +193,6 @@ mod test { id: CrateId::new("mock_crate_b".to_owned(), VERSION_ZERO_ONE_ZERO), target: "mock_crate_b".to_owned(), alias: None, - local_path: None, }, Some(configuration), ); @@ -281,7 +279,6 @@ mod test { id: CrateId::new("mock_crate_b".to_owned(), VERSION_ZERO_ONE_ZERO), target: "mock_crate_b".to_owned(), alias: None, - local_path: None, }, Some(configuration.clone()), ); @@ -348,7 +345,6 @@ mod test { id: CrateId::new("mock_crate_b".to_owned(), VERSION_ZERO_ONE_ZERO), target: "mock_crate_b".to_owned(), alias: None, - local_path: None, }, Some(configuration.clone()), ); diff --git a/crate_universe/src/rendering.rs b/crate_universe/src/rendering.rs index 425bd1b213..e2877add02 100644 --- a/crate_universe/src/rendering.rs +++ b/crate_universe/src/rendering.rs @@ -860,9 +860,8 @@ impl Renderer { extra_deps: Select>, ) -> Select> { Select::merge( - deps.map(|dep| match dep.local_path { - Some(path) => Label::from_str(&format!("//{}:{}", path, &dep.target)).unwrap(), - _ => self.crate_label(&dep.id.name, &dep.id.version.to_string(), &dep.target), + deps.map(|dep| { + self.crate_label(&dep.id.name, &dep.id.version.to_string(), &dep.target) }), extra_deps, ) @@ -2026,7 +2025,6 @@ mod test { // this is identical to what we have in the `name` attribute // which creates conflict in `render_module_build_file` alias: Some("mock_crate".into()), - local_path: None, }])), ..Default::default() }, @@ -2152,13 +2150,11 @@ mod test { id: dependency_id.clone(), target: "my_dependency".into(), alias: None, - local_path: None, }, CrateDependency { id: dependency_id, target: "my_dependency".into(), alias: Some("my_dependency_other".into()), - local_path: None, }, ])), ..Default::default() diff --git a/crate_universe/src/splicing/splicer.rs b/crate_universe/src/splicing/splicer.rs index cb657519ca..bf33e46558 100644 --- a/crate_universe/src/splicing/splicer.rs +++ b/crate_universe/src/splicing/splicer.rs @@ -637,6 +637,7 @@ mod test { use super::*; use std::fs::File; + use std::path::PathBuf; use std::str::FromStr; use cargo_metadata::PackageId; @@ -670,7 +671,7 @@ mod test { /// Get cargo and rustc binaries the Bazel way #[cfg(not(feature = "cargo"))] - fn get_cargo_and_rustc_paths() -> (std::path::PathBuf, std::path::PathBuf) { + fn get_cargo_and_rustc_paths() -> (PathBuf, PathBuf) { let r = runfiles::Runfiles::create().unwrap(); let cargo_path = runfiles::rlocation!(r, concat!("rules_rust/", env!("CARGO"))).unwrap(); let rustc_path = runfiles::rlocation!(r, concat!("rules_rust/", env!("RUSTC"))).unwrap(); diff --git a/examples/crate_universe_local_path/MODULE.bazel b/examples/crate_universe_local_path/MODULE.bazel index 0aa700cd39..c7d7daf0c6 100644 --- a/examples/crate_universe_local_path/MODULE.bazel +++ b/examples/crate_universe_local_path/MODULE.bazel @@ -16,12 +16,24 @@ use_repo( register_toolchains("@rust_toolchains//:all") crate = use_extension( - "@rules_rust//crate_universe:extension.bzl", + "@rules_rust//crate_universe:extensions.bzl", "crate", ) crate.from_cargo( name = "crates_from_cargo_workspace", - cargo_lockfile = "//crates_from_workspace:Cargo.lock", + cargo_lockfile = "//crates_from_workspace:Cargo.workspace.lock", manifests = ["//crates_from_workspace:Cargo.toml"], ) use_repo(crate, "crates_from_cargo_workspace") + +# crate.spec( +# package = "lazy_static", +# repositories = ["crates_from_packages"], +# # Replaced by `vendor_lazy_static.sh` +# version = "1.5.0", # lazy_static +# ) +# crate.from_specs( +# name = "crates_from_packages", +# cargo_lockfile = "//crates_from_workspace:Cargo.packages.lock", +# ) +# use_repo(crate, "crates_from_packages") diff --git a/examples/crate_universe_local_path/WORKSPACE.bazel b/examples/crate_universe_local_path/WORKSPACE.bazel index 2dd72ee98c..fcfcce66e0 100644 --- a/examples/crate_universe_local_path/WORKSPACE.bazel +++ b/examples/crate_universe_local_path/WORKSPACE.bazel @@ -15,17 +15,31 @@ load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencie crate_universe_dependencies(bootstrap = True) -load("@rules_rust//crate_universe:defs.bzl", "crates_repository") +load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository") crates_repository( name = "crates_from_cargo_workspace", - cargo_lockfile = "//crates_from_workspace:Cargo.lock", + cargo_lockfile = "//crates_from_workspace:Cargo.workspace.lock", # `generator` is not necessary in official releases. # See load satement for `cargo_bazel_bootstrap`. generator = "@cargo_bazel_bootstrap//:cargo-bazel", manifests = ["//crates_from_workspace:Cargo.toml"], ) -load("@crates_from_cargo_workspace//:defs.bzl", "crate_repositories") +load("@crates_from_cargo_workspace//:defs.bzl", crate_repositories_from_cargo_workspace = "crate_repositories") -crate_repositories() +crate_repositories_from_cargo_workspace() + +# crates_repository( +# name = "crates_from_packages", +# cargo_lockfile = "//crates_from_workspace:Cargo.packages.lock", +# # `generator` is not necessary in official releases. +# # See load satement for `cargo_bazel_bootstrap`. +# generator = "@cargo_bazel_bootstrap//:cargo-bazel", +# # Replaced by `vendor_lazy_static.sh` +# packages = {"lazy_static": crate.spec(version = "1.5.0")}, +# ) + +# load("@crates_from_packages//:defs.bzl", crate_repositories_from_packages = "crate_repositories") + +# crate_repositories_from_packages() diff --git a/examples/crate_universe_local_path/crates_from_workspace/BUILD.bazel b/examples/crate_universe_local_path/crates_from_workspace/BUILD.bazel index 38915bf652..5ce530c829 100644 --- a/examples/crate_universe_local_path/crates_from_workspace/BUILD.bazel +++ b/examples/crate_universe_local_path/crates_from_workspace/BUILD.bazel @@ -1,8 +1,14 @@ -load("@crates_from_cargo_workspace//:defs.bzl", "all_crate_deps") +load("@crates_from_cargo_workspace//:defs.bzl", all_crate_deps_from_cargo_workspace = "all_crate_deps") load("@rules_rust//rust:defs.bzl", "rust_test") rust_test( - name = "test", + name = "test_from_cargo_workspace", srcs = ["test.rs"], - deps = all_crate_deps(), + deps = all_crate_deps_from_cargo_workspace(), ) + +# rust_test( +# name = "test_from_packages", +# srcs = ["test.rs"], +# deps = ["@crates_from_packages//:lazy_static"], +# ) diff --git a/examples/crate_universe_local_path/crates_from_workspace/Cargo.packages.lock b/examples/crate_universe_local_path/crates_from_workspace/Cargo.packages.lock new file mode 100644 index 0000000000..9e9985c44c --- /dev/null +++ b/examples/crate_universe_local_path/crates_from_workspace/Cargo.packages.lock @@ -0,0 +1,16 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "direct-cargo-bazel-deps" +version = "0.0.1" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" diff --git a/examples/crate_universe_local_path/crates_from_workspace/Cargo.lock b/examples/crate_universe_local_path/crates_from_workspace/Cargo.workspace.lock similarity index 100% rename from examples/crate_universe_local_path/crates_from_workspace/Cargo.lock rename to examples/crate_universe_local_path/crates_from_workspace/Cargo.workspace.lock diff --git a/examples/crate_universe_local_path/vendor_edit_test.sh b/examples/crate_universe_local_path/vendor_edit_test.sh index 8ced6fab70..a06e685197 100755 --- a/examples/crate_universe_local_path/vendor_edit_test.sh +++ b/examples/crate_universe_local_path/vendor_edit_test.sh @@ -13,7 +13,7 @@ vendor_target="$1" echo >&2 "Patching lazy_static dependency" -vendored_lazy_static_dir="$(bazel run "${vendor_target}" | awk '$0 ~ /Copied to/ {print $3}')" +vendored_lazy_static_dir="$(bazel run "${vendor_target}" | awk '$0 ~ /VENDOR_EDIT_TEST:/ {print $2}')" echo >&2 "Vendored lazy_static to ${vendored_lazy_static_dir}" echo >&2 "Running test which is expected to pass, now that patch is applied" diff --git a/examples/crate_universe_local_path/vendor_lazy_static.sh b/examples/crate_universe_local_path/vendor_lazy_static.sh index 4f81d5aee4..aea6b2ca30 100755 --- a/examples/crate_universe_local_path/vendor_lazy_static.sh +++ b/examples/crate_universe_local_path/vendor_lazy_static.sh @@ -29,6 +29,12 @@ cp -r "lazy_static_1.5.0_copy/"* "${copy_to}/" echo "pub const VENDORED_BY: &'static str = \"rules_rust\";" >> "${copy_to}/src/lib.rs" cargo_toml_to_update="crates_from_workspace/Cargo.toml" +workspace_bazel_to_update="WORKSPACE.bazel" +module_bazel_to_update="MODULE.bazel" echo "lazy_static = { path = \"${path_dep_path}\" }" >> "${cargo_toml_to_update}" +sed -i -e "s|\"lazy_static\": crate.spec(version = \"1.5.0\")|\"lazy_static\": crate.spec(path = \"${copy_to}\")|" "${workspace_bazel_to_update}" +sed -i -e "s|version = \"1.5.0\", # lazy_static|path = \"${copy_to}\", # lazy_static|" "${module_bazel_to_update}" -echo "Copied to ${copy_to} and updated ${cargo_toml_to_update}" +echo "Copied to ${copy_to}, updated ${cargo_toml_to_update}, updated ${workspace_bazel_to_update}, and updated ${module_bazel_to_update}" + +echo "VENDOR_EDIT_TEST: ${copy_to}" diff --git a/examples/nix_cross_compiling/nix/flake.lock b/examples/nix_cross_compiling/nix/flake.lock index 3e88038f52..b579e38b99 100644 --- a/examples/nix_cross_compiling/nix/flake.lock +++ b/examples/nix_cross_compiling/nix/flake.lock @@ -9,11 +9,11 @@ ] }, "locked": { - "lastModified": 1732825190, - "narHash": "sha256-1VyTOvJqJiNviasy0Wn3ZZqY4gkTqgS0B67m4DTWFdY=", + "lastModified": 1749932438, + "narHash": "sha256-zXHpbiCRv+h9+SLdC0H/6icbQVuTQTuT2wpw3FitCo8=", "owner": "tadfisher", "repo": "android-nixpkgs", - "rev": "6fc652b651d3cd2c7d40f1f6a40630041cc0687a", + "rev": "04d5b7d7c59f93ebe89b522ff56da4d650ee5c5b", "type": "github" }, "original": { @@ -30,11 +30,11 @@ ] }, "locked": { - "lastModified": 1728330715, - "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=", + "lastModified": 1741473158, + "narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=", "owner": "numtide", "repo": "devshell", - "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef", + "rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0", "type": "github" }, "original": { @@ -51,11 +51,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1732689334, - "narHash": "sha256-yKI1KiZ0+bvDvfPTQ1ZT3oP/nIu3jPYm4dnbRd6hYg4=", + "lastModified": 1749969540, + "narHash": "sha256-jkSMD64ral4yBW0tiHgcZo6zyGsO0x0Aows0SEmWqPo=", "owner": "nix-community", "repo": "fenix", - "rev": "a8a983027ca02b363dfc82fbe3f7d9548a8d3dce", + "rev": "c0491d36bb321bc23021714e73369790e315984d", "type": "github" }, "original": { @@ -84,17 +84,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1731746768, - "narHash": "sha256-FPV1ZxTpXZfWq1vYgsRbhb/GQo4c6eY1GgSVoPutIss=", + "lastModified": 1750006614, + "narHash": "sha256-4f+LCEV/iuSgQWqVyFzOuNnWKlKjPrk/0OvY8JszmIw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "614462224f836ca340aed96b86799ad09b4c2298", + "rev": "c21a866d0b19c5965a45ae04b2c93f26cd04dcde", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "614462224f836ca340aed96b86799ad09b4c2298", "type": "github" } }, @@ -108,11 +107,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1732633904, - "narHash": "sha256-7VKcoLug9nbAN2txqVksWHHJplqK9Ou8dXjIZAIYSGc=", + "lastModified": 1749877986, + "narHash": "sha256-qEkNilgV6N4J0EhuPE8U4ispuMXgrRHAhi/BirBfC4I=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "8d5e91c94f80c257ce6dbdfba7bd63a5e8a03fa6", + "rev": "fe5a925a74efde7ec6a7d3e388b946f96d36e760", "type": "github" }, "original": { diff --git a/examples/nix_cross_compiling/nix/flake.nix b/examples/nix_cross_compiling/nix/flake.nix index f801d02cce..d7c4421bac 100644 --- a/examples/nix_cross_compiling/nix/flake.nix +++ b/examples/nix_cross_compiling/nix/flake.nix @@ -1,9 +1,7 @@ { inputs = { - - # Avoid need for https://github.com/nix-community/fenix/pull/180 nixpkgs = { - url = "github:NixOS/nixpkgs?rev=614462224f836ca340aed96b86799ad09b4c2298"; + url = "github:NixOS/nixpkgs"; }; fenix = { @@ -17,30 +15,45 @@ }; }; - outputs = { self, nixpkgs, fenix, android-nixpkgs, ... }: + outputs = + { + self, + nixpkgs, + fenix, + android-nixpkgs, + ... + }: let pkgs = import nixpkgs { system = "x86_64-linux"; }; llvm = pkgs.llvmPackages_16; - rust = with fenix.packages."x86_64-linux"; combine [ - complete.cargo - complete.clippy - complete.rustc - complete.rustfmt - complete.rust-src - targets."aarch64-apple-darwin".latest.rust-std - targets."aarch64-apple-ios".latest.rust-std - targets."aarch64-linux-android".latest.rust-std - targets."aarch64-unknown-linux-gnu".latest.rust-std - targets."wasm32-unknown-unknown".latest.rust-std - targets."wasm32-wasip1".latest.rust-std - targets."x86_64-apple-darwin".latest.rust-std - targets."x86_64-pc-windows-msvc".latest.rust-std - targets."x86_64-unknown-linux-gnu".latest.rust-std - ]; - - fetchVendor = { name, url, sha256, stripComponents ? 0 }: + rust = + with fenix.packages."x86_64-linux"; + combine [ + complete.cargo + complete.clippy + complete.rustc + complete.rustfmt + complete.rust-src + targets."aarch64-apple-darwin".latest.rust-std + targets."aarch64-apple-ios".latest.rust-std + targets."aarch64-linux-android".latest.rust-std + targets."aarch64-unknown-linux-gnu".latest.rust-std + targets."wasm32-unknown-unknown".latest.rust-std + targets."wasm32-wasip1".latest.rust-std + targets."x86_64-apple-darwin".latest.rust-std + targets."x86_64-pc-windows-msvc".latest.rust-std + targets."x86_64-unknown-linux-gnu".latest.rust-std + ]; + + fetchVendor = + { + name, + url, + sha256, + stripComponents ? 0, + }: let authorization = if (pkgs.lib.hasPrefix "https://raw.githubusercontent.com//" url) then @@ -54,13 +67,14 @@ outputHashMode = "recursive"; outputHashAlgo = "sha256"; outputHash = sha256; - } '' - # Empty URL special cased for example - mkdir --parents $out - if [ -n "${url}" ]; then - ${pkgs.curl}/bin/curl -s -S -L ${authorization} "${url}" | ${pkgs.libarchive}/bin/bsdtar -C $out -xf - --strip-components ${toString stripComponents} - fi - ''; + } + '' + # Empty URL special cased for example + mkdir --parents $out + if [ -n "${url}" ]; then + ${pkgs.curl}/bin/curl -s -S -L ${authorization} "${url}" | ${pkgs.libarchive}/bin/bsdtar -C $out -xf - --strip-components ${toString stripComponents} + fi + ''; libclang_rt_wasm32 = fetchVendor { name = "libclang_rt_wasm32"; @@ -86,13 +100,15 @@ sha256 = "pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="; # User needs to supply. }; - sdk_universal-linux-android = android-nixpkgs.sdk."x86_64-linux" (sdkPkgs: with sdkPkgs; [ - cmdline-tools-latest - build-tools-33-0-2 - platform-tools - platforms-android-33 - ndk-25-2-9519653 - ]); + sdk_universal-linux-android = android-nixpkgs.sdk."x86_64-linux" ( + sdkPkgs: with sdkPkgs; [ + cmdline-tools-latest + build-tools-33-0-2 + platform-tools + platforms-android-33 + ndk-25-2-9519653 + ] + ); sdk_wasm32-wasi = fetchVendor { name = "sdk_wasm32-wasi"; diff --git a/nix/flake.lock b/nix/flake.lock index 1fae055312..4b28fdaad5 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -20,17 +20,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1731746768, - "narHash": "sha256-FPV1ZxTpXZfWq1vYgsRbhb/GQo4c6eY1GgSVoPutIss=", + "lastModified": 1750006614, + "narHash": "sha256-4f+LCEV/iuSgQWqVyFzOuNnWKlKjPrk/0OvY8JszmIw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "614462224f836ca340aed96b86799ad09b4c2298", + "rev": "c21a866d0b19c5965a45ae04b2c93f26cd04dcde", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "614462224f836ca340aed96b86799ad09b4c2298", "type": "github" } }, diff --git a/nix/flake.nix b/nix/flake.nix index b7973523a1..136a07053d 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -1,28 +1,34 @@ { inputs = { - # Avoid need for https://github.com/nix-community/fenix/pull/180 nixpkgs = { - url = "github:NixOS/nixpkgs?rev=614462224f836ca340aed96b86799ad09b4c2298"; + url = "github:NixOS/nixpkgs"; }; flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, flake-utils, ... }: - flake-utils.lib.eachDefaultSystem (system: + outputs = + { + self, + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let pkgs = import nixpkgs { inherit system; }; in { - devShells.default = pkgs.mkShell - { - packages = [ - pkgs.bazel-buildtools - pkgs.bazel_7 - pkgs.cargo - pkgs.rustc - pkgs.rustfmt - ]; - }; - }); + devShells.default = pkgs.mkShell { + packages = [ + pkgs.bazel-buildtools + pkgs.bazel_7 + pkgs.cargo + pkgs.rustc + pkgs.rustfmt + ]; + }; + } + ); }