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

Possible confusion in the docs //scala:scala.bzl vs @io_bazel_rules_scala//scala:scala.bzl #60

Closed
ittaiz opened this issue May 22, 2016 · 7 comments

Comments

@ittaiz
Copy link
Member

ittaiz commented May 22, 2016

First of all thanks a lot for all your hard work, it's really appreciated!

I'm not sure this is in the scope of this repo but the fact of the matter is that I went along the readme and since it mentions the load with respect to prelude_bazel I wasn't sure if there isn't a different syntax for that use-case.
I went to the tests since they are the executable specification and failed since they use the absolute(?) path //scala:scala.bzl
This is an on-boarding issue since if I was familiar with Bazel syntax well enough I wouldn't have made that mistake but I think we want to make on-boarding easier.
2 options I had in mind:

  1. Add a note in the readme at the end of the overview explaining the difference
  2. Add a scala app to the bazelbuild/examples repo
    The added value of add support for src jars #2 is that it serves as a bit of a test application since it has to use the syntax like "regular" users.

I'd be happy to contribute both options but didn't want to barge in with a PR before we discuss it.

@ittaiz
Copy link
Member Author

ittaiz commented May 22, 2016

you can see this error btw in my getting started scala repo (https://github.com/ittaiz/bazel-scala-getting-started)

@johnynek
Copy link
Member

Hi, definitely explaining correct use is in scope for the repo, but I'm a little unclear what your question is.

  1. is it that in the local tests we don't use the repo name @io_bazel_rules_scala?
  2. that we don't make it clear exactly how to setup a local prelude_bazel file, or the alternative?

If it is the latter, I 100% support adding "getting started" section to the README.md. If it is the former, I'm not sure what the style is. Is referring to targets with the full name allowed? I have never tried. For clarity, it might be good to use the full name, if that indeed works (I was somehow initially under the impression that names were only for remote repos, but it does seem like it should work if you were designing the feature).

PRs on both issues are warmly welcomed! :)

@ittaiz
Copy link
Member Author

ittaiz commented May 23, 2016

Excellent.
It's basically both.
I'll submit a PR with a getting started addition.
Regarding the usage of the full name I'll take a look and if it will work
I'll send that to.

My initial idea was to have a separate "test application" which might sit
in the examples repository which has to use the API the same way clients
use them. Problem is with this setup it can easily rot. Internally these
test apps are part of the chain of the library and so apart from serving as
documentation they validate the library author's assumptions on API usage.
On יום ב׳, 23 במאי 2016 at 7:30 P. Oscar Boykin notifications@github.com
wrote:

Hi, definitely explaining correct use is in scope for the repo, but I'm a
little unclear what your question is.

  1. is it that in the local tests we don't use the repo name
    @io_bazel_rules_scala?
  2. that we don't make it clear exactly how to setup a local prelude_bazel
    file, or the alternative?

If it is the latter, I 100% support adding "getting started" section to
the README.md. If it is the former, I'm not sure what the style is. Is
referring to targets with the full name allowed? I have never tried. For
clarity, it might be good to use the full name, if that indeed works (I was
somehow initially under the impression that names were only for remote
repos, but it does seem like it should work if you were designing the
feature).

PRs on both issues are warmly welcomed! :)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#60 (comment)

@ittaiz
Copy link
Member Author

ittaiz commented May 24, 2016

Tried using the full name and didn't work
ERROR: error loading package 'test': Encountered error while reading extension file 'scala/scala.bzl': no such package '@io_bazel_rules_scala//scala': error loading package 'external': The repository named 'io_bazel_rules_scala' could not be resolved.
Is there an alias for a repository as well? Saw for a rule but doesn't sound like what we need.

@johnynek
Copy link
Member

There is bind, which allows you to basically make a solid link but that
goes the other way: making remote targets look local.

Maybe you can ask on the bazel list. I guess you cannot refer to the
current repo using the full name. Not exactly sure why they made that
choice. It may simply be an oversight.

On Monday, May 23, 2016, Ittai Zeidman notifications@github.com wrote:

Tried using the full name and didn't work
ERROR: error loading package 'test': Encountered error while reading
extension file 'scala/scala.bzl': no such package
'@io_bazel_rules_scala//scala': error loading package 'external': The
repository named 'io_bazel_rules_scala' could not be resolved.

Is there an alias for a repository as well? Saw for a rule but doesn't
sound like what we need.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#60 (comment)

P. Oscar Boykin, Ph.D. | http://twitter.com/posco | http://pobox.com/~boykin

@ittaiz
Copy link
Member Author

ittaiz commented May 25, 2016

I'll ask and update here
On יום ג׳, 24 במאי 2016 at 19:14 P. Oscar Boykin notifications@github.com
wrote:

There is bind, which allows you to basically make a solid link but that
goes the other way: making remote targets look local.

Maybe you can ask on the bazel list. I guess you cannot refer to the
current repo using the full name. Not exactly sure why they made that
choice. It may simply be an oversight.

On Monday, May 23, 2016, Ittai Zeidman notifications@github.com wrote:

Tried using the full name and didn't work
ERROR: error loading package 'test': Encountered error while reading
extension file 'scala/scala.bzl': no such package
'@io_bazel_rules_scala//scala': error loading package 'external': The
repository named 'io_bazel_rules_scala' could not be resolved.

Is there an alias for a repository as well? Saw for a rule but doesn't
sound like what we need.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
<
#60 (comment)

P. Oscar Boykin, Ph.D. | http://twitter.com/posco |
http://pobox.com/~boykin


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#60 (comment)

johnynek added a commit that referenced this issue May 25, 2016
fixes #60 by clarifying the getting started path
@ittaiz
Copy link
Member Author

ittaiz commented May 25, 2016

Do you want me to keep investigating the full name?
On יום ד׳, 25 במאי 2016 at 20:03 P. Oscar Boykin notifications@github.com
wrote:

Closed #60 #60 via
ce1cfac
ce1cfac
.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#60 (comment)

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

2 participants