-
Notifications
You must be signed in to change notification settings - Fork 41
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
Absence of an unpack attribute must not result in BundleShapeAdvice #477
Conversation
Currently the FeaturesAction assumes that the unpack attribute is always set, if that is not the case it leads to unexpected results because then unpack=true is assumed always. This is especially dangerous as PDE since 2023-12 release removes the attributes and Tycho assume they are false by default the same as PDE has done in the past when adding new items. To mitigate this this adds an additional check to only evaluate the unpack if it is set, together with a testcase that covers all possible combinations.
The change looks good to me. I would like to get @merks review here too as we are really late in the game. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me.
- The change is sound. From understanding an unspecified
unpack
should have never defaulted totrue
and that is what this change fixes. - The change fixes the problem I have originally reported.
Thanks for providing a fix to quickly, @laeubi!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great that the unpackSet method already existed! This is indeed a very good and very minimal change. We will avoid significant grief to include this in the 4.31 release
For the record - PMC approved |
I build started here: https://ci.eclipse.org/releng/job/Builds/job/I-build-4.31/162/ |
@@ -186,7 +186,7 @@ private void createAdviceFileAdvice(Feature feature, IPublisherInfo publisherInf | |||
private void createBundleShapeAdvice(Feature feature, IPublisherInfo publisherInfo) { | |||
FeatureEntry entries[] = feature.getEntries(); | |||
for (FeatureEntry entry : entries) { | |||
if (entry.isUnpack() && entry.isPlugin() && !entry.isRequires()) | |||
if (entry.unpackSet() && entry.isUnpack() && entry.isPlugin() && !entry.isRequires()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would seem there is a bug in isUnpack
if we want the default to be false. For a future release we should consider if this is correct for isUnpack
:
public boolean isUnpack() {
return (unpack != null && unpack.booleanValue());
}
Currently the FeaturesAction assumes that the unpack attribute is always set, if that is not the case it leads to unexpected results because then unpack=true is assumed always. This is especially dangerous as PDE since 2023-12 release removes the attributes and Tycho assume they are false by default the same as PDE has done in the past when adding new items.
To mitigate this this adds an additional check to only evaluate the unpack if it is set, together with a testcase that covers all possible combinations.
I give +1 as project lead for this really late fix but I think it is urgent enough as it has unexpected side-effects for users using already released PDE that will likely be hard to discover and the previous state was to always specify this attribute so existing setup won't be affected. Waiting for one more release to fix this seems therefore not acceptable for me.