Skip to content

Remove duplicate resources from test suite#338

Open
brian-mcnamara wants to merge 6 commits into
bazel-contrib:mainfrom
brian-mcnamara:resourceRemoval
Open

Remove duplicate resources from test suite#338
brian-mcnamara wants to merge 6 commits into
bazel-contrib:mainfrom
brian-mcnamara:resourceRemoval

Conversation

@brian-mcnamara

Copy link
Copy Markdown
Contributor

See https://github.com/bazel-contrib/rules_jvm/pull/303/files/d899e276ff1a4a9b98272ed6cd31991f09d7839a#r2042301337 for discussion. This change removes library_attrs from the two "classpath healper" libraries (which were introduced as a classpath simplification for bazel), as well as poping the resources from the kwargs if the resources library will include them.

Also added a test case for this

@honnix

honnix commented Apr 21, 2025

Copy link
Copy Markdown
Contributor

I think I'm seeing some weird issue when applying this patch. It feels like resources are not picked up.

@honnix

honnix commented Apr 21, 2025

Copy link
Copy Markdown
Contributor

I think I'm seeing some weird issue when applying this patch. It feels like resources are not picked up.

I know what happened. There are cases we intentionally use a resource named exactly the same as that in production, in order to override. Since -test-lib.jar appears pretty late in classpath (after the production jar), the overridden was not picked up. I think maybe -test-lib.jar should not pack any test resources.

@brian-mcnamara

Copy link
Copy Markdown
Contributor Author

I think I'm seeing some weird issue when applying this patch. It feels like resources are not picked up.

I know what happened. There are cases we intentionally use a resource named exactly the same as that in production, in order to override. Since -test-lib.jar appears pretty late in classpath (after the production jar), the overridden was not picked up. I think maybe -test-lib.jar should not pack any test resources.

Another solution would be to set library_attributes to not include resources. My thinking is that this would reduce the duplication of resources being added to each jar. Thoughts?

@honnix

honnix commented Apr 21, 2025

Copy link
Copy Markdown
Contributor

Another solution would be to set library_attributes to not include resources. My thinking is that this would reduce the duplication of resources being added to each jar. Thoughts?

Yeah that was what I suggested, and yes the trade-off is duplicating resources in each every test jar.

@honnix

honnix commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

Totally forgot about this. I think this is still valid, right?

@brian-mcnamara

Copy link
Copy Markdown
Contributor Author

Ooph, I too forgot about this, it should still be valid, looks like I need to resolve a conflict tho, let me get to that

@shs96c

shs96c commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator

@brian-mcnamara, could you please rebase on main and do a push. That should fix the failing test so we can get this merged. My apologies it's taken so long to get to this.

@brian-mcnamara

Copy link
Copy Markdown
Contributor Author

Merged in the latest, will check back on the CI. No worries on the delay, frankly I too forgot about this 🙈

@brian-mcnamara

Copy link
Copy Markdown
Contributor Author

Looks like everything is healthy.

@honnix

honnix commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

Shall we merge this?

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.

3 participants