Skip to content

Commit

Permalink
crate_universe: Enable modext isolation.
Browse files Browse the repository at this point in the history
This should allow us to build our python and ruby
code independently - in particular, we can now do shallow
checkouts of one without the other.
Previously, the modext introduced cross-dependency.
This also reduces the amount of work we do in the
crate universe processing for the other language, even
though it's unused.
  • Loading branch information
criemen committed Jul 29, 2024
1 parent d8cc920 commit 6191d86
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ common --registry=file:///%workspace%/misc/bazel/registry
common --registry=https://bcr.bazel.build

common --@rules_dotnet//dotnet/settings:strict_deps=false
common --experimental_isolated_extension_usages

try-import %workspace%/local.bazelrc
1 change: 1 addition & 0 deletions .bazelrc.internal
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ common --registry=https://bcr.bazel.build
# its implementation packages without providing any code itself.
# We either can depend on internal implementation details, or turn of strict deps.
common --@rules_dotnet//dotnet/settings:strict_deps=false
common --experimental_isolated_extension_usages
16 changes: 12 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,35 @@ bazel_dep(name = "rules_rust", version = "0.46.0")

bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)

crate = use_extension(
crate_py = use_extension(
"@rules_rust//crate_universe:extension.bzl",
"crate",
isolate = True,
)
crate.from_cargo(
crate_py.from_cargo(
name = "py_deps",
cargo_lockfile = "//python/extractor/tsg-python:Cargo.lock",
manifests = [
"//python/extractor/tsg-python:Cargo.toml",
"//python/extractor/tsg-python/tsp:Cargo.toml",
],
)
crate.from_cargo(
use_repo(crate_py, "py_deps")

crate_ruby = use_extension(
"@rules_rust//crate_universe:extension.bzl",
"crate",
isolate = True,
)
crate_ruby.from_cargo(
name = "ruby_deps",
cargo_lockfile = "//ruby/extractor:Cargo.lock",
manifests = [
"//ruby/extractor:Cargo.toml",
"//ruby/extractor/codeql-extractor-fake-crate:Cargo.toml",
],
)
use_repo(crate, "py_deps", "ruby_deps")
use_repo(crate_ruby, "ruby_deps")

dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet")
dotnet.toolchain(dotnet_version = "8.0.101")
Expand Down

0 comments on commit 6191d86

Please sign in to comment.