-
Notifications
You must be signed in to change notification settings - Fork 193
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
tycho-p2-director:director uses wrong directory when run on macOS #3548
Comments
It depends a bit how should director know the "target"? I would think about we use the configurable tycho/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java Line 263 in 62f83cf
if given or check if the profile gives some hints but beside this its hard to guess. |
If |
tycho/tycho-core/src/main/java/org/eclipse/tycho/p2tools/copiedfromp2/DirectorApplication.java Lines 925 to 932 in 62f83cf
So in |
But this does not work if destination if a generic folder and one wants to use it on multiple platforms. |
But that is exactly the way the stand-alone director (called via eclipse-run / ant) used to work. Why would we want to change this behavior when called directly from tycho? |
Hard to tell but Tycho automatically detects this already for e.g. the p2 installed runtime in test so it seems at laest valid here as well. For example |
But that would mean that
stand-alone invocation, because tycho/tycho-core/src/main/java/org/eclipse/tycho/p2tools/copiedfromp2/DirectorApplication.java Lines 925 to 932 in 62f83cf
would never be hit anymore. I think this is a bit counter-intuitive. |
Also: tycho/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorRuntime.java Lines 81 to 86 in 62f83cf
currently hard-codes This does not work for custom products, eg. we are using <execution>
<id>run-director-mac</id>
<goals>
<goal>director</goal>
</goals>
<phase>package</phase>
<configuration>
<destination>target/ABAPDevelopmenTools.app</destination>
<p2os>macosx</p2os>
<p2ws>cocoa</p2ws>
<p2arch>x86_64</p2arch>
</configuration>
</execution> |
I'm not sure I really understand if it makes a difference where in Tycho code this check is performed, so maybe we should just remove that check altogether in DirectorApplication?
This should be covered by |
@sratz just a general comment, the main "issue" maybe is that there is only little documentation on the DirectorApp usage regarding mac and I just added it to be more convenient, but it seems you have some experience, so what do you think about we make
somehow required and if not given forcefully set it to the running environment? |
Well there are two options:
Yes, that's a great addition to Tycho and the original documentation is indeed lacking. So getting the original
This is relevant in case of option 1) above, in which case, yes, |
I think that sounds reasonable, do you like to add a testcase for the So to summarize I think as you suggested:
@sratz do you like to give it a try? |
Yes, that sounds good.
Yes, I'll provide a pull-request (or rather update #3549). |
Partially revert changes to destination handling from 3f41779 and dc99997 The helper methods in DirectorRuntime are removed again and the special handling in put back into AbstractEclipseTestMojo like before 3f41779. No pre-processing of the destination is done in DirectorMojo anymore: 1) Deriving the pre-processing path from the running environment was incorrect (it would have to consider 'p2os'). 2) We actually do not want any pre-procesing at all. This restores API compatibility of Tycho's tycho-p2-director:director with a legacy eclipse -application org.eclipse.equinox.p2.director -destination <destination> ... stand-alone invocation. This also adds a consistency check that p2os/p2ws/p2arch must all be specified if any of them is. Integration tests for the stand-alone director are added. Fixes eclipse-tycho#3548.
Partially revert changes to destination handling from 3f41779 and dc99997 The helper methods in DirectorRuntime are removed again and the special handling in put back into AbstractEclipseTestMojo like before 3f41779. No pre-processing of the destination is done in DirectorMojo anymore: 1) Deriving the pre-processing path from the running environment was incorrect (it would have to consider 'p2os'). 2) We actually do not want any pre-procesing at all. This restores API compatibility of Tycho's tycho-p2-director:director with a legacy eclipse -application org.eclipse.equinox.p2.director -destination <destination> ... stand-alone invocation. This also adds a consistency check that p2os/p2ws/p2arch must all be specified if any of them is. Integration tests for the stand-alone director are added. Fixes eclipse-tycho#3548.
* In DirectorMojo, the adjustment of 'destination' must consider the actual target environment (p2os/p2ws/p2arch parameters) that is to be installed and only fall back to the running environment if no explicit target environment is given. * Document in the tycho-p2-director:director JavaDoc / mojo parameter description that this intentionally deviates from the behavior of the stand-alone director application invocation: eclipse -application org.eclipse.equinox.p2.director -destination <destination> ... * In DirectorMojo, add a consistency check that p2os/p2ws/p2arch must all be specified mutually. * The helper methods in DirectorRuntime are extended, to properly handle all three possible scenarios: 1) /path/without/app/bundle/layout --> /path/without/app/bundle/layout/Eclipse.app/Contents/Eclipse 2) /path/to/real.app/Contents/Eclipse --> /path/to/real.app/Contents/Eclipse 3) /path/to/real.app --> /path/to/real.app/Contents/Eclipse This allows us to remove redundant code in ProvisionedInstallationBuilder. Fixes eclipse-tycho#3548.
* In DirectorMojo, the adjustment of 'destination' must consider the actual target environment (p2os/p2ws/p2arch parameters) that is to be installed and only fall back to the running environment if no explicit target environment is given. * Document in the tycho-p2-director:director JavaDoc / mojo parameter description that this intentionally deviates from the behavior of the stand-alone director application invocation: eclipse -application org.eclipse.equinox.p2.director -destination <destination> ... * In DirectorMojo, add a consistency check that p2os/p2ws/p2arch must all be specified mutually. * The helper methods in DirectorRuntime are extended, to properly handle all three possible scenarios: 1) /path/without/app/bundle/layout --> /path/without/app/bundle/layout/Eclipse.app/Contents/Eclipse 2) /path/to/real.app/Contents/Eclipse --> /path/to/real.app/Contents/Eclipse 3) /path/to/real.app --> /path/to/real.app/Contents/Eclipse This allows us to remove redundant code in ProvisionedInstallationBuilder. Fixes eclipse-tycho#3548.
* In DirectorMojo, the adjustment of 'destination' must consider the actual target environment (p2os/p2ws/p2arch parameters) that is to be installed and only fall back to the running environment if no explicit target environment is given. * Document in the tycho-p2-director:director JavaDoc / mojo parameter description that this intentionally deviates from the behavior of the stand-alone director application invocation: eclipse -application org.eclipse.equinox.p2.director -destination <destination> ... * In DirectorMojo, add a consistency check that p2os/p2ws/p2arch must all be specified mutually. * The helper methods in DirectorRuntime are extended, to properly handle all three possible scenarios: 1) /path/without/app/bundle/layout --> /path/without/app/bundle/layout/Eclipse.app/Contents/Eclipse 2) /path/to/real.app/Contents/Eclipse --> /path/to/real.app/Contents/Eclipse 3) /path/to/real.app --> /path/to/real.app/Contents/Eclipse This allows us to remove redundant code in ProvisionedInstallationBuilder. * This also removes the <installAllPlatforms> option again which was introduced in eclipse-tycho#3091 (606a087). This is not used in production and was not having the desired effect. This simplifies the handling in AbstractEclipseTestMojo / ProvisionedInstallationBuilder even more. Fixes eclipse-tycho#3548.
* In DirectorMojo, the adjustment of 'destination' must consider the actual target environment (p2os/p2ws/p2arch parameters) that is to be installed and only fall back to the running environment if no explicit target environment is given. * Document in the tycho-p2-director:director JavaDoc / mojo parameter description that this intentionally deviates from the behavior of the stand-alone director application invocation: eclipse -application org.eclipse.equinox.p2.director -destination <destination> ... * In DirectorMojo, add a consistency check that p2os/p2ws/p2arch must all be specified mutually. * The helper methods in DirectorRuntime are extended, to properly handle all three possible scenarios: 1) /path/without/app/bundle/layout --> /path/without/app/bundle/layout/Eclipse.app/Contents/Eclipse 2) /path/to/real.app/Contents/Eclipse --> /path/to/real.app/Contents/Eclipse 3) /path/to/real.app --> /path/to/real.app/Contents/Eclipse This allows us to remove redundant code in ProvisionedInstallationBuilder. * This also removes the <installAllPlatforms> option again which was introduced in #3091 (606a087). This is not used in production and was not having the desired effect. This simplifies the handling in AbstractEclipseTestMojo / ProvisionedInstallationBuilder even more. Fixes #3548. (cherry picked from commit b35d8e0)
* In DirectorMojo, the adjustment of 'destination' must consider the actual target environment (p2os/p2ws/p2arch parameters) that is to be installed and only fall back to the running environment if no explicit target environment is given. * Document in the tycho-p2-director:director JavaDoc / mojo parameter description that this intentionally deviates from the behavior of the stand-alone director application invocation: eclipse -application org.eclipse.equinox.p2.director -destination <destination> ... * In DirectorMojo, add a consistency check that p2os/p2ws/p2arch must all be specified mutually. * The helper methods in DirectorRuntime are extended, to properly handle all three possible scenarios: 1) /path/without/app/bundle/layout --> /path/without/app/bundle/layout/Eclipse.app/Contents/Eclipse 2) /path/to/real.app/Contents/Eclipse --> /path/to/real.app/Contents/Eclipse 3) /path/to/real.app --> /path/to/real.app/Contents/Eclipse This allows us to remove redundant code in ProvisionedInstallationBuilder. * This also removes the <installAllPlatforms> option again which was introduced in #3091 (606a087). This is not used in production and was not having the desired effect. This simplifies the handling in AbstractEclipseTestMojo / ProvisionedInstallationBuilder even more. Fixes #3548. (cherry picked from commit b35d8e0)
When
tycho-p2-director:director
is executed on macOS, the destination contains an additionalContents/Eclipse/
directory.This seems to have been introduced with dc99997:
tycho/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java
Line 364 in 62f83cf
But this is incorrect. The running environment is not relevant for the target destination.
I'll provide an extension to the existing integration test that should fail when the test itself is executed on macOS.
The text was updated successfully, but these errors were encountered: