diff --git a/.aspect/workflows/README.md b/.aspect/workflows/README.md deleted file mode 100644 index ac2d6d68e..000000000 --- a/.aspect/workflows/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# Aspect Workflows demonstration deployment - -This deployment of [Aspect Workflows](https://www.aspect.build/workflows) is configured to run on Buildkite. - -You can see this Aspect Workflows demonstration deployment live at -https://buildkite.com/aspect/rules-js. - -The two components of the configuration for this repository are, - -1. Aspect Workflows configuration yaml -1. Buildkite pipeline configuration (in the Buildkite UI) - -## Aspect Workflows configuration yaml - -This is the [config.yaml](./config.yaml) file in this directory. - -## Buildkite pipeline configuration (in the Buildkite UI) - -There are two pipelines configured on Buildkite. - -1. Main build & test pipeline: https://buildkite.com/aspect/rules-js -2. Scheduled warming pipeline: https://buildkite.com/aspect/rules-js-warming - -### Main build & test pipeline configuration - -The main build & test pipeline found at https://buildkite.com/aspect/rules-js is configured -with the following yaml steps: - -``` -steps: - - label: ":aspect: Setup Aspect Workflows" - commands: - - "rosetta steps | buildkite-agent pipeline upload" - agents: - queue: aspect-small -``` - -> [!IMPORTANT] -> The Setup Aspect Workflows step above is configured to run on the `aspect-small` queue that is serviced by a runner group made up of lightweight and inexpensive `e2.small` GCP VM instances. - -### Scheduled warming pipeline configuration - -The scheduled warming pipeline found at https://buildkite.com/aspect/rules-js-warming is -configured with the following yaml steps: - -``` -env: - ASPECT_WORKFLOWS_BIN_DIR: /etc/aspect/workflows/bin -steps: - - label: ":fire: Create warming archives" - commands: | - echo "--- :aspect-build: Configure environment" - ${ASPECT_WORKFLOWS_BIN_DIR}/configure_workflows_env - echo "--- :stethoscope: Agent health checks" - ${ASPECT_WORKFLOWS_BIN_DIR}/agent_health_check - echo "--- :bazel: Create warming archive" - rosetta run warming - ${ASPECT_WORKFLOWS_BIN_DIR}/warming_archive - agents: - queue: aspect-warming -``` - -The warming pipeline is not configured to trigger on commits or PRs. Instead, a scheduled is -configured for this pipeline with the cron interval `0 1 * * * America/Vancouver` so that it -runs periodically to create up-to-date warming archives that caches repository rules so that the -"default" build & test runners don't have to re-fetch them on their first build. diff --git a/.aspect/workflows/bazelrc b/.aspect/workflows/bazelrc index 925c86e25..33fb1ce49 100644 --- a/.aspect/workflows/bazelrc +++ b/.aspect/workflows/bazelrc @@ -2,14 +2,10 @@ common --remote_download_outputs=minimal common --nobuild_runfile_links -# generate build_event_log binary build event profile file -common --build_event_binary_file=build_event_log.bin -common --build_event_binary_file_path_conversion=false -common --build_event_publish_all_actions=true - -common:rbe --extra_execution_platforms=@aspect_bazel_lib//platforms:x86_64_linux_remote -common:rbe --host_platform=@aspect_bazel_lib//platforms:x86_64_linux_remote +# remote execution +common:rbe --extra_execution_platforms=//bazel/platforms:x86_64_linux_remote +common:rbe --host_platform=//bazel/platforms:x86_64_linux_remote common:rbe --remote_executor=unix:///mnt/ephemeral/buildbarn/.cache/bb_clientd/grpc common:rbe --genrule_strategy=remote,local common:rbe --jobs=32 -common:rbe --remote_timeout=3600 \ No newline at end of file +common:rbe --remote_timeout=3600 diff --git a/.aspect/workflows/config.yaml b/.aspect/workflows/config.yaml index ff660b727..230c3cb79 100644 --- a/.aspect/workflows/config.yaml +++ b/.aspect/workflows/config.yaml @@ -1,45 +1,28 @@ ---- +# See https://docs.aspect.build/workflows/configuration workspaces: .: icon: js label: rules_js tasks: - test: - bazel: - flags: - - --config=rbe e2e/bzlmod: icon: bazel tasks: - test: - queue: aspect-default - bazel: - flags: - - --config=rbe + queue: aspect-medium - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/gyp_no_install_script: icon: npm tasks: - test: queue: aspect-medium - bazel: - flags: - - --config=rbe - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true # rules_docker not compatible with Bazel 7. # See https://github.com/bazelbuild/bazel/issues/20494#issuecomment-1852401451. # e2e/js_image_docker: @@ -47,18 +30,11 @@ workspaces: icon: linux tasks: - test: - queue: aspect-default - bazel: - flags: - - --config=rbe + queue: aspect-medium - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true # No test targets. Requires running test.sh. # e2e/js_run_devserver: e2e/npm_link_package: @@ -70,10 +46,6 @@ workspaces: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/npm_link_package-esm: icon: npm tasks: @@ -83,58 +55,33 @@ workspaces: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/npm_translate_lock: icon: npm tasks: - test: queue: aspect-medium - bazel: - flags: - - --config=rbe - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/npm_translate_lock_replace_packages: icon: npm tasks: - test: queue: aspect-medium - bazel: - flags: - - --config=rbe - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/npm_translate_lock_empty: icon: npm tasks: - test: queue: aspect-medium - bazel: - flags: - - --config=rbe - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/npm_translate_lock_multi: icon: npm tasks: @@ -144,10 +91,6 @@ workspaces: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/npm_translate_lock_partial_clone: icon: npm tasks: @@ -157,10 +100,6 @@ workspaces: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/npm_translate_lock_subdir_patch: icon: npm tasks: @@ -170,10 +109,6 @@ workspaces: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true # Requires an auth token # e2e/npm_translate_lock_auth: # Requires an SSH token @@ -187,10 +122,6 @@ workspaces: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/npm_translate_yarn_lock: icon: yarn tasks: @@ -200,10 +131,6 @@ workspaces: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/package_json_module: icon: npm tasks: @@ -213,106 +140,60 @@ workspaces: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/pnpm_lockfiles: icon: pnpm tasks: - test: queue: aspect-medium - bazel: - flags: - - --config=rbe - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/pnpm_workspace: icon: pnpm tasks: - test: queue: aspect-medium - bazel: - flags: - - --config=rbe - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/pnpm_workspace_rerooted: icon: pnpm tasks: - test: queue: aspect-medium - bazel: - flags: - - --config=rbe - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/repo_mapping: icon: js tasks: - test: queue: aspect-medium - bazel: - flags: - - --config=rbe - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/runfiles: icon: js tasks: - test: queue: aspect-medium - bazel: - flags: - - --config=rbe - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/rules_foo: icon: js tasks: - test: queue: aspect-medium - bazel: - flags: - - --config=rbe - format: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true e2e/vendored_node: icon: js tasks: @@ -322,10 +203,6 @@ workspaces: without: true - buildifier: without: true - - configure: - without: true - - delivery: - without: true # No test targets. Requires running test.sh. # e2e/webpack_devserver: # e2e/webpack_devserver_esm: @@ -333,36 +210,10 @@ tasks: - checkout: update_strategy: rebase - test: - hooks: - - type: before_task - command: vmstat -a -S M -t 1 2>&1 > vmstat.out & - - type: after_task - command: cat vmstat.out - artifact_paths: - - vmstat.out - - build_event_log.bin - format: queue: aspect-medium - buildifier: queue: aspect-medium - - configure: - queue: aspect-medium - - delivery: - auto_deliver: true - stamp_flags: - - --stamp - - --workspace_status_command="${PWD}/workspace_status.sh" - rules: - - deliverable: 'attr("tags", "\bdeliverable\b", //...)' - condition: - branches: - - main - - deliverable: - - //docs:docs_delivery - condition: - only_on_change: false - branches: - - main - finalization: queue: aspect-small notifications: diff --git a/.github/workflows/new_issue.yaml b/.github/workflows/new_issue.yaml deleted file mode 100644 index 70ffa26cc..000000000 --- a/.github/workflows/new_issue.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: New issue -on: - issues: - types: - - opened - - reopened -jobs: - new_issue: - runs-on: ubuntu-latest - permissions: - issues: write - steps: - # https://docs.github.com/en/actions/managing-issues-and-pull-requests/adding-labels-to-issues - - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ["untriaged"] - }) - # https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects#adding-an-item-to-a-project - - run: | - gh api graphql -f query="mutation { addProjectV2ItemById(input: {projectId: \"$PROJECT_ID\" contentId: \"$CONTENT_ID\"}) { item { id } } }" - env: - GITHUB_TOKEN: ${{ secrets.GH_PROJECTS_RW_TOKEN }} - OWNER: ${{ github.repository_owner }} - REPO: ${{ github.event.repository.name }} - CONTENT_ID: ${{ github.event.issue.node_id }} - PROJECT_ID: PVT_kwDOA6IKMs4ALj2o # Aspect OSS Bazel Rules diff --git a/BUILD.bazel b/BUILD.bazel index 8193c87d7..a2ca98429 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,6 +1,5 @@ load("@acorn__8.4.0__links//:defs.bzl", npm_link_acorn = "npm_link_imported_package") load("@aspect_bazel_lib//lib:diff_test.bzl", "diff_test") -load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary") load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@buildifier_prebuilt//:rules.bzl", "buildifier") load("@npm//:defs.bzl", "npm_link_all_packages", "npm_link_targets") @@ -83,16 +82,6 @@ npm_link_package( src = "//examples/npm_package/packages/pkg_c:pkg_c2", ) -gazelle_binary( - name = "gazelle_bin", - languages = ["@bazel_skylib_gazelle_plugin//bzl"], -) - -gazelle( - name = "gazelle", - gazelle = "gazelle_bin", -) - buildifier( name = "buildifier", exclude_patterns = [ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ddc76789..48f4a63b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,12 +18,6 @@ pre-commit install Otherwise later tooling on CI will yell at you about formatting/linting violations. -## Updating BUILD files - -Some targets are generated from sources. -Currently this is just the `bzl_library` targets. -Run `bazel run //:gazelle` to keep them up-to-date. - ## Using this as a development dependency of other rules You'll commonly find that you develop in another WORKSPACE, such as diff --git a/MODULE.bazel b/MODULE.bazel index 663dfd746..4318201b3 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -47,9 +47,7 @@ use_repo(bazel_lib_toolchains, "bsd_tar_toolchains") ####### Dev dependencies ######## bazel_dep(name = "aspect_rules_lint", version = "1.0.2", dev_dependency = True) -bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.7.1", dev_dependency = True) bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True) -bazel_dep(name = "gazelle", version = "0.39.1", dev_dependency = True, repo_name = "bazel_gazelle") bazel_dep(name = "rules_go", version = "0.50.1", dev_dependency = True) bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc") diff --git a/WORKSPACE b/WORKSPACE index 1cbcb09d9..fade153c2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -43,18 +43,6 @@ load("@aspect_bazel_lib//lib:host_repo.bzl", "host_repo") host_repo(name = "aspect_bazel_lib_host") -############################################ -# Gazelle, for generating bzl_library targets - -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") -load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") - -go_rules_dependencies() - -go_register_toolchains(version = "1.20.5") - -gazelle_dependencies() - ############################################ # Example npm dependencies diff --git a/bazel/platforms/BUILD.bazel b/bazel/platforms/BUILD.bazel new file mode 100644 index 000000000..df58fbd90 --- /dev/null +++ b/bazel/platforms/BUILD.bazel @@ -0,0 +1,12 @@ +platform( + name = "x86_64_linux_remote", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:x86_64", + ], + exec_properties = { + "OSFamily": "Linux", + "container-image": "docker://ghcr.io/catthehacker/ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448", + }, + visibility = ["//visibility:public"], +) diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index f45f037be..605f41d75 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -114,28 +114,3 @@ update_docs( "skip-on-rbe", ], ) - -# Demonstration delivery target for Aspect Workflows. -# In the future this could be wired up to push to a demonstration S3 bucket. -sh_binary( - name = "docs_delivery_only_on_change", - srcs = ["delivery.sh"], - data = glob(["*.md"]), - tags = [ - "deliverable", - "skip-on-bazel6", - "skip-on-rbe", - ], -) - -# Demonstration delivery target for Aspect Workflows. -# In the future this could be wired up to push to a demonstration S3 bucket. -sh_binary( - name = "docs_delivery", - srcs = ["delivery.sh"], - data = glob(["*.md"]), - tags = [ - "skip-on-bazel6", - "skip-on-rbe", - ], -) diff --git a/docs/delivery.sh b/docs/delivery.sh deleted file mode 100755 index b88f661e2..000000000 --- a/docs/delivery.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -o nounset -o pipefail - -echo "Demostration delivery target" diff --git a/e2e/js_image_docker/WORKSPACE b/e2e/js_image_docker/WORKSPACE index e222ae805..cce125234 100644 --- a/e2e/js_image_docker/WORKSPACE +++ b/e2e/js_image_docker/WORKSPACE @@ -47,20 +47,6 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip"], ) -# Bring in a newer version of bazel_gazelle to work-around an incompatability with an older -# version that is brought in transitively below that is incompatible with newer versions of rules_go. -# Error when this is not done is: -# ERROR: Traceback (most recent call last): -# File "/private/var/tmp/_bazel_greg/970c650b0c043c16acaced625553237d/external/bazel_gazelle/internal/go_repository_tools.bzl", line 15, column 52, in -# load("@io_bazel_rules_go//go/private:common.bzl", "env_execute", "executable_extension") -# Error: file '@io_bazel_rules_go//go/private:common.bzl' does not contain symbol 'env_execute' -# ERROR: Error computing the main repository mapping: at /private/var/tmp/_bazel_greg/970c650b0c043c16acaced625553237d/external/io_bazel_rules_docker/repositories/deps.bzl:22:6: at /private/var/tmp/_bazel_greg/970c650b0c043c16acaced625553237d/external/io_bazel_rules_docker/repositories/go_repositories.bzl:22:6: at /private/var/tmp/_bazel_greg/970c650b0c043c16acaced625553237d/external/bazel_gazelle/deps.bzl:24:5: initialization of module 'internal/go_repository_tools.bzl' failed -http_archive( - name = "bazel_gazelle", - integrity = "sha256-dd8ojEsxyB61D1Hi4U9HY8t1SNquEmgXJHBkY3/Z6mI=", - urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz"], -) - load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() diff --git a/e2e/pnpm_lockfiles/BUILD.bazel b/e2e/pnpm_lockfiles/BUILD.bazel index c539f89b2..ab4dc12ad 100644 --- a/e2e/pnpm_lockfiles/BUILD.bazel +++ b/e2e/pnpm_lockfiles/BUILD.bazel @@ -1,5 +1,3 @@ -# gazelle:exclude **/snapshots/**/* - exports_files([ "base/patched-dependencies-test.js", "base/aliases-test.js", diff --git a/js/private/dev_deps.bzl b/js/private/dev_deps.bzl index aadf4952f..019ba037d 100644 --- a/js/private/dev_deps.bzl +++ b/js/private/dev_deps.bzl @@ -9,30 +9,12 @@ load("//js/private:maybe.bzl", http_archive = "maybe_http_archive") def rules_js_dev_dependencies(): "Fetch repositories used for developing the rules" - http_archive( - name = "io_bazel_rules_go", - sha256 = "f4a9314518ca6acfa16cc4ab43b0b8ce1e4ea64b81c38d8a3772883f153346b8", - urls = ["https://github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip"], - ) - - http_archive( - name = "bazel_gazelle", - integrity = "sha256-dd8ojEsxyB61D1Hi4U9HY8t1SNquEmgXJHBkY3/Z6mI=", - urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz"], - ) - http_archive( name = "bazel_skylib", sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz"], ) - http_archive( - name = "bazel_skylib_gazelle_plugin", - sha256 = "e0629e3cbacca15e2c659833b24b86174d22b664ca0a67f377108ff6a207cc8c", - urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-gazelle-plugin-1.7.1.tar.gz"], - ) - http_archive( name = "io_bazel_stardoc", sha256 = "62bd2e60216b7a6fec3ac79341aa201e0956477e7c8f6ccc286f279ad1d96432", diff --git a/npm/private/test/BUILD.bazel b/npm/private/test/BUILD.bazel index e74287b7d..f6a91f16f 100644 --- a/npm/private/test/BUILD.bazel +++ b/npm/private/test/BUILD.bazel @@ -10,8 +10,6 @@ load(":transitive_closure_tests.bzl", "transitive_closure_tests") load(":translate_lock_helpers_tests.bzl", "translate_lock_helpers_tests") load(":utils_tests.bzl", "utils_tests") -# gazelle:exclude **/snapshots/**/* - npm_link_all_packages(name = "node_modules") # Unit tests