I know @Aaron Levin <aaronle...@stripe.com> is using `rules_scala` for
building Flink apps, perhaps he can help us out here (and hope he doesn't
mind the ping).



On Wed, May 12, 2021 at 4:13 PM Austin Cawley-Edwards <
austin.caw...@gmail.com> wrote:

> Yikes, I see what you mean. I also can not get `neverlink` or adding the
> org.scala.lang artifacts to the deploy_env to remove them from the uber jar.
>
> I'm not super familiar with sbt/ scala, but do you know how exactly the
> assembly `includeScala` works? Is it just a flag that is passed to scalac?
>
> I've found where rules_scala defines how to call `scalac`, but am lost
> here[1].
>
> Best,
> Austin
>
> [1]:
> https://github.com/bazelbuild/rules_scala/blob/c9cc7c261d3d740eb91ef8ef048b7cd2229d12ec/scala/private/rule_impls.bzl#L72-L139
>
> On Wed, May 12, 2021 at 3:20 PM Salva Alcántara <salcantara...@gmail.com>
> wrote:
>
>> Hi Austin,
>>
>> Yep, removing Flink dependencies is working well as you pointed out.
>>
>> The problem now is that I would also need to remove the scala library...by
>> inspecting the jar you will see a lot of scala-related classes. If you
>> take
>> a look at the end of the build.sbt file, I have
>>
>> ```
>> // exclude Scala library from assembly
>> assembly / assemblyOption  := (assembly /
>> assemblyOption).value.copy(includeScala = false)
>> ```
>>
>> so the fat jar generated by running `sbt assembly` does not contain
>> scala-related classes, which are also "provided". You can compare the
>> bazel-built jar with the one built by sbt
>>
>> ```
>> $ jar tf target/scala-2.12/bazel-flink-scala-assembly-0.1-SNAPSHOT.jar
>> META-INF/MANIFEST.MF
>> org/
>> org/example/
>> BUILD
>> log4j.properties
>> org/example/WordCount$$anon$1$$anon$2.class
>> org/example/WordCount$$anon$1.class
>> org/example/WordCount$.class
>> org/example/WordCount.class
>> ```
>>
>> Note that there are neither Flink nor Scala classes. In the jar generated
>> by
>> bazel, however, I can still see Scala classes...
>>
>>
>>
>> --
>> Sent from:
>> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
>>
>

Reply via email to