Open hookyAt opened 2 years ago
@hookyAt can you debug this and provide a patch? I don't have a mac at hand for development/testing. I think this could also be the cause for this one:
@laeubi I can try. Maybe you can point me in the right direction. OSGI is still a wondrous thing for me.
As a first step you can cehckout tycho sourceode and start maven with mvnDebug clean install
then set a breakpoint in the TychoSurefireMojo and see what happens (or not happens) regarding copy the files on windows versus what happens on mac.
Beside that you can try to create a minimal reproducer project that shows the issue so we can take a look at a live example.
Missing file and settings from org.eclipse.jdt.core.prefs
Are you seeing an error that the compiler settings could not be found during the build?
Actually no. It finds and uses the expected settings.
[DEBUG] Manifest BREEs: [OSGi profile 'JavaSE-11' { source level: 11, target level: 11}]
[DEBUG] Target Platform EE: OSGi profile 'JavaSE-11' { source level: 11, target level: 11}
[DEBUG] Effective source/target: 11/11
[DEBUG] Using compiler 'jdt'.
The only thing is, an eclipse-test-plugin only runs org.eclipse.tycho:tycho-compiler-plugin:2.5.0:compile
.
While an eclipse-plugin runs both org.eclipse.tycho:tycho-compiler-plugin:2.5.0:compile
and org.eclipse.tycho:tycho-compiler-plugin:2.5.0:testCompile
But that is the same behavior on linux and mac.
So I finally managed to build a small example and debug it on Linux.
What I see is, the file target/work/data/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs
is created in the execute Method of AbstractTestMojo#runTest:
private void runTest(EquinoxInstallation testRuntime) throws MojoExecutionException, MojoFailureException {
int result;
File logFile = new File(osgiDataDirectory, ".metadata/.log");
LaunchConfiguration cli;
try {
if (deleteOsgiDataDirectory) {
FileUtils.deleteDirectory(osgiDataDirectory);
}
cli = createCommandLine(testRuntime);
getLog().info("Executing Test Runtime with timeout " + forkedProcessTimeoutInSeconds
+ ", logs (if any) will be placed at: " + logFile.getAbsolutePath());
result = launcher.execute(cli, forkedProcessTimeoutInSeconds);
} catch (Exception e) {
throw new MojoExecutionException("Error while executing platform", e);
}
So I debugged the EquinoxLauncher or more specific the OsgiSurefireBooter#run And again the file is crated in the invokeProvider method which delegates to the maven surefire plugin.
RunResult result = ProviderFactory.invokeProvider(null, createCombinedClassLoader(testPlugin), reporterFactory,
providerConfiguration, false, startupConfiguration, true);
So I would say this is not a Tycho Bug, but somewhere in osgi or equinox.
Who else would unpack prefs files in a directory called .metadata/.plugins/org.eclipse.core.runtime/.settings
?
@hookyAt maybe the https://accounts.eclipse.org/mailing-list/equinox-dev would be a good place to ask for help on this then.
Hi, our tycho build runs great under windows and linux, but on Mac OSX certain tests fail. In those tests we parse Java-Files with the eclipse emf plug-In.
The error messages in the log file (target/work/data/.metadata/.log:) says like:
While comparing the linux workspace with the mac workspace, I found that the settings for the source level is in
target/work/data/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs
. That file is missing in the Mac OSX workspace.Missing file and settings from org.eclipse.jdt.core.prefs
Also when using the command line from the maven output for the org.eclipse.tycho.surefire.osgibooter.headlesstest the Tests fail. But when the org.eclipse.jdt.core.prefs is copied, from linux to mac, the tests runs without problems.
We use BREE and the toolchains.xml is correct.
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537) Maven home: /opt/apache-maven-3.8.4 Java version: 11.0.13, vendor: Eclipse Adoptium, runtime: /opt/jdk-11.0.13+8/Contents/Home Default locale: de_AT, platform encoding: UTF-8 OS name: "mac os x", version: "12.1", arch: "x86_64", family: "mac"
Used Tycho 2.5.0 and 2.6.0 Tried with target platform 2019-03 and 2021-12
Log output, ommited a few lines:
Complete log: tycho.surefire.log.zip