Closed tivervac closed 4 months ago
I’ll look in detail tomorrow. I just wonder how p2 director already supports the -followReferences option (off by default) with the current implementation.
https://help.eclipse.org/latest/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.html
I also recall when oomph’s p2 director task didn’t follow references and I had change something to enable that. That’s a few years back…
@tivervac the value is hardcoded in the constructor but code creating the provisioning context can still override that value by calling setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, "false")
so I don't think we need a new constructor parameter but make the property public.
@merks thats exactly how DirecorApplication works, but currently uses a copy of the constant FOLLOW_ARTIFACT_REPOSITORY_REFERENCES
Also note that there is another property FOLLOW_REPOSITORY_REFERENCES
for metadata repositories what already is public.
This is specifically where the director application configures that:
So I don't think this PR is needed because one can always achieve the goal by configuring the context properties.
So I don't think this PR is needed because one can always achieve the goal by configuring the context properties.
As mentioned the property is private, we should make it public instead of maintain just another copy at PDE soon.
Beside that, it might be worth to have a method ProvisioningContext#setFollowReferences(boolean)
that simply sets both properties to true/false to cover the common case and make this more obvious.
Let's not pollute the API with convenience methods that then must interact properly with the property settings. In any case, that's not what this PR does.
Note that this is public:
But this is not:
That one could and probably should be made public and that would avoid the copy in the director:
But that's also not what this PR does. So we don't need this PR but a different PR to make the constant public seems helpful.
@tivervac the value is hardcoded in the constructor but code creating the provisioning context can still override that value by calling
setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, "false")
so I don't think we need a new constructor parameter but make the property public. @merks thats exactly how DirecorApplication works, but currently uses a copy of the constantFOLLOW_ARTIFACT_REPOSITORY_REFERENCES
Also note that there is another property
FOLLOW_REPOSITORY_REFERENCES
for metadata repositories what already is public.
Right, the copy is what threw me off. I did a find references on FOLLOW_ARTIFACT_REPOSITORY_REFERENCES
and didn't see it used in any set
context. I'll make the constant public to make sure other people don't hit the same mistake. Once I've confirmed that setting the properties solves my issue, I'll close this PR. Thanks for the help both!
Settings the property works for my usecase \o/
@tivervac
Thanks for taking the time to contribute to such a complex project where it's all too easy to be thrown off by the endless details!
Replaced by https://github.com/eclipse-equinox/p2/pull/506/
This goes hand in hand with the PR in PDE. If there's a way to achieve this without editing the public API in
IPlanner
, I would much prefer it.Seeing how
FOLLOW_ARTIFACT_REPOSITORY_REFERENCES
was always hardcoded totrue
inProvisioningContext
, I feel like someone wanted to implement something similar at some point, but didn't get around to it.For versioning, I just followed the quick fixes, I hope this is correct.