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

Fix workspace resolution for development #1231

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
8 changes: 4 additions & 4 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ matrix:
# - windows re-enable when rules_bazel_integration_test can support custom test runner on windows.
test_flags:
- ["--enable_bzlmod=true"]
- ["--enable_bzlmod=false"]
- ["--enable_bzlmod=false", "--enable_workspace=true"]
validate_config: 1
bazel: 7.1.1
bazel: 7.3.0
buildifier:
version: 7.1.1
# no lint warnings for the moment. They are basically a smoke alarm in hell.
Expand All @@ -25,9 +25,9 @@ tasks:
build_flags: ${{ test_flags }}
test_flags: ${{ test_flags }}
test_targets:
- "//:all_tests"
- "//src/..."
build_targets:
- "//:rules_kotlin_release"
- "//src/..."
integration_tests:
name: "Integration Tests"
platform: ${{ integration_platform }}
Expand Down
1 change: 1 addition & 0 deletions src/main/starlark/core/plugin/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ KtCompilerPluginInfo = provider(
"options": "List of plugin options, represented as KtCompilerPluginOption, to be passed to the compiler",
"resolve_cfg": "A Callable[[KtCompilerPluginInfo, Dict[str,str], List[Target], KtPluginConfiguration]" +
" that resolves an associated plugin configuration.",
"required_plugins": "Depset of plugins that must be executed before this plugin.",
},
)

Expand Down
6 changes: 3 additions & 3 deletions src/main/starlark/core/repositories/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bzl_library(
name = "repositories",
srcs = glob(["*.bzl"]),
visibility = ["//:__subpackages__"],
deps = [
"@rules_proto//proto:defs",
],
# deps = [
# "@rules_proto//proto:defs",
# ],
)
33 changes: 32 additions & 1 deletion src/main/starlark/core/repositories/download.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def kt_download_local_dev_dependencies():
Must be called before setup_dependencies in the versions.WORKSPACE.
"""

# bazel_skylib is initialized twice during developement. This is intentional, as development
# bazel_skylib is initialized twice during development. This is intentional, as development
# needs to be able to run the starlark unittests, while production does not.
maybe(
http_archive,
Expand Down Expand Up @@ -51,6 +51,18 @@ def kt_download_local_dev_dependencies():
urls = versions.RBE.URLS,
)

versions.use_repository(
name = "rules_python",
rule = http_archive,
version = versions.RULES_PYTHON,
)

versions.use_repository(
name = "rules_java",
rule = http_archive,
version = versions.RULES_JAVA,
)

maybe(
http_archive,
name = "rules_jvm_external",
Expand Down Expand Up @@ -97,6 +109,25 @@ def kt_download_local_dev_dependencies():
],
)

versions.use_repository(
name = "rules_testing",
rule = http_archive,
version = versions.RULES_TESTING,
strip_prefix = "rules_testing-%s" % versions.RULES_TESTING.version,
)

versions.use_repository(
name = "rules_bazel_integration_test",
rule = http_archive,
version = versions.RULES_BAZEL_INTEGRATION_TEST,
)

versions.use_repository(
name = "cgrindel_bazel_starlib",
rule = http_archive,
version = versions.CGRINDEL_BAZEL_STARLIB,
)

versions.use_repository(
name = "released_rules_kotlin",
rule = http_archive,
Expand Down
6 changes: 0 additions & 6 deletions src/main/starlark/core/repositories/initialize.release.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ def kotlin_repositories(
urls = versions.ANDROID.URLS,
)

versions.use_repository(
name = "rules_python",
rule = http_archive,
version = versions.RULES_PYTHON,
)

versions.use_repository(
name = "rules_java",
rule = http_archive,
Expand Down
13 changes: 10 additions & 3 deletions src/main/starlark/core/repositories/setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# limitations under the License.

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
load("@cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies")
load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")
load("@released_rules_kotlin//src/main/starlark/core/repositories:initialize.bzl", release_kotlin_repositories = "kotlin_repositories")
load("@rules_bazel_integration_test//bazel_integration_test:deps.bzl", "bazel_integration_test_rules_dependencies")
load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
Expand All @@ -39,10 +41,12 @@ def kt_configure():
"com.google.protobuf:protobuf-java-util:3.6.0",
"com.google.guava:guava:27.1-jre",
"com.google.truth:truth:0.45",
"com.google.auto.service:auto-service:1.0.1",
"com.google.auto.service:auto-service-annotations:1.0.1",
"com.google.auto.service:auto-service:1.1.1",
"com.google.auto.service:auto-service-annotations:1.1.1",
"com.google.auto.service:auto-service-annotations:jar:1.1.1",
"com.google.auto.value:auto-value:1.10.1",
"com.google.auto.value:auto-value-annotations:1.10.1",
"org.apache.commons:commons-compress:1.26.2",
"com.google.dagger:dagger:2.51",
"com.google.dagger:dagger-compiler:2.51",
"com.google.dagger:dagger-producers:2.51",
Expand All @@ -55,7 +59,6 @@ def kt_configure():
"com.squareup.moshi:moshi:1.15.0",
"com.squareup.moshi:moshi-kotlin:1.15.0",
"com.squareup.moshi:moshi-kotlin-codegen:1.15.0",
"com.google.auto.service:auto-service-annotations:jar:1.1.1",
],
repositories = [
"https://maven-central.storage.googleapis.com/repos/central/data/",
Expand All @@ -72,3 +75,7 @@ def kt_configure():
stardoc_repositories()

bazel_skylib_workspace()

bazel_integration_test_rules_dependencies()
bazel_starlib_dependencies()
bazel_skylib_workspace()
22 changes: 18 additions & 4 deletions src/main/starlark/core/repositories/versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ versions = struct(
URLS = ["https://storage.googleapis.com/rbe-toolchain/bazel-configs/rbe-ubuntu1604/latest/rbe_default.tar"],
),
PKG = version(
version = "0.7.0",
version = "1.0.1",
url_templates = [
"https://github.com/bazelbuild/rules_pkg/releases/download/{version}/rules_pkg-{version}.tar.gz",
],
sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2",
sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef",
),
# needed for rules_pkg and java
RULES_KOTLIN = version(
Expand Down Expand Up @@ -126,11 +126,11 @@ versions = struct(
sha256 = None,
),
RULES_TESTING = version(
version = "0.5.0",
version = "0.6.0",
url_templates = [
"https://github.com/bazelbuild/rules_testing/releases/download/v{version}/rules_testing-v{version}.tar.gz",
],
sha256 = "b84ed8546f1969d700ead4546de9f7637e0f058d835e47e865dcbb13c4210aed",
sha256 = "02c62574631876a4e3b02a1820cb51167bb9cdcdea2381b2fa9d9b8b11c407c4",
),
KOTLINX_SERIALIZATION_CORE_JVM = version(
version = "1.6.3",
Expand All @@ -153,5 +153,19 @@ versions = struct(
],
sha256 = "d3234179bcff1886d53d67c11eca47f7f3cf7b63c349d16965f6db51b7f3dd9a",
),
RULES_BAZEL_INTEGRATION_TEST = version(
version = "0.26.0",
url_templates = [
"https://github.com/bazel-contrib/rules_bazel_integration_test/releases/download/v{version}/rules_bazel_integration_test.v{version}.tar.gz",
],
sha256 = "ab56cdd55a28781287242c7124ce9ff791ae8318ed641057f10edd98c55d7ed5",
),
CGRINDEL_BAZEL_STARLIB = version(
version = "0.21.0",
sha256 = "43e375213dabe0c3928e65412ea7ec16850db93285c8c6f8b0eaa41cacd0f882",
url_templates = [
"https://github.com/cgrindel/bazel-starlib/releases/download/v{version}/bazel-starlib.v{version}.tar.gz",
],
),
use_repository = _use_repository,
)