pulumi/WORKSPACE

211 lines
6.5 KiB
Python

workspace(name = "pulumi")
## TODOS
#
# Docs
#
# * Ordering constraints in WORKSPACE
# * Gazelle directives, including those in pkg/BUILD.bazel, sdk/BUILD.bazel,
# etc.
# * Nixpkgs setup and directory
# * gRPC compilers used by Gazelle so that we get UnsafeServers, newer gRPC
# features, etc.
#
# Layout
#
# * Just inline everything into the WORKSPACE -- the ordering constraints etc.
# mean it's uglier and harder to follow with bazel/repo/*
# * Though perhaps leave the Go deps in there somewhere
# Dependencies
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_features",
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
strip_prefix = "bazel_features-1.9.1",
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
)
load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()
http_archive(
name = "bazel_skylib",
sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
],
)
http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "480df4a7777a5e3ee7a755ab38d18ecb3ddb7b2e2435f24ad2037c1b084faa65",
strip_prefix = "rules_nixpkgs-126e9f66b833337be2c35103ce46ab66b4e44799",
urls = ["https://github.com/tweag/rules_nixpkgs/archive/126e9f66b833337be2c35103ce46ab66b4e44799.tar.gz"],
)
load(
"@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl",
"rules_nixpkgs_dependencies",
)
rules_nixpkgs_dependencies()
http_archive(
name = "bazel_gazelle",
sha256 = "32938bda16e6700063035479063d9d24c60eda8d79fd4739563f50d331cb3209",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz",
],
)
http_archive(
name = "com_google_protobuf",
sha256 = "532294fb03c081e8d856c1a51358fe9d5f750e12bdd09c2d31e8d2253d27005a",
strip_prefix = "protobuf-de5e7b6b8e71cde8e63270fdd937e31a06953cc8",
urls = [
"https://github.com/protocolbuffers/protobuf/archive/de5e7b6b8e71cde8e63270fdd937e31a06953cc8.tar.gz",
],
)
http_archive(
name = "zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff",
strip_prefix = "zlib-1.2.11",
urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"],
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
http_archive(
name = "io_bazel_rules_go",
sha256 = "80a98277ad1311dacd837f9b16db62887702e9f1d1c4c9f796d0121a46c8e184",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip",
],
)
http_archive(
name = "rules_python",
sha256 = "c68bdc4fbec25de5b5493b8819cfc877c4ea299c0dcb15c244c5a00208cde311",
strip_prefix = "rules_python-0.31.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
http_archive(
name = "aspect_rules_ts",
sha256 = "c77f0dfa78c407893806491223c1264c289074feefbf706721743a3556fa7cea",
strip_prefix = "rules_ts-2.2.0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.2.0/rules_ts-v2.2.0.tar.gz",
)
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
rules_ts_dependencies(
# This keeps the TypeScript version in-sync with the editor, which is typically best.
ts_version_from = "//:package.json",
# Alternatively, you could pick a specific version, or use
# load("@aspect_rules_ts//ts:repositories.bzl", "LATEST_TYPESCRIPT_VERSION")
# ts_version = LATEST_TYPESCRIPT_VERSION
)
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
# Fetch and register node, if you haven't already
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
#nodejs_register_toolchains(
# name = "nodejs",
# node_version = DEFAULT_NODE_VERSION,
#)
load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
"nixpkgs_nodejs_configure",
)
nixpkgs_nodejs_configure(
name = "nixpkgs_nodejs_config",
repository = "@nixpkgs",
attribute_path = "nodejs-18_x",
)
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
# Uses the pnpm-lock.yaml file to automate creation of npm_import rules
npm_translate_lock(
# Creates a new repository named "@npm" - you could choose any name you like
name = "npm",
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
# Recommended attribute that also checks the .bazelignore file
verify_node_modules_ignored = "//:.bazelignore",
)
# Following our example above, we named this "npm"
load("@npm//:repositories.bzl", "npm_repositories")
npm_repositories()
http_archive(
name = "aspect_rules_swc",
sha256 = "cde09df7dea773adaed896612434559f8955d2dfb2cfd6429ee333f30299ed34",
strip_prefix = "rules_swc-1.2.2",
url = "https://github.com/aspect-build/rules_swc/releases/download/v1.2.2/rules_swc-v1.2.2.tar.gz",
)
###################
# rules_swc setup #
###################
# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")
rules_swc_dependencies()
load("@aspect_rules_swc//swc:repositories.bzl", "LATEST_SWC_VERSION", "swc_register_toolchains")
swc_register_toolchains(
name = "swc",
swc_version = LATEST_SWC_VERSION,
)
# FOO
load("@//bazel/repo:gazelle.bzl", "setup_gazelle")
load("@//bazel/repo:go.bzl", "setup_go", "go_deps")
load("@//bazel/repo:nixpkgs.bzl", "setup_nixpkgs")
load("@//bazel/repo:python.bzl", "setup_python")
setup_nixpkgs()
# gazelle:repository_macro bazel/repo/go.bzl%go_deps
go_deps()
setup_go()
setup_python()
load("@pip//:requirements.bzl", setup_pip = "install_deps")
setup_pip()
setup_gazelle()