GithubHelp home page GithubHelp logo

Comments (18)

johnynek avatar johnynek commented on June 15, 2024

/cc @colinmarc @jcoveney

from rules_scala.

colinmarc avatar colinmarc commented on June 15, 2024

What about adding a java provider to scala_library? Will the java rules pick that up automatically?

from rules_scala.

colinmarc avatar colinmarc commented on June 15, 2024

Also, if that doesn't work, we could generate the java_import rules preemptively as foo_javaimport.

from rules_scala.

johnynek avatar johnynek commented on June 15, 2024

There is a ticket for some API to make this work, but I think the java rules don't have a contract like this. I wouldn't want to add preemptively out of anxiety that it would slow down the build by doubling the number of targets, half of which would not be used in scala-only repos (even with mixed java-scala it is not that common to depend across languages).

from rules_scala.

johnynek avatar johnynek commented on June 15, 2024

I don't see how to do the java_import. We can only call native rules from macros, not other skylark rules. But we can't see in a macro all the dependencies we need to add to the java_import.

I think we may just have to wait until bazelbuild/bazel#970 is solved. I can't see any non-manual way to work around this, but maybe I'm missing something.

from rules_scala.

colinmarc avatar colinmarc commented on June 15, 2024

What if we benchmarked preemptively creating java_import (assuming that actually works)? It may be that perf works fine with double the targets.

from rules_scala.

johnynek avatar johnynek commented on June 15, 2024

Sure, that would be fine. I actually don't know how to do it though.

Can you see a way?

On Wednesday, May 25, 2016, Colin Marc [email protected] wrote:

What if we benchmarked preemptively creating java_import (assuming that
actually works)? It may be that perf works fine with double the targets.


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

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

from rules_scala.

colinmarc avatar colinmarc commented on June 15, 2024

I think we'd have to give the java_import the specified name, and then build the library jar as a separate _scalajar rule or something. I can tool around with it later.

from rules_scala.

johnynek avatar johnynek commented on June 15, 2024

So, with the recent merge of correct deploy jars we can just do Java import
of deploy jars, bit that is not a great solution since it hides duplicate
classes on the class path, although they should be identical.

How urgent is this? What if we just hope bazel makes it possible to do Java
interoperability as is being discussed?

On Thursday, May 26, 2016, Colin Marc [email protected] wrote:

I think we'd have to give the java_import the specified name, and then
build the library jar as a separate _scalajar rule or something. I can
tool around with it later.


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

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

from rules_scala.

ittaiz avatar ittaiz commented on June 15, 2024

@sdtwigg at the risk of extending our conversation to yet another issue this one seems like the most relevant one about enabling java_* targets to depend on scala_* targets. Any update on that?
I thought issue 970 has a bit too much noise so maybe we should continue here for followup which doesn't require the Bazel people.

from rules_scala.

sdtwigg avatar sdtwigg commented on June 15, 2024

Sorry for the delay here. I was ill over the weekend and have been playing catch-up since then.

There was a slight confusion in getting the necessary reviews from the bazel team but things should be in sync now. Here is what I have so far:

Regarding critical bazel contributions:
https://bazel-review.googlesource.com/#/c/9671/ - This one is critical. Otherwise, you will find it somewhat arbitrary what arguments in a java native rule accept skylark rules. This would make it so that all of the java_library|import|binary accept skylark rules for deps|exports|runtime_deps.

Regarding rules_scala changes:
See sdtwigg@8be3df5 as the minimum viable product for this working. As-is, it does work and is how the main API will ultimately probably look. Preliminary tests indicate it is working fine (especially after the other cleanup PR I did which took care of most of the other oddities that used to be in that commit).

I have not been aggressively pushing to submit due to these two pending bazel contributions:
https://bazel-review.googlesource.com/#/c/9730/ - Changes java_common.create_provider to take depsets instead of lists. API-breaking (for an unpublished, experimental API) that would break my rules_scala changes until they are adjusted. It is a simple adjustment (involving removing the to_list calls!) but still technically breaking.

https://bazel-review.googlesource.com/#/c/9670/ - This cleans things up the implementation and better restricts compile jars. Internally, it means we can just use JavaProvider primarily just like the java rules are using our java provider. Also, cleans up a glitch in current implementation where it is getting transitive compile jars from java rules rather than just the 'local' compile jars.

from rules_scala.

sdtwigg avatar sdtwigg commented on June 15, 2024

Update with good news: All the referenced changes to bazel have been merged.

from rules_scala.

ittaiz avatar ittaiz commented on June 15, 2024

from rules_scala.

johnynek avatar johnynek commented on June 15, 2024

from rules_scala.

ittaiz avatar ittaiz commented on June 15, 2024

@sdtwigg
Any updates? I'm mainly asking since there are some changes I'm thinking about which will probably be easier when this lands

from rules_scala.

ittaiz avatar ittaiz commented on June 15, 2024

Hey,
@sdtwigg I'm sorry to be a nuisance but would you rather someone take sdtwigg@8be3df5 and continue from there?
I don't want to stress you too much but on the other hand I think it would help with a few different issues (junit logs, javac default encoding not being UTF8 and maybe javac default debug symbols)

from rules_scala.

ittaiz avatar ittaiz commented on June 15, 2024

@johnynek this is solved, right?

from rules_scala.

johnynek avatar johnynek commented on June 15, 2024

I think so. yes!

from rules_scala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.