Skip to content

Commit

Permalink
nix
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Nov 28, 2024
1 parent a428ce3 commit 3233e29
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions examples/nix_cross_compiling/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ register_toolchains(
"//bazel/toolchains/cc/aarch64-linux-android:toolchain",
"//bazel/toolchains/cc/aarch64-unknown-linux-gnu:toolchain",
"//bazel/toolchains/cc/wasm32-unknown-unknown:toolchain",
"//bazel/toolchains/cc/wasm32-wasi:toolchain",
"//bazel/toolchains/cc/wasm32-wasip1:toolchain",
"//bazel/toolchains/cc/x86_64-apple-darwin:toolchain",
"//bazel/toolchains/cc/x86_64-pc-windows-msvc:toolchain",
"//bazel/toolchains/cc/x86_64-unknown-linux-gnu:toolchain",
Expand All @@ -33,7 +33,7 @@ register_toolchains(
"//bazel/toolchains/rust/aarch64-linux-android:toolchain",
"//bazel/toolchains/rust/aarch64-unknown-linux-gnu:toolchain",
"//bazel/toolchains/rust/wasm32-unknown-unknown:toolchain",
"//bazel/toolchains/rust/wasm32-wasi:toolchain",
"//bazel/toolchains/rust/wasm32-wasip1:toolchain",
"//bazel/toolchains/rust/x86_64-apple-darwin:toolchain",
"//bazel/toolchains/rust/x86_64-pc-windows-msvc:toolchain",
"//bazel/toolchains/rust/x86_64-unknown-linux-gnu:toolchain",
Expand Down Expand Up @@ -81,7 +81,7 @@ crates_repository(
"aarch64-linux-android",
"aarch64-unknown-linux-gnu",
"wasm32-unknown-unknown",
"wasm32-wasi",
"wasm32-wasip1",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",
Expand Down
12 changes: 6 additions & 6 deletions examples/nix_cross_compiling/bazel/cargo/cargo-bazel-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions examples/nix_cross_compiling/bazel/nix_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ rust_stdlib_filegroup(
)
rust_stdlib_filegroup(
name = "rust_std-wasm32-wasi",
name = "rust_std-wasm32-wasip1",
srcs = glob(
[
"lib/rustlib/wasm32-wasi/lib/*.rlib",
"lib/rustlib/wasm32-wasi/lib/*.so",
"lib/rustlib/wasm32-wasi/lib/*.dylib",
"lib/rustlib/wasm32-wasi/lib/*.a",
"lib/rustlib/wasm32-wasi/lib/self-contained/**",
"lib/rustlib/wasm32-wasip1/lib/*.rlib",
"lib/rustlib/wasm32-wasip1/lib/*.so",
"lib/rustlib/wasm32-wasip1/lib/*.dylib",
"lib/rustlib/wasm32-wasip1/lib/*.a",
"lib/rustlib/wasm32-wasip1/lib/self-contained/**",
],
# Some patterns (e.g. `lib/*.a`) don't match anything, see https://github.com/bazelbuild/rules_rust/pull/245
allow_empty = True,
Expand Down
2 changes: 1 addition & 1 deletion examples/nix_cross_compiling/bazel/platforms/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ platform(
)

platform(
name = "wasm32-wasi",
name = "wasm32-wasip1",
constraint_values = [
"@platforms//cpu:wasm32",
"@platforms//os:wasi",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ TARGET_CONFIG = {
link_action_configs = wasm_ld_link_action_configs,
strip_action_configs = llvm_strip_strip_action_configs,
),
"wasm32-wasi": struct(
"wasm32-wasip1": struct(
artifact_name_patterns = WASM_ARTIFACT_NAME_PATTERNS,
compile_action_configs = clang_compile_action_configs,
archive_action_configs = llvm_ar_archive_action_configs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ llvm_cc_toolchain_config(
"m",
],
builtin_library_directories = [
"{}/wasi-sysroot/lib/wasm32-wasi".format(SDK_WASM32_WASI),
"{}/wasi-sysroot/lib/wasm32-wasip1".format(SDK_WASM32_WASI),
],
clang = CLANG,
compile_flags = [
Expand All @@ -44,7 +44,7 @@ llvm_cc_toolchain_config(
"--fatal-warnings",
# `wasm-ld` doesn't respect the verbatim `-l:<name>` syntax.
"{}/lib/wasi/libclang_rt.builtins-wasm32.a".format(LIBCLANG_RT_WASM32),
"{}/wasi-sysroot/lib/wasm32-wasi/crt1.o".format(SDK_WASM32_WASI),
"{}/wasi-sysroot/lib/wasm32-wasip1/crt1.o".format(SDK_WASM32_WASI),
],
llvm = LLVM,
opt_compile_flags = [],
Expand All @@ -53,7 +53,7 @@ llvm_cc_toolchain_config(
],
supports_start_end_lib = False,
tags = ["manual"],
target = "wasm32-wasi",
target = "wasm32-wasip1",
)

cc_toolchain(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ rust_toolchain(
extra_exec_rustc_flags = [],
extra_rustc_flags = [],
rust_doc = "@nix_rust//:rustdoc",
rust_std = "@nix_rust//:rust_std-wasm32-wasi",
rust_std = "@nix_rust//:rust_std-wasm32-wasip1",
rustc = "@nix_rust//:rustc",
rustc_lib = "@nix_rust//:rustc_lib",
staticlib_ext = ".a",
stdlib_linkflags = [],
tags = ["manual"],
target_triple = "wasm32-wasi",
target_triple = "wasm32-wasip1",
)

toolchain(
Expand Down
2 changes: 1 addition & 1 deletion examples/nix_cross_compiling/cc_binary/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ platform_transition_binary(
platform_transition_binary(
name = "cc_binary_wasm32-wasi",
binary = ":cc_binary",
target_platform = "//bazel/platforms:wasm32-wasi",
target_platform = "//bazel/platforms:wasm32-wasip1",
)

# platform_transition_binary(
Expand Down
2 changes: 1 addition & 1 deletion examples/nix_cross_compiling/nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
targets."aarch64-linux-android".latest.rust-std
targets."aarch64-unknown-linux-gnu".latest.rust-std
targets."wasm32-unknown-unknown".latest.rust-std
targets."wasm32-wasi".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
Expand Down
2 changes: 1 addition & 1 deletion examples/nix_cross_compiling/rust_binary/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ rust_binary(
rust_binary(
name = "rust_binary_wasm32-wasi",
srcs = ["rust_binary_wasm32-wasi.rs"], # See comments in `rust_binary_wasm32-wasi.rs`.
platform = "//bazel/platforms:wasm32-wasi",
platform = "//bazel/platforms:wasm32-wasip1",
deps = [
"//cc_library",
"//rust_library",
Expand Down

0 comments on commit 3233e29

Please sign in to comment.