Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert most of #237 and #238 #243

Merged
merged 3 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@ matrix:
- ubuntu2004
- macos

.incompatible_flags: &incompatible_flags
? "--config=incompatible"

.noenable_bzlmod_flags: &noenable_bzlmod_flags
? "--noenable_bzlmod"

.incompatible_noenable_bzlmod_flags: &incompatible_noenable_bzlmod_flags
? "--config=incompatible"
? "--noenable_bzlmod"

.windows_flags: &windows_flags
# Workaround for https://github.com/bazelbuild/continuous-integration/issues/1012
? "--noexperimental_repository_cache_hardlinks"
Expand All @@ -25,11 +18,6 @@ matrix:
test_targets:
- "//..."

.incompatible_task_config: &incompatible_task_config
<<: *common_task_config
build_flags: *incompatible_flags
test_flags: *incompatible_flags

.noenable_bzlmod_task_config: &noenable_bzlmod_task_config
build_flags: *noenable_bzlmod_flags
build_targets:
Expand All @@ -46,11 +34,6 @@ matrix:
- "//test:table_of_contents_noenable_bzlmod_test"
- "//test:local_repository_test"

.incompatible_noenable_bzlmod_task_config: &incompatible_noenable_bzlmod_task_config
<<: *noenable_bzlmod_task_config
build_flags: *incompatible_noenable_bzlmod_flags
test_flags: *incompatible_noenable_bzlmod_flags

.windows_task_config: &windows_task_config
<<: *common_task_config
build_flags: *windows_flags
Expand All @@ -62,11 +45,6 @@ tasks:
name: Build and test
platform: ${{ platform }}

build_and_test_incompatible:
<<: *incompatible_task_config
name: Build and test - incompatible flags
platform: ${{ platform }}

build_and_test_windows:
<<: *windows_task_config
name: Build and test - Windows
Expand All @@ -77,11 +55,6 @@ tasks:
name: Build and test - legacy WORKSPACE setup
platform: ${{ platform }}

incompatible_noenable_bzlmod:
<<: *incompatible_noenable_bzlmod_task_config
name: Build and test - legacy WORKSPACE setup with incompatible flags
platform: ${{ platform }}

build_and_test_last_green:
<<: *common_task_config
name: Build and test - Bazel last green
Expand All @@ -100,12 +73,6 @@ tasks:
platform: ${{ platform }}
working_directory: test/bzlmod

bzlmod_usage_incompatible:
<<: *incompatible_task_config
name: Stardoc Bzlmod module usage test - incompatible flags
platform: ${{ platform }}
working_directory: test/bzlmod

bzlmod_usage_windows:
<<: *windows_task_config
name: Stardoc Bzlmod module usage test - Windows
Expand Down
3 changes: 0 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ build --tool_java_language_version=11
# Incompatible flags which we always want in development
build --incompatible_disable_starlark_host_transitions
build --incompatible_disallow_empty_glob

# Incompatible flags to test in a dedicated CI pipeline.
build:incompatible --incompatible_enable_proto_toolchain_resolution
5 changes: 0 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "rules_java", version = "7.6.1")
bazel_dep(name = "rules_jvm_external", version = "6.1")
bazel_dep(name = "rules_license", version = "0.0.7")
bazel_dep(name = "rules_proto", version = "6.0.2")
bazel_dep(name = "toolchains_protoc", version = "0.3.1")

# Maven artifacts required by Stardoc; keep consistent with deps.bzl
STARDOC_MAVEN_ARTIFACTS = [
Expand All @@ -19,7 +17,6 @@ STARDOC_MAVEN_ARTIFACTS = [
"com.google.guava:guava:31.1-jre",
"com.google.truth:truth:1.1.3",
"junit:junit:4.13.2",
"com.google.protobuf:protobuf-java:4.27.1",
]

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
Expand All @@ -39,5 +36,3 @@ use_repo(maven, "stardoc_maven")
#
# Dev-only and test-only dependencies
bazel_dep(name = "rules_pkg", version = "0.10.1", dev_dependency = True)

register_toolchains("//toolchains:all")
39 changes: 9 additions & 30 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,15 @@ load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")

rules_pkg_dependencies()

# Needed as a transitive dependency of @io_bazel
http_archive(
name = "rules_proto",
sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295",
strip_prefix = "rules_proto-6.0.2",
url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz",
# Needed only for testing stardoc across local-repository bounds.
local_repository(
name = "stardoc", # alias the Bzlmod name of the Stardoc repo for local_repository_test
path = ".",
)

local_repository(
name = "local_repository_test",
path = "test/testdata/local_repository_test",
)

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")
Expand All @@ -86,27 +89,3 @@ rules_proto_setup()
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")

rules_proto_toolchains()

load("@bazel_features//:deps.bzl", "bazel_features_deps")

bazel_features_deps()

load("@toolchains_protoc//protoc:toolchain.bzl", "protoc_toolchains")

protoc_toolchains(
name = "protoc_toolchains",
version = "v27.1",
)

# Needed only for testing stardoc across local-repository bounds.
local_repository(
name = "stardoc", # alias the Bzlmod name of the Stardoc repo for local_repository_test
path = ".",
)

local_repository(
name = "local_repository_test",
path = "test/testdata/local_repository_test",
)

register_toolchains("//toolchains:all")
12 changes: 9 additions & 3 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")
load("@rules_proto//proto:setup.bzl", "rules_proto_setup")

# Maven artifacts required by Stardoc; keep consistent with MODULE.bazel
STARDOC_MAVEN_ARTIFACTS = [
Expand All @@ -24,7 +26,6 @@ STARDOC_MAVEN_ARTIFACTS = [
"com.google.guava:guava:31.1-jre",
"com.google.truth:truth:1.1.3",
"junit:junit:4.13.2",
"com.google.protobuf:protobuf-java:4.27.1",
]

def stardoc_external_deps():
Expand All @@ -41,8 +42,6 @@ def stardoc_external_deps():
stardoc_pinned_maven_install()
```
"""
protobuf_deps()

maven_install(
name = "stardoc_maven",
artifacts = STARDOC_MAVEN_ARTIFACTS,
Expand All @@ -53,3 +52,10 @@ def stardoc_external_deps():
],
strict_visibility = True,
)

protobuf_deps()

rules_proto_dependencies()

# Note rules_proto_setup() requires @bazel_features - we define it in stardoc_repositories()
rules_proto_setup()
16 changes: 3 additions & 13 deletions maven_install.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
"__INPUT_ARTIFACTS_HASH": 1794655755,
"__RESOLVED_ARTIFACTS_HASH": 2130017368,
"__INPUT_ARTIFACTS_HASH": -1307151106,
"__RESOLVED_ARTIFACTS_HASH": 1764595048,
"artifacts": {
"com.beust:jcommander": {
"shasums": {
Expand Down Expand Up @@ -57,12 +57,6 @@
},
"version": "1.3"
},
"com.google.protobuf:protobuf-java": {
"shasums": {
"jar": "798c79f6c9fc6859cc76aa5474228aad250821438e1004dad34880d53aa745f9"
},
"version": "4.27.1"
},
"com.google.truth:truth": {
"shasums": {
"jar": "fc0b67782289a2aabfddfdf99eff1dcd5edc890d49143fcd489214b107b8f4f3"
Expand Down Expand Up @@ -172,10 +166,6 @@
"com.google.j2objc:j2objc-annotations": [
"com.google.j2objc.annotations"
],
"com.google.protobuf:protobuf-java": [
"com.google.protobuf",
"com.google.protobuf.compiler"
],
"com.google.truth:truth": [
"com.google.common.truth"
],
Expand Down Expand Up @@ -265,13 +255,13 @@
"com.google.guava:guava",
"com.google.guava:listenablefuture",
"com.google.j2objc:j2objc-annotations",
"com.google.protobuf:protobuf-java",
"com.google.truth:truth",
"junit:junit",
"org.checkerframework:checker-qual",
"org.hamcrest:hamcrest-core",
"org.ow2.asm:asm"
]
},
"services": {},
"version": "2"
}
19 changes: 11 additions & 8 deletions setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ def stardoc_repositories():
sha256 = "4531deccb913639c30e5c7512a054d5d875698daeb75d8cf90f284375fe7c360",
)

maybe(
http_archive,
name = "toolchains_protoc",
sha256 = "3898f8e621ca5b3c7b94300c5ae19075d5bb28349d6e6f407490a466ba1e2544",
strip_prefix = "toolchains_protoc-0.3.1",
url = "https://github.com/aspect-build/toolchains_protoc/releases/download/v0.3.1/toolchains_protoc-v0.3.1.tar.gz",
)

# Transitive dep of com_google_protobuf. Unfortunately, protobuf_deps()
# pulls in a dep that's too old.
maybe(
Expand All @@ -88,6 +80,17 @@ def stardoc_repositories():
url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz",
)

# Transitive dep of rules_proto. Pull in explicitly to allow calling both
# rules_proto_dependencies() and rules_proto_setup() in stardoc_external_deps() without forcing
# users to add yet another intermediate load() in their WORKSPACE files.
maybe(
http_archive,
name = "bazel_features",
sha256 = "0f23d75c7623d6dba1fd30513a94860447de87c8824570521fcc966eda3151c2",
strip_prefix = "bazel_features-1.4.1",
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.4.1/bazel_features-v1.4.1.tar.gz",
)

# Transitive dep of com_google_protobuf. Unfortunately, protobuf_deps()
# pulls in a dep that's too old.
maybe(
Expand Down
2 changes: 0 additions & 2 deletions test/bzlmod/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ build --tool_java_language_version=11
build --incompatible_disable_starlark_host_transitions
build --incompatible_disallow_empty_glob

# Incompatible flags to test in a dedicated CI pipeline.
build:incompatible --incompatible_enable_proto_toolchain_resolution
12 changes: 0 additions & 12 deletions toolchains/BUILD.bazel

This file was deleted.