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

Trouble using rules_go #5

Closed
Limdi opened this issue Mar 18, 2016 · 4 comments
Closed

Trouble using rules_go #5

Limdi opened this issue Mar 18, 2016 · 4 comments

Comments

@Limdi
Copy link

Limdi commented Mar 18, 2016

https://github.com/Limdi/testing_go

bazel build //lib:go_default_library
bazel test //lib:lib_test

These give me errors, my workaround is to add @io_bazel_rules_go to the Labels so the thing uses the @io_bazel_rules_go//go/toolchain stuff instead of trying to find //go/toolchain in my current WORKSPACE.

I guess the @// syntax was once supposed to mean "stay in this repo to resolve this dependency" or something, but I didnt get it to work that way and I read it only worked while some tools-folder was available as a symlink or something, nevermind about that I suppose.

edit: Maybe that doesnt work either, so how to do this?

@kchodorow
Copy link
Contributor

I have a patch to fix this (Bazel should resolve //foo relative to the repository), but it hasn't been committed yet. Once the patch is in, these rules should work with Bazel HEAD. Before then, recommended workaround is to either put this who repository in your workspace or use @bazel_tools//tools/build_rules/go.

@raliste
Copy link

raliste commented Mar 20, 2016

Same here.

Workaround was:

mkdir $WORKSPACE/build
cd $WORKSPACE/build
git clone https://github.com/bazelbuild/rules_go.git
cd ..
ln -sf $WORKSPACE/build/rules_go/go/ .

@Limdi
Copy link
Author

Limdi commented Mar 21, 2016

Works for me, thanks!

@Limdi Limdi closed this as completed Mar 21, 2016
@kchodorow
Copy link
Contributor

FWIW, using Bazel with this change: bazelbuild/bazel@6f15335 and the go rules with this change: 3dc4372 should work now.

groodt pushed a commit to groodt/rules_go that referenced this issue Mar 14, 2022
Port lexer changes from google/jsonnet 0c96da7 to 27ddf2c Fix bazel-contrib#1
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

No branches or pull requests

3 participants