Skip to content

Commit

Permalink
Nix example switched to using `crate_universe_dependencies(bootstrap …
Browse files Browse the repository at this point in the history
…= True)`.
  • Loading branch information
rickvanprim committed Dec 10, 2023
1 parent 0a4c4df commit 1f78b0e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 102 deletions.
61 changes: 0 additions & 61 deletions crate_universe/flake.lock

This file was deleted.

26 changes: 0 additions & 26 deletions crate_universe/flake.nix

This file was deleted.

10 changes: 9 additions & 1 deletion examples/nix_cross_compiling/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies")

rules_rust_dependencies()

load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")

crate_universe_dependencies(
bootstrap = True,
rust_toolchain_cargo_template = "@nix_rust//:bin/{tool}",
rust_toolchain_rustc_template = "@nix_rust//:bin/{tool}",
)

load("@rules_rust//crate_universe:defs.bzl", "crates_repository", "render_config", "splicing_config")
load("//bazel/cargo:crates_repository.bzl", CARGO_ANNOTATIONS = "ANNOTATIONS", CARGO_PACKAGES = "PACKAGES")

Expand All @@ -34,7 +42,7 @@ crates_repository(
annotations = CARGO_ANNOTATIONS,
cargo_lockfile = "//bazel/cargo:Cargo.lock",
generate_build_scripts = False,
generator = "@cargo-bazel//:bin/cargo-bazel",
generator = "@cargo_bazel_bootstrap//:cargo-bazel",
lockfile = "//bazel/cargo:cargo-bazel-lock.json",
packages = CARGO_PACKAGES,
render_config = render_config(
Expand Down
14 changes: 0 additions & 14 deletions examples/nix_cross_compiling/bazel/nix_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,6 @@ rust_stdlib_filegroup(
)
"""

_CARGO_BAZEL_BUILD_FILE_CONTENT = """
package(default_visibility = ["//visibility:public"])
exports_files(["bin/cargo-bazel"])
"""

def nix_repositories():
nixpkgs_flake_package(
name = "nix_config",
Expand All @@ -223,11 +217,3 @@ def nix_repositories():
package = "bazel.rust",
build_file_content = _RUST_BUILD_FILE_CONTENT,
)

nixpkgs_flake_package(
name = "cargo-bazel",
nix_flake_file = "@rules_rust//crate_universe:flake.nix",
nix_flake_lock_file = "@rules_rust//crate_universe:flake.lock",
package = "cargo-bazel",
build_file_content = _CARGO_BAZEL_BUILD_FILE_CONTENT,
)

0 comments on commit 1f78b0e

Please sign in to comment.