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

Implicit dependency issue #140

Closed
menny opened this issue Sep 7, 2018 · 11 comments · Fixed by #141
Closed

Implicit dependency issue #140

menny opened this issue Sep 7, 2018 · 11 comments · Fixed by #141

Comments

@menny
Copy link
Contributor

menny commented Sep 7, 2018

I think something is wrong with my setup, any help would be appreciated. I get this error when I try to build my Kotlin targets:

INFO: SHA256 (https://github.com/bazelbuild/rules_kotlin/archive/c56299c32437cf9608612868beb1c2ba9386940d.zip) = 160e06a8d0a32b07b1c8ec4c88c9fd42988c3a4d4ba43776a87dbba99634f67e
ERROR: /Users/menny/dev/spotify/client-android/bazel/transformer/BUILD.bazel:17:1: every rule of type kt_jvm_binary implicitly depends upon the target '@com_github_jetbrains_kotlin//:kotlin-runtime', but this target could not be found because of: no such package '@com_github_jetbrains_kotlin//': Traceback (most recent call last):
	File "/private/var/tmp/_bazel_menny/abbd8cf9e5bbd5870afa5547369aa515/external/bazel_tools/tools/build_defs/repo/http.bzl", line 56
		workspace_and_buildfile(ctx)
	File "/private/var/tmp/_bazel_menny/abbd8cf9e5bbd5870afa5547369aa515/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 59, in workspace_and_buildfile
		ctx.symlink(ctx.attr.build_file, "BUILD.bazel")
Unable to load package for //kotlin/internal/repositories:BUILD.com_github_jetbrains_kotlin: not found.
ERROR: Analysis of target '//bazel/transformer:transformer' failed; build aborted: no such package '@com_github_jetbrains_kotlin//': Traceback (most recent call last):
	File "/private/var/tmp/_bazel_menny/abbd8cf9e5bbd5870afa5547369aa515/external/bazel_tools/tools/build_defs/repo/http.bzl", line 56
		workspace_and_buildfile(ctx)
	File "/private/var/tmp/_bazel_menny/abbd8cf9e5bbd5870afa5547369aa515/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 59, in workspace_and_buildfile
		ctx.symlink(ctx.attr.build_file, "BUILD.bazel")
Unable to load package for //kotlin/internal/repositories:BUILD.com_github_jetbrains_kotlin: not found.
INFO: Elapsed time: 6.004s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (10 packages loaded)
FAILED: Build did NOT complete successfully (10 packages loaded)

In my WORKSPACE file I've setup Kotlin like this:

rules_kotlin_version = "c56299c32437cf9608612868beb1c2ba9386940d"

http_archive(
    name = "io_bazel_rules_kotlin",
    urls = ["https://github.com/bazelbuild/rules_kotlin/archive/%s.zip" % rules_kotlin_version],
    type = "zip",
    strip_prefix = "rules_kotlin-%s" % rules_kotlin_version
)

load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
kotlin_repositories()
kt_register_toolchains()
@menny
Copy link
Contributor Author

menny commented Sep 7, 2018

I'm on Mac - High Sierra v10.13.6 (17G65) - using Bazel 0.16.1 from brew (Google's tap).

@menny
Copy link
Contributor Author

menny commented Sep 7, 2018

I tried bazel clean --expunge.
I tried running in sandbox or with --spawn_strategy=standalone

Same error every time.

@menny
Copy link
Contributor Author

menny commented Sep 11, 2018

The following rules_kotlin commits are failing:
c56299c32437cf9608612868beb1c2ba9386940d
6a1ba7b9b6f8922d9d5db81f2169413e9ec9163c
9b02fa20795be93db64ac3d63a0cc06a5d18f0d3
b48c3f31c6e33d1613e2c5c0cda2a0e690b08fd2
fe593c56551b30445199a6a0ce47751cc23f3b23

But d83e2689b04941d097be7d3b85fd227434e036ea works!

@menny
Copy link
Contributor Author

menny commented Sep 11, 2018

I have #141 which seems to fix the issue.

@hsyed
Copy link
Contributor

hsyed commented Sep 14, 2018

Strange. do you have persistent workers enabled ?

I have been trying to get rid of the @io_bazel_rules_kotlin references.

@hsyed
Copy link
Contributor

hsyed commented Sep 14, 2018

Does @//kotlin/internal/repositories:BUILD.com_github_jetbrains_kotlin work ?

@Paul-McNeice
Copy link

I also have the same error using the most recent commit

@hsyed
Copy link
Contributor

hsyed commented Sep 14, 2018

@Pmcneice do you have workers enabled ?

@Paul-McNeice
Copy link

Paul-McNeice commented Sep 14, 2018

@hsyed Nope. This is a fresh install of Bazel - running 0.15.2-homebrew on OSX High Sierra v10.13.6.

I'll update that example project when I get home tonight to see if you can recreate on your end.

Edit: Unless workers are enabled by default with 0.15.2?

@hsyed
Copy link
Contributor

hsyed commented Sep 14, 2018

They aren't enabled by default -- I have an issue open in bazel core as for Kotlin it makes no sense to run without workers (well soon it won't, if the builder becomes more granular).

lets see if that fixes your problem, I'll update the readme to make it clearer if it does.

@menny
Copy link
Contributor Author

menny commented Sep 14, 2018

@hsyed changing to build_file = "@//kotlin/internal/repositories:BUILD.com_github_jetbrains_kotlin" did not fix the issue:

Starting local Bazel server and connecting to it...
INFO: SHA256 (https://github.com/menny/rules_kotlin/archive/e303a5506ed3a6e7c61cbc9f41a8c97be8fe5c08.zip) = c48c7b8823ab288dd32b1ec5081902525583b10f6dd99f63939a0a8f7ef19f92
ERROR: /Users/menny/dev/spotify/client-android/bazel/transformer/BUILD.bazel:17:1: every rule of type kt_jvm_binary implicitly depends upon the target '@com_github_jetbrains_kotlin//:kotlin-runtime', but this target could not be found because of: no such package '@com_github_jetbrains_kotlin//': Traceback (most recent call last):
	File "/private/var/tmp/_bazel_menny/abbd8cf9e5bbd5870afa5547369aa515/external/bazel_tools/tools/build_defs/repo/http.bzl", line 56
		workspace_and_buildfile(ctx)
	File "/private/var/tmp/_bazel_menny/abbd8cf9e5bbd5870afa5547369aa515/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 59, in workspace_and_buildfile
		ctx.symlink(ctx.attr.build_file, "BUILD.bazel")
Unable to load package for //kotlin/internal/repositories:BUILD.com_github_jetbrains_kotlin: not found.
ERROR: Analysis of target '//bazel/transformer:transformer' failed; build aborted: no such package '@com_github_jetbrains_kotlin//': Traceback (most recent call last):
	File "/private/var/tmp/_bazel_menny/abbd8cf9e5bbd5870afa5547369aa515/external/bazel_tools/tools/build_defs/repo/http.bzl", line 56
		workspace_and_buildfile(ctx)
	File "/private/var/tmp/_bazel_menny/abbd8cf9e5bbd5870afa5547369aa515/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 59, in workspace_and_buildfile
		ctx.symlink(ctx.attr.build_file, "BUILD.bazel")
Unable to load package for //kotlin/internal/repositories:BUILD.com_github_jetbrains_kotlin: not found.
INFO: Elapsed time: 6.368s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (10 packages loaded)
FAILED: Build did NOT complete successfully (10 packages loaded)

See e303a55

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 a pull request may close this issue.

3 participants