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

Migrate rules_closure to Bzlmod #635

Open
wants to merge 57 commits into
base: master
Choose a base branch
from

Conversation

mollyibot
Copy link
Collaborator

No description provided.

@mollyibot mollyibot closed this Dec 28, 2024
@mollyibot mollyibot reopened this Dec 28, 2024
@mollyibot mollyibot marked this pull request as ready for review December 28, 2024 02:29
@gkdn
Copy link
Collaborator

gkdn commented Jan 7, 2025

Is this ready for review?

@mollyibot
Copy link
Collaborator Author

Is this ready for review?

yes, let us start the review.

@gkdn
Copy link
Collaborator

gkdn commented Jan 7, 2025

Why did you change the name of all BULD files?

.gitignore Show resolved Hide resolved
README.md Show resolved Hide resolved
.bazelversion Outdated Show resolved Hide resolved
MODULE.bazel Outdated Show resolved Hide resolved
closure/extension.bzl Outdated Show resolved Hide resolved
MODULE.bazel Outdated
bazel_dep(
name = "platforms",
version = "0.0.5",
dev_dependency = True,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this only dev_dependency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add more dev_dependency to more deps, but I only do not want platform propagated to rules_closure's dependents

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's go through each to decide which ones are for dev so we can help with the build performance (let's leave this to the end)

MODULE.bazel Outdated Show resolved Hide resolved
MODULE.bazel Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
closure/testing/closure_js_test.bzl Outdated Show resolved Hide resolved
@mollyibot
Copy link
Collaborator Author

Is this ready for review?

Why did you change the name of all BULD files?
lt looks like that BUILD.bazel is preferred over BUILD for cross reference , there are some discussions on
bazelbuild/bazel#4517. also I saw now rules_webtesting begins to use to BUILD.bazel to replace BUILD in https://github.com/bazelbuild/rules_webtesting/pull/478/commits, so I followed that. feel free to reopen the comment if you feel it is not neccessary.

@mollyibot mollyibot closed this Jan 7, 2025
@mollyibot mollyibot reopened this Jan 7, 2025
@mollyibot
Copy link
Collaborator Author

PTAL.

MODULE.bazel Outdated Show resolved Hide resolved
MODULE.bazel Outdated Show resolved Hide resolved
MODULE.bazel Show resolved Hide resolved
MODULE.bazel Outdated Show resolved Hide resolved
maven.override(
coordinates = "javacc:javacc",
target = "@maven//:net_java_dev_javacc_javacc",
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow this one; what is the purpose?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javacc is no longer updated and relocated → net.java.dev.javacc, so when javacc is needed, it should point to net_java_dev_javacc_javacc

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a clatification comment and also double check jscompiler pom to see how it is working for them.

README.md Show resolved Hide resolved
README.md Outdated
],
)
```bzl
bazel_dep(name = "io_bazel_rules_closure", version = "0.15.0")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have this instruction reflect current state that require manual fetching.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you missed this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the version. do you mean removing the version?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think we need to have extra bazel_dep for things that are not released.

closure/stylesheets/test/BUILD Outdated Show resolved Hide resolved
@mollyibot
Copy link
Collaborator Author

PTAL

Copy link
Collaborator

@gkdn gkdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use https://github.com/google/bazel-common and remove manual auto-value / dagger stuff from there like @google_bazel_common//third_party/java/auto:value

README.md Outdated
],
)
```bzl
bazel_dep(name = "io_bazel_rules_closure", version = "0.15.0")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you missed this.

@mollyibot
Copy link
Collaborator Author

I do not see dagger in https://github.com/google/bazel-common ?

@gkdn
Copy link
Collaborator

gkdn commented Jan 16, 2025

I do not see dagger in https://github.com/google/bazel-common ?

I see. I will take a look for an alternative.

@mollyibot
Copy link
Collaborator Author

PTAL (apart from dagger related)

MODULE.bazel Outdated
"com.google.jimfs:jimfs:1.1",
"com.google.truth:truth:1.4.0",
"javax.inject:javax.inject:1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

google3/third_party/bazel_common/third_party/java/jsr330_inject ?

MODULE.bazel Outdated
"org.jsoup:jsoup:1.16.1",
"org.mockito:mockito-core:5.4.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

google3/third_party/bazel_common/third_party/java/mockito

Though we might need to update bazel_common version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I've tried that in my previous version and it broke a test, that is why I revert back using this.

closure/repositories.bzl Outdated Show resolved Hide resolved
README.md Outdated
],
)
```bzl
bazel_dep(name = "io_bazel_rules_closure", version = "0.15.0")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think we need to have extra bazel_dep for things that are not released.

@mollyibot
Copy link
Collaborator Author

PTAL


java_test(
name = "WebfilesTestSuite",
size = "small",
srcs = glob(["*.java"]),
deps = [
":mockito",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to port @google_bazel_common//third_party/java/mockito directly as deps for WebfilesTestSuite, but it gives Unable to make private java.io.PrintStream(boolean,java.io.OutputStream) accessible: module java.base does not "opens java.io" to unnamed module @63b0c6dc

@mollyibot
Copy link
Collaborator Author

Add some comments, PTAL.

@mollyibot
Copy link
Collaborator Author

mollyibot commented Jan 23, 2025

I tried bumping rules_scala using the head from this branch https://github.com/mbland/rules_scala/commits/bzlmod-bazel-8/?before=031fb0d3a63467d87f25397eb8e23faa57d1d3a6+35 (his is the branch the current rules_webtesting is using)and got some errors related to scala deps https://paste.googleplex.com/6526197736144896.

maven.override(
coordinates = "javacc:javacc",
target = "@maven//:net_java_dev_javacc_javacc",
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a clatification comment and also double check jscompiler pom to see how it is working for them.

MODULE.bazel Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
"@javax_inject",
"@google_bazel_common//third_party/java/dagger",
"@google_bazel_common//third_party/java/guava",
"@google_bazel_common//third_party/java/jsr330_inject",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need explicit, maybe exported now?

"@javax_inject",
"@google_bazel_common//third_party/java/guava",
"@google_bazel_common//third_party/java/jsr305_annotations",
"@google_bazel_common//third_party/java/jsr330_inject",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double check if all needed

"@google_bazel_common//third_party/java/dagger",
"@google_bazel_common//third_party/java/guava",
"@google_bazel_common//third_party/java/jsr305_annotations",
"@google_bazel_common//third_party/java/jsr330_inject",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants