diff --git a/Cargo.Bazel.lock b/Cargo.Bazel.lock index c1ef5145..8fdde35f 100644 --- a/Cargo.Bazel.lock +++ b/Cargo.Bazel.lock @@ -1,5 +1,5 @@ { - "checksum": "744dd569fafa47a201b84ee3f99e9a01c645444fd61e34b7a6d248ec49816531", + "checksum": "01e7fd8b186277f5d802bd5104ee8a45ccdbe7a557bf91264a3553888cf151c2", "crates": { "addr2line 0.20.0": { "name": "addr2line", @@ -1903,6 +1903,10 @@ }, "build_script_env": { "common": { + "BINDGEN_EXTRA_CLANG_ARGS_aarch64-apple-darwin": "-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/", + "BINDGEN_EXTRA_CLANG_ARGS_aarch64-unknown-linux-gnu": "-I/usr/include/", + "BINDGEN_EXTRA_CLANG_ARGS_x86_64-apple-darwin": "-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/", + "BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-linux-gnu": "-I/usr/include/", "BORING_BAZEL_BUILD": "1", "BORING_BSSL_INCLUDE_PATH": "$(location @//deps/boringssl:include)", "BORING_BSSL_PATH": "$(GENDIR)/deps/boringssl" diff --git a/WORKSPACE b/WORKSPACE index 69577648..cf7021c2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,24 +1,24 @@ workspace(name = "clash-rs") -#load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # To find additional information on this release or newer ones visit: # https://github.com/bazelbuild/rules_rust/releases -# http_archive( -# name = "rules_rust", -# sha256 = "9d04e658878d23f4b00163a72da3db03ddb451273eb347df7d7c50838d698f49", -# urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.26.0/rules_rust-v0.26.0.tar.gz"], -# ) - -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") - -git_repository( +http_archive( name = "rules_rust", - branch = "pass-to-bindgen", - remote = "https://github.com/ibigbug/rules_rust.git", + sha256 = "9d04e658878d23f4b00163a72da3db03ddb451273eb347df7d7c50838d698f49", + urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.26.0/rules_rust-v0.26.0.tar.gz"], ) +# load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") + +# git_repository( +# name = "rules_rust", +# branch = "pass-to-bindgen", +# remote = "https://github.com/ibigbug/rules_rust.git", +# ) + load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") rules_rust_dependencies() @@ -32,10 +32,14 @@ rust_register_toolchains( load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") -crate_universe_dependencies(bootstrap = True) +crate_universe_dependencies() load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository") +MACOS_BINDGEN_FLAGS = "-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/" + +LINUX_BINDGEN_FLAGS = "-I/usr/include/" + crates_repository( name = "crate_index", annotations = { @@ -47,6 +51,10 @@ crates_repository( "BORING_BAZEL_BUILD": "1", "BORING_BSSL_PATH": "$(GENDIR)/deps/boringssl", "BORING_BSSL_INCLUDE_PATH": "$(location @//deps/boringssl:include)", + "BINDGEN_EXTRA_CLANG_ARGS_aarch64-apple-darwin": MACOS_BINDGEN_FLAGS, + "BINDGEN_EXTRA_CLANG_ARGS_x86_64-apple-darwin": MACOS_BINDGEN_FLAGS, + "BINDGEN_EXTRA_CLANG_ARGS_aarch64-unknown-linux-gnu": LINUX_BINDGEN_FLAGS, + "BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-linux-gnu": LINUX_BINDGEN_FLAGS, }, data = [ "@//deps/boringssl:lib", @@ -54,7 +62,6 @@ crates_repository( )], }, cargo_lockfile = "//:Cargo.lock", - generator = "@cargo_bazel_bootstrap//:cargo-bazel", lockfile = "//:Cargo.Bazel.lock", manifests = [ "//:Cargo.toml",