Skip to content

Commit

Permalink
Migrate bazel from WORKSPACE to bzlmod
Browse files Browse the repository at this point in the history
  • Loading branch information
murki authored and Reflejo committed Jan 14, 2025
1 parent c2ebc1b commit 8a000ca
Show file tree
Hide file tree
Showing 36 changed files with 16,508 additions and 805 deletions.
15 changes: 7 additions & 8 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
common --experimental_allow_tags_propagation
common --enable_bzlmod
#common --experimental_allow_tags_propagation

mobile-install --config=android

build --enable_platform_specific_config
# https://github.com/bazelbuild/bazel/issues/18958
build --noenable_bzlmod
build:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain
build:macos --crosstool_top=@local_config_apple_cc//:toolchain
build:macos --host_crosstool_top=@local_config_apple_cc//:toolchain
Expand All @@ -30,15 +29,12 @@ build --features=swift.use_global_module_cache

# Gate the references to androidndk behind a flag to support building on arm linux.
build:android --android_crosstool_top=@androidndk//:toolchain
build:android --extra_toolchains=@androidndk//...
build --platform_mappings=bazel/platform_mappings

build --@rules_rust//rust/settings:rustfmt.toml=//:rustfmt.toml
build --@rules_rust//rust/settings:clippy.toml=//:.clippy.toml

build --macos_minimum_os=12.5
build --host_macos_minimum_os=12.5

build --ios_minimum_os=12.0
build --ios_simulator_device="iPhone 13"
build --ios_simulator_version=17.5
Expand Down Expand Up @@ -83,11 +79,14 @@ build:release-common --config=abort-panic
# Size optimizations, codegen-units=1 go along side LTO, which accounts for
# about 10% reduction; -z has a non-zero smaller impact (a few pp).
build:release-common --@rules_rust//rust/settings:extra_rustc_flag='-Ccodegen-units=1'
build:release-common --@rules_rust//rust/settings:extra_rustc_flag='-Clto=fat'
build:release-common --@rules_rust//rust/settings:extra_rustc_flag='-Copt-level=s'
build:release-common --@rules_rust//rust/settings:extra_rustc_flag='-Clto=fat'
# Without the next line, rules_rust will add -Clinker-plugin-lto which would be amazing
# but the ndk's lld won't support the output
build:release-common --@rules_rust//rust/settings:lto='manual'

build:release-android --define android_strip_symbols=true
build:release-android --fat_apk_cpu=x86,x86_64,armeabi-v7a,arm64-v8a
build:release-android --android_platforms=@rules_android//:armeabi-v7a,@rules_android//:arm64-v8a,@rules_android//:x86,@rules_android//:x86_64
build:release-android --config=release-common
build:release-android --copt=-flto=thin --linkopt=-flto=thin
build:release-android --config=android
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0-pre.20231018.3
7.4.1
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,3 @@ rust-project.json
/perf.data
/perf.data.old
vendor

# TODO(mattklein123): Theoretically we should be using these files now, but they cause errors and
# are spit out so need to sort this out.
MODULE.bazel
MODULE.bazel.lock
16 changes: 4 additions & 12 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_framework_import")
load(
"@io_bazel_rules_kotlin//kotlin:core.bzl",
"define_kt_toolchain",
"kt_compiler_plugin",
"kt_kotlinc_options",
)
load(
"@io_bazel_rules_kotlin//kotlin:jvm.bzl",
"kt_javac_options",
)
load("@rules_apple//apple:apple.bzl", "apple_static_framework_import")
load("@rules_kotlin//kotlin:core.bzl", "define_kt_toolchain", "kt_compiler_plugin", "kt_kotlinc_options")
load("@rules_kotlin//kotlin:jvm.bzl", "kt_javac_options")
load("@rules_java//java:defs.bzl", "java_binary")
load("@rules_pkg//:pkg.bzl", "pkg_zip")
load(
Expand Down Expand Up @@ -160,7 +152,7 @@ kt_compiler_plugin(
target_embedded_compiler = True,
visibility = ["//visibility:public"],
deps = [
"@maven//:androidx_compose_compiler_compiler",
"@maven//:org_jetbrains_kotlin_kotlin_compose_compiler_plugin_embeddable",
],
)

Expand Down
Loading

0 comments on commit 8a000ca

Please sign in to comment.