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

Add scala-xml and scala-parser-combinators jars individually #549

Merged

Conversation

jhnj
Copy link
Contributor

@jhnj jhnj commented Jun 28, 2018

As part of a larger PR (#544) for adding support for selecting scala versions I separated scala-xml and scala-parser-combinators to be imported individually using native.http_jar. @johnynek suggested making o separate PR for this smaller change so here it is.

The motivation behind the change is that the versions of scala-xml and scala-parser-combinators that are downloaded as part of the main {scala_version}.tgz differ between minor scala versions and this way we can select specific versions (#544 would allow users to select any 2.11/2.12 minor version)

- Update aspect test with new labels
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@johnynek
Copy link
Member

@jhnj you need to sign the CLA. Stripe has already done it for all of stripe. If you use your stripe account, it should work, or I think you can personally sign.

scala/scala.bzl Outdated
jars = ["lib/scala-parser-combinators_2.11-1.0.4.jar"],
visibility = ["//visibility:public"],
)

java_import(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we kill the whole use of the sdk and just use jars? I think that might be the way to go so we can just use maven servers for all dependencies (or git repos I guess).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't see why we couldn't, I'll update the PR after lunch

@jhnj
Copy link
Contributor Author

jhnj commented Jun 28, 2018

I'll sign the cla individually. Decided to use my personal account as I won't have access to the stripe one after the summer

@jhnj
Copy link
Contributor Author

jhnj commented Jun 28, 2018

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@jhnj
Copy link
Contributor Author

jhnj commented Jun 28, 2018

@johnynek Updated the PR. One question though, currently using native.http_jar for the downloads (as scalatest was using it). That or native.maven_jar?

Copy link
Member

@johnynek johnynek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to http_file + scala_import and I am +1

scala/scala.bzl Outdated
url =
"http://central.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.4/scala-parser-combinators_2.11-1.0.4.jar",
sha256 = "0dfaafce29a9a245b0a9180ec2c1073d2bd8f0330f03a9f1f6a74d1bc83f62d6"
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to use http_file then scala_import them because they could in principle have macros inside, so we don't want to use ijar.

@ittaiz
Copy link
Member

ittaiz commented Jun 28, 2018 via email

@jhnj
Copy link
Contributor Author

jhnj commented Jun 28, 2018

@johnynek @ittaiz now with http_file + scala_import. Didn't know about scala_maven_import_external, I'll use that

@johnynek
Copy link
Member

can you look at the CI failures? seems like you still have some @scala// around.

@jhnj
Copy link
Contributor Author

jhnj commented Jun 28, 2018

@johnynek Updated now with scala_maven_import_external, I'll check the CI failures

@jhnj
Copy link
Contributor Author

jhnj commented Jun 28, 2018

Not sure what the CI failures where, didn't get those errors locally. We'll see if the new commits pass

@jhnj
Copy link
Contributor Author

jhnj commented Jun 29, 2018

@johnynek Could you take a look at the CI errors, can't figure out why it's failing.

dependency_analyzer_test is failing as it's not able to resolve $(location //external:io_bazel_rules_scala/dependency/scala/scala_library). I couldn't get it working locally by changing to @scala_library//jar:jar either.

@johnynek
Copy link
Member

@jhnj I see:

bazel test third_party/...

failing. Does that work for you?

@jhnj
Copy link
Contributor Author

jhnj commented Jun 29, 2018

@johnynek Doesn't work, dependency_analyzer_test is in third_party. I'm getting:

ERROR: /Users/johan/code/rules_scala/third_party/plugin/src/test/BUILD:5:1: in scala_junit_test rule //third_party/plugin/src/test:dependency_analyzer_test: label '@scala_library//jar:jar' in $(location) expression expands to no files

(and the same with //external:io_bazel_rules_scala/dependency/scala/scala_library)

@jhnj
Copy link
Contributor Author

jhnj commented Jun 29, 2018

@scala_library is added using scala_maven_import_external and works correctly elsewhere

@johnynek
Copy link
Member

@ittaiz any tips? I have not really kept up with the state of these import rules.

@ittaiz
Copy link
Member

ittaiz commented Jun 29, 2018 via email

@ittaiz
Copy link
Member

ittaiz commented Jun 29, 2018

I think, but haven’t confirmed it yet, that it’s because scala import doesn’t return the files in the DefaultInfo provider. Third time we’re stublin onto this but each time it’s part of a bigger PR so it doesn’t get fixed. I’ll see if I can send a small PR just for this. @jhnj if you’re blocked by it you can also pick it up

@jhnj
Copy link
Contributor Author

jhnj commented Jun 29, 2018

I'll try to make a PR today if I have the time

@jhnj
Copy link
Contributor Author

jhnj commented Jun 29, 2018

Cherry-picked commit from #550

scala/scala.bzl Outdated
visibility = ["//visibility:public"],
)
"""

def scala_repositories():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make server URLs maven_servers as a parameter and default to a single list with maven central?

scala/scala.bzl Outdated
)

_scala_maven_import_external(
name = "scala_xml",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These names are pretty short. Since they have to be globally unique what about io_bazel_rules_scala_scala_xml?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn’t this contradict canonical naming? Why do you think here we should preface with rules_scala?
Not sure I disagree btw, trying to gather my thoughts about it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don’t own the global namespace. So who is to say someone else didn’t point scala_xml at something else. If you prefix with io_bazel_rules_scala I think you are asking for it. I think we can argue that we do own that namespace. If we could solve the problem of a canonical maven encoding, this could be a solved problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 on having longer names. Don't have strong opinions on whether it should be io_bazel_rules_scala_scala_xml or e.g. org_scala_lang_modules_scala_xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants