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

Better explain the implications of -nouses instruction #6439

Closed
laeubi opened this issue Jan 23, 2025 · 3 comments · Fixed by #6441
Closed

Better explain the implications of -nouses instruction #6439

laeubi opened this issue Jan 23, 2025 · 3 comments · Fixed by #6441

Comments

@laeubi
Copy link
Contributor

laeubi commented Jan 23, 2025

Because of issue

I further analyzed the problem and found it to be a missing use clause:

i then tried to fix the project (what uses maven-bundle plugin / bnd already!) but without success. It took me some time to realize, that with this commit all Apache commons projects effectively disable use clauses on their export package instructions.

The commit do not mentioned any rationale and I thought it would be good to make the project aware of the issue by linking the documentation that will obviously war that this is dangerous and maybe list cases where it should or should not be used but:

https://bnd.bndtools.org/instructions/nouses.html

only tells

Do not calculate the uses directive on package exports or on capabilities.

I find disabling this extremely dangerous and the doc should at least mention the implications of not using uses directives on packages (and capabilities)

@laeubi laeubi changed the title Better ecplain the implications of -nouses instruction Better explain the implications of -nouses instruction Jan 23, 2025
@chrisrueger
Copy link
Contributor

mention the implications of not using uses directives on packages (and capabilities)

Any suggestion on what to write there?

I had a look and found 2 places where this is used:

@laeubi
Copy link
Contributor Author

laeubi commented Jan 23, 2025

The spec might be a good first source for derive some normative things:

Classes can depend on classes in other packages. For example, when they extend classes from another package, or these other classes appear in method signatures. It can therefore be said that a package uses other packages. These inter-package dependencies are modeled with the uses directive on the Export-Package header.

The most important part is this one here

Class space consistency can only be ensured if a bundle has only one exporter for each package.

So I hardly can imagine why one would want to disable this at all (and it seems only be either on or off...).

I had a look and found 2 places where this is used

This is where the flag is evaluated (I hope bnd nowhere uses the flag to disable this).

@chrisrueger
Copy link
Contributor

chrisrueger commented Jan 23, 2025

Docu change is live https://bnd.bndtools.org/instructions/nouses.html

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 a pull request may close this issue.

2 participants