-
Notifications
You must be signed in to change notification settings - Fork 206
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
Issue using rules_kotlin as local_repository #570
Comments
the 2nd issue seems to be due to the "version" provider not being exported. |
Apologies, did a bit of moving the deck chairs. #571 should fix it, though the requirements for working from head have changed. This was due to |
@restingbull i just tried out the latest changes with #547 and am still getting strange errors like:
despite never defining io_bazel_rules_kotlin_head anywhere. I followed the latest instructions on the readme and ran bazel build //:rules_kotlin_release local_repository(
name = "release_archive",
path = "../rules_kotlin/src/main/starlark/release_archive",
)
load("@release_archive//:repository.bzl", "archive_repository")
archive_repository(
name = "io_bazel_rules_kotlin",
)
...
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories", "kotlinc_version")
kotlin_repositories(
compiler_release = kotlinc_version(
release = "1.5.20", # just the numeric version
sha256 = "edf34263ddaabd48f7ec59661e4c0d1dc868462fd3a1ea323083d0e3e83a8a8b"
)
)
register_toolchains("//tools/kotlin:kotlin_toolchain") edit: tried not specifying custom toolchain or compiler distribution and same error occurs. |
Uh, it does really take some cunning but still the sequence i did doesn't seem to even try to execute a repository rule needed to build the rules.
Then define a release archive with bzl:
and in WORKSPACE:
Leads to no error except banal "couldn't fetch, uh, IOException, go away" stuff:
Maybe I'm just missing something obvious?
(Yes, I removed "kt_download_local_dependencies" and built its dependencies into repository and it worked until now) |
I believe I made a bit of a mistake in setting the local-from-head -- Since the I'm testing a fix that should handle that (track the Means while, try deleting (yes, I just recommended modifying files in |
Try pulling #577 to see if it works. |
@restingbull with no modifications (ie deleting stuff from bazel-*) #577 is reporting the same error
I tried deleting bazel-bin/external/**/* and that didnt help (there was a few different dirs starting with "release_archive" but none of those worked either) @restingbull |
Any updates here? |
Getting exact same error too, even after
|
I'm an idiot, and I apologize for this one. I've been snowed under a new annual planning process, so the rules have suffered. I'll make it cleaner momentarily, but here is the workaround:
|
thanks @restingbull for fixing! Did the trick. |
@restingbull ok, that seem to work.. any way to force these building with http_archive instead of local_repository as a source? We are using latest stuff from the rules and hence have to build from source, we are using sanboxing as well and very prefer to not include some stray repository as a local_repository. |
@Nikolas-LFDesigns -- the rules really aren't prod quality at head. Being able to build them that way is intended for active development on the rules... Which isn't particularly hermetic. That said, what is the usecase ya'll need that prevents working off the latest release? |
There were many updates that were not released, like plugin support, important bug fixes, kt_android_local_test, worker support and so on which we constantly use and have to be sure that support is continuous, nevermind the current release. |
Well, the simplest solution, while I try to figure out how to balance the release archive (necessary for multiversion builds) with the correct repository layout (the reason the label is weird -- archive is meant to be an independent repo), would be to do this
|
@restingbull
Sounds like rules_pkg is part of the Bazel and should be provided to any workspace, but it's not. Adding it to my WORKSPACE explicitly doesn't work either (possibly because it should be present on archive WORKSPACE). Sounds like we'll have to fork and custom-release a project in the event of some useful change being added to the master on current assembly system.. |
Yeah I have resorted to just uploading release tars to my fork instead of trying to consume the rules locally. It makes the test-debug lifecycle significantly longer but it may take time to sort this out |
I also have it on my list to arrange a nightly (if different) release. Just have to figure out how to make that work with buildkite. That should at least shorten the cycle. |
@cgruber not sure if youve considered a release per-commit? Might be easier to configure if thats the issue with buildkite. Kotlin seems to do something similar based on the number of releases in their repo |
Per-commit or per-nightly - regardless I'll need to get a pipeline executing. The main issue is that we're using bazelbuild's custom org config of buildKite, and I'm not authorized to admin that, so it's a bit trickier. Nevertheless, let's shelve this because it's orthogonal to this issue. |
Finally got a minute and sorted out the build from master -- #612 Of special note: Which is why building from head wouldn't work when downloaded. This is the way to make it work after #612 is merged. # Download master or specific revisions
http_archive(
name = "io_bazel_rules_kotlin_master",
urls = [ "https://github.com/bazelbuild/rules_kotlin/archive/refs/heads/master.zip", ],
strip_prefix = "rules_kotlin-master",
)
load("@io_bazel_rules_kotlin_master//src/main/starklark/release_archive", "archive_repository")
archive_repository(
name = "io_bazel_rules_kotlin",
source_repository_name = "io_bazel_rules_kotlin_master"
)
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories", "versions")
kotlin_repositories()
load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
kt_register_toolchains() |
Tried the example above but I'm encountering the following error:
Any idea what could be the cause? |
Typo, (sorry). Try:
|
Got the following error:
As I can see, the src/main/starlark/release_archive contains a WORKSPACE file, so it doesn't look like it's a bzl file. |
I don't know if this is helpful, but when I use http_archive(
name = "io_bazel_rules_kotlin_head",
sha256 = "e18c230aa7f817850c11b3fcbfc9b688a891d40bd5cf2c976224832dea3e5eb4",
strip_prefix = "rules_kotlin-1f61f73ac5fc78cb08807bf629e8626e64646abe",
url = "https://github.com/bazelbuild/rules_kotlin/archive/1f61f73ac5fc78cb08807bf629e8626e64646abe.tar.gz",
)
load("@io_bazel_rules_kotlin_head//src/main/starlark/release_archive:repository.bzl", "archive_repository")
archive_repository(
name = "io_bazel_rules_kotlin",
source_repository_name = "io_bazel_rules_kotlin_head"
) I get
Bazel 5.0rc2, macOS 10.15, no Android SDK installed. |
Works when using Bazel 4.2.1. So use
|
Seems something on my side or something related to bazel version check: bazel --version
bazel 4.2.1-homebrew bazel build //kotlin/common/cli:lib shows the following error:
Here is information regarding version of bazel and it's location:
bazel --version from /usr/localCellar/bazel/
|
I would recommend to deinstall |
Signed-off-by: Oliver Eikemeier <eikemeier@fillmore-labs.com>
It works with bazelisk as expected. Thanks for your help @eikemeier |
Been a few months since i used the rules locally but im running into two strange errors:
Unable to find package for @rkt_1_4//jvm:opts.bzl: The repository '@rkt_1_4' could not be resolved
Error: 'dict' value has no field or method 'url_templates'
here is my workspace:
and here is my toolchain:
I am on the latest commit a73e838
Both seem related to the large versioning change added by @restingbull
The text was updated successfully, but these errors were encountered: