enso/MODULE.bazel

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

229 lines
7.1 KiB
Plaintext
Raw Permalink Normal View History

2024-04-19 15:39:47 +03:00
"enso-org/enso"
2024-07-26 13:55:03 +03:00
############################
### JavaScript ecosystem ###
############################
2024-04-19 15:39:47 +03:00
2024-10-29 17:29:06 +03:00
bazel_dep(name = "aspect_rules_js", version = "2.1.0")
bazel_dep(name = "aspect_rules_ts", version = "3.2.1")
bazel_dep(name = "rules_nodejs", version = "6.3.1")
bazel_dep(name = "aspect_bazel_lib", version = "2.9.3")
2024-07-26 13:55:03 +03:00
## Node.js
2024-04-19 15:39:47 +03:00
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "20.11.1")
2024-10-29 17:29:06 +03:00
# bazel_dep(name = "//toolchains/tar")
tar_toolchain = use_extension("//toolchains:tar/extensions.bzl", "tar_toolchain")
use_repo(tar_toolchain, "tar_toolchain")
register_toolchains("//toolchains:windows_builtin_tar_toolchain")
2024-07-26 13:55:03 +03:00
## Npm
2024-04-19 15:39:47 +03:00
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
2024-10-08 15:57:46 +03:00
npm.npm_translate_lock(
name = "npm",
npmrc = "//:.npmrc",
2024-10-08 15:57:46 +03:00
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
2024-04-19 15:39:47 +03:00
use_repo(npm, "npm")
2024-04-23 18:52:41 +03:00
2024-07-26 13:55:03 +03:00
## TypeScript
2024-09-03 18:08:11 +03:00
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext", dev_dependency = True)
rules_ts_ext.deps()
use_repo(rules_ts_ext, "npm_typescript")
2024-04-23 18:52:41 +03:00
2024-07-26 13:55:03 +03:00
############
### RUST ###
############
bazel_dep(name = "rules_rust", version = "0.48.0")
single_version_override(
module_name = "rules_rust",
patches = ["patches/rules_rust_msvc_maxpath.patch"],
)
2024-08-08 15:28:49 +03:00
2024-07-26 13:55:03 +03:00
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
2024-09-03 18:08:11 +03:00
rust.toolchain(
edition = "2021",
2024-10-08 15:57:46 +03:00
extra_target_triples = ["wasm32-unknown-unknown"],
versions = ["nightly/2024-08-08"],
2024-09-03 18:08:11 +03:00
)
2024-07-26 13:55:03 +03:00
use_repo(rust, "rust_toolchains")
2024-09-03 18:08:11 +03:00
register_toolchains("@rust_toolchains//:all")
2024-08-08 15:28:49 +03:00
# print( manifests.MANIFESTS )
2024-07-26 13:55:03 +03:00
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
crate.from_cargo(
name = "crates",
cargo_config = "//:.cargo/config.toml",
cargo_lockfile = "//:Cargo.lock",
2024-07-26 13:55:03 +03:00
manifests = [
"//:build_tools/ci-gen/Cargo.toml",
"//:build_tools/cli/Cargo.toml",
"//:build_tools/install/Cargo.toml",
"//:build_tools/install/config/Cargo.toml",
"//:build_tools/install/installer/Cargo.toml",
"//:build_tools/install/uninstaller/Cargo.toml",
2024-08-08 15:28:49 +03:00
"//:build_tools/macros/lib/Cargo.toml",
2024-07-26 13:55:03 +03:00
"//:Cargo.toml",
"//:lib/rust/launcher-shims/Cargo.toml",
"//:lib/rust/macro-utils/Cargo.toml",
"//:lib/rust/metamodel/Cargo.toml",
"//:lib/rust/parser/debug/Cargo.toml",
"//:lib/rust/parser/doc-parser/Cargo.toml",
"//:lib/rust/parser/generate-java/Cargo.toml",
"//:lib/rust/parser/jni/Cargo.toml",
"//:lib/rust/parser/schema/Cargo.toml",
"//:lib/rust/parser/src/syntax/tree/visitor/Cargo.toml",
"//:lib/rust/prelude/Cargo.toml",
2024-08-08 15:28:49 +03:00
"//:lib/rust/prelude/macros/Cargo.toml",
2024-07-26 13:55:03 +03:00
"//:lib/rust/reflect/Cargo.toml",
"//:lib/rust/zst/Cargo.toml",
2024-08-08 15:28:49 +03:00
"//:lib/rust/parser/debug/fuzz/Cargo.toml",
2024-07-26 13:55:03 +03:00
"//:tools/language-server/logstat/Cargo.toml",
"//:tools/language-server/wstest/Cargo.toml",
"//app/rust-ffi:Cargo.toml",
2024-10-08 15:57:46 +03:00
],
2024-07-26 13:55:03 +03:00
)
use_repo(crate, "crates")
2024-04-24 12:17:09 +03:00
2024-09-03 18:08:11 +03:00
wb_crates = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
wb_crates.from_cargo(
name = "wb_crates",
cargo_config = "//:.cargo/config.toml",
cargo_lockfile = "@wasm_bindgen_cli_crate//:Cargo.lock",
2024-09-03 18:08:11 +03:00
manifests = [
"@wasm_bindgen_cli_crate//:Cargo.toml",
],
)
use_repo(wb_crates, "wb_crates")
2024-09-03 18:08:11 +03:00
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2024-09-03 18:08:11 +03:00
WASM_BINDGEN_VERSION = "0.2.93"
2024-09-03 18:08:11 +03:00
http_archive(
name = "wasm_bindgen_cli_crate",
build_file = "//toolchains/wasm_bindgen:BUILD.wasm-bindgen-cli.bazel",
2024-09-03 18:08:11 +03:00
integrity = "sha256-uwX54YM2X1zzrATWC1Sw4z9JTpNzAme1r4JjNEPugDU=",
strip_prefix = "wasm-bindgen-cli-{}".format(WASM_BINDGEN_VERSION),
type = "tar.gz",
2024-09-03 18:08:11 +03:00
# sha256 = "08f61e21873f51e3059a8c7c3eef81ede7513d161cfc60751c7b2ffa6ed28270",
urls = ["https://static.crates.io/crates/wasm-bindgen-cli/wasm-bindgen-cli-{}.crate".format(WASM_BINDGEN_VERSION)],
)
register_toolchains("//toolchains/wasm_bindgen:cli")
2024-09-03 18:08:11 +03:00
register_toolchains("//toolchains/dummy_cc:dummy_cc_wasm32_toolchain")
2024-07-26 13:55:03 +03:00
###########
### JVM ###
###########
bazel_dep(name = "rules_java", version = "7.6.1")
2024-10-08 15:57:46 +03:00
bazel_dep(name = "rules_graalvm", version = "0.11.1") ## upgrade to 0.11.2 once available in bazel central
2024-04-24 12:17:09 +03:00
gvm = use_extension("@rules_graalvm//:extensions.bzl", "graalvm")
gvm.graalvm(
name = "graalvm",
distribution = "ce", # `oracle`, `ce`, or `community`
java_version = "21", # `17`, `20`, `21`, or `22` as supported by the version provided
version = "23.1.0", # gvm sdk version format like `24.x.x` also supported
2024-04-24 12:17:09 +03:00
)
use_repo(gvm, "graalvm")
2024-04-24 12:17:09 +03:00
register_toolchains("@graalvm//:jvm")
2024-10-08 15:57:46 +03:00
register_toolchains("@graalvm//:sdk") ## Native-image
2024-04-24 12:17:09 +03:00
register_toolchains("@graalvm//:toolchain")
bazel_dep(name = "rules_jvm_external", version = "6.0")
2024-04-24 18:36:43 +03:00
scala_logging_version = "3.9.4"
2024-04-24 18:36:43 +03:00
scalatest_version = "3.3.0-SNAP4"
2024-04-24 18:36:43 +03:00
cats_version = "2.9.0"
2024-04-24 18:36:43 +03:00
circe_version = "0.14.5"
circe_libs = [
"circe-core",
"circe-generic",
"circe-parser",
]
2024-04-24 18:36:43 +03:00
circe = ["io.circe:%s_2.13:%s" % (x, circe_version) for x in circe_libs]
2024-04-25 01:18:52 +03:00
commons_text_version = "1.10.0"
2024-04-25 01:18:52 +03:00
http_components_version = "4.4.1"
2024-04-25 01:18:52 +03:00
jackson_version = "2.15.2"
commons_io_version = "2.12.0"
commons_compress_version = "1.23.0"
2024-04-26 01:54:36 +03:00
commons_lang_version = "3.12.0"
2024-04-26 01:54:36 +03:00
junit_version = "4.13.2"
2024-04-26 01:54:36 +03:00
hamcrest_version = "1.3"
picocli_version = "4.6.1"
minimal_json_version = "0.9.5"
2024-04-24 12:17:09 +03:00
2024-04-26 01:54:36 +03:00
## TODO: Consider replacing maven extension with
## https://github.com/bazeltools/bazel-deps
## The downside of the approach is that a number of other rules rely on it.
2024-04-24 12:17:09 +03:00
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
2024-10-08 15:57:46 +03:00
2024-04-24 12:17:09 +03:00
## After updating a list of artifacts run
## > bazel run @unpinned_maven//:pin
maven.install(
artifacts = [
2024-10-08 15:57:46 +03:00
"com.typesafe.scala-logging:scala-logging_2.13:%s" % scala_logging_version,
"org.scalatest:scalatest_2.13:%s" % scalatest_version,
"org.typelevel:cats-core_2.13:%s" % cats_version,
"org.apache.commons:commons-text:%s" % commons_text_version,
"org.apache.httpcomponents:httpclient:%s" % http_components_version,
"com.fasterxml.jackson.core:jackson-databind:%s" % jackson_version,
"commons-io:commons-io:%s" % commons_io_version,
"org.apache.commons:commons-compress:%s" % commons_compress_version,
"org.apache.commons:commons-lang3:%s" % commons_lang_version,
"junit:junit:%s" % junit_version,
"org.hamcrest:hamcrest-all:%s" % hamcrest_version,
## bazel-distribution dependencies
"info.picocli:picocli:%s" % picocli_version,
"com.eclipsesource.minimal-json:minimal-json:%s" % minimal_json_version,
2024-04-24 18:36:43 +03:00
] + circe,
2024-04-24 12:17:09 +03:00
fail_if_repin_required = True,
lock_file = "//:maven_install.json",
repositories = [
"https://repo.maven.apache.org/maven2",
"https://repo1.maven.org/maven2",
],
)
use_repo(
maven,
"maven",
"unpinned_maven",
)
###################
### ENVIRONMENT ###
###################
secrets = use_extension("//:bazel_scripts/secrets.bzl", "secrets")
secrets.environment_repo(
name = "env",
entries = {
"NODE_ENV": "production",
},
)
use_repo(secrets, "env")