Skip to content

Conversation

gergelyfabian
Copy link
Contributor

@gergelyfabian gergelyfabian commented Jul 16, 2025

Description

Expose build_ijar to enable compiling scala code, that is not for macro
definitions, but would be used in inlining (so ijar support should be
disabled for it).

You may need strict dependency checks (transitive dependencies not on the
classpath) for code that is to be used in inlining.

Till now one would need to use scala_macro_library for that, but it was
recently switched to include all transitive dependencies on the compiler's
classpath, hence strict dependencies are not enforced there.

The new attribute enables having both:
a) code compiled for inlining
b) strict dependency checks

@gergelyfabian gergelyfabian marked this pull request as ready for review July 16, 2025 12:25
@gergelyfabian gergelyfabian force-pushed the scala_inlined_library branch 2 times, most recently from dfe245b to 4de48e4 Compare July 16, 2025 14:03
@gergelyfabian
Copy link
Contributor Author

Added a basic test and documentation.

@simuons
Copy link
Collaborator

simuons commented Jul 23, 2025

Hi, @gergelyfabian, thanks for looking into it. I did quick look and was wondering could it be solved with an attribute on the existing rule instead of new one? Looks like it's very similar to scala_library or I missed the point why new rule is needed?

@gergelyfabian
Copy link
Contributor Author

gergelyfabian commented Jul 23, 2025 via email

@gergelyfabian gergelyfabian force-pushed the scala_inlined_library branch from 4de48e4 to 18cfd3d Compare August 20, 2025 14:51
@gergelyfabian gergelyfabian changed the title scala_inlined_library expose build_ijar for scala_library Aug 20, 2025
Expose build_ijar to enable compiling scala code, that is not for macro
definitions, but would be used in inlining (so ijar support should be
disabled for it).

You may need strict dependency checks (transitive dependencies not on the
classpath) for code that is to be used in inlining.

Till now one would need to use scala_macro_library for that, but it was
recently switched to include all transitive dependencies on the compiler's
classpath, hence strict dependencies are not enforced there.

The new attribute enables having both:
a) code compiled for inlining
b) strict dependency checks
@gergelyfabian gergelyfabian force-pushed the scala_inlined_library branch from 18cfd3d to f360522 Compare August 20, 2025 14:55
@gergelyfabian
Copy link
Contributor Author

@simuons, updated PR to expose a build_ijar attribute on scala_library instead of creating a new rule. This solves the problem as well.

Copy link
Collaborator

@simuons simuons left a comment

Choose a reason for hiding this comment

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

Thanks, @gergelyfabian. We will release it as part of 7.1.1

@simuons simuons merged commit f452324 into bazel-contrib:master Aug 25, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants