-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
Ensure go_binary.embed libraries' importpath is main #2135
Conversation
While this fixes my test case, gazelle is failing to build still for the same reason. Digging. |
Gotcha. |
Go 1.13 is stricter on the package path passed to go tool compile -p. This means that go_library passed in go_binary.embed fails to declare a main.main function, as they now retain their original import path. Fix that by adding a is_main boolean to the GoLibrary provider, which will tell wether a library is supposed to be a main package; that is, compiled from within a go_binary. Fixes #2133 Signed-off-by: Steeve Morin <[email protected]>
Updated the PR to add the |
* Revert change in effective_importpath_importmap. It looks like go_path needs these to stay exactly the same. Instead, adjust importmap in emit_archive. * Also set is_main in go_test and nogo, which create GoLibrary providers without calling new_library. * Minor doc rephrasing.
Thanks for working on this. Hope you don't mind that I fixed a couple things and updated the PR directly. My earlier advice on updating |
No worries! Thank you for amending the PR on a Saturday! |
I had limited connectivity but I wanted to at least update the PR |
Necessary to make the go1.13 linker happy. Corresponding change in go_binary: bazel-contrib/rules_go#2135 Also: upgrade to rules_go 0.19.3
Necessary to make the go1.13 linker happy. Corresponding change in go_binary: bazel-contrib/rules_go#2135 Also: upgrade to rules_go 0.19.3
…b#625) Necessary to make the go1.13 linker happy. Corresponding change in go_binary: bazel-contrib/rules_go#2135 Also: upgrade to rules_go 0.19.3
) Go 1.13 is stricter on the package path passed to go tool compile -p. This means that go_library passed in go_binary.embed fails to declare a main.main function, as they now retain their original import path. Fix that by adding a is_main boolean to the GoLibrary provider, which will tell wether a library is supposed to be a main package; that is, compiled from within a go_binary. Fixes bazel-contrib#2133
Go 1.13 is now stricter on the package path passed to
go tool compile -p. This means that go_library passed in go_binary.embed
fails to declare a main.main, as they now retain their import path. Fix
this by forcing a importmain=main on go_binary.
Fixes #2133