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

Move the tycho-version into the maven.config and unify build arguments #848

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

HannesWell
Copy link
Contributor

This avoids duplicated specification of build parameters in the different builds.

However I'm a bit concerned because now if one runs the build locally test failures and errors do not let the build fail and one has to look it up on the console.

Alternatively we could use --fail-at-end, but then only projects are build that don't depend on the failed once. On the other hand, a test project should not have dependents? So probably that would be the better option.

.gitmodules Outdated Show resolved Hide resolved
@HannesWell
Copy link
Contributor Author

Oh and it looks like M2E does not consider the maven.config and therefore shows many errors like this
org.eclipse.tycho:tycho-source-plugin:jar:${tycho-version} was not found ...

I think this is #274 and should not be too hard now?

@github-actions
Copy link

github-actions bot commented Jul 9, 2022

Unit Test Results

596 tests   590 ✔️  8m 27s ⏱️
  94 suites      6 💤
  94 files        0

Results for commit d52b667.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@mickaelistria mickaelistria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's actually an improvement. Many settings in the script are fine for CI but undesired for a local build (because the test failure/error needs to be visible on a local build).

@HannesWell
Copy link
Contributor Author

I don't think it's actually an improvement. Many settings in the script are fine for CI but undesired for a local build (because the test failure/error needs to be visible on a local build).

That's right, but therefore I replaced the ignore.failure/error properties by '--fail-at-end' which seems suitable in both cases.

@laeubi
Copy link
Member

laeubi commented Jul 11, 2022

--fail-at-endis not the same as ignoring test-failures, this is usually used to record all tests but let the build succeed to validate the test results at another stage.

--fail-at-end will fail, but also continue the build if there are compile errors in some modules.

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

Test Results

  214 files  ±0    214 suites  ±0   22m 20s ⏱️ + 5m 41s
  664 tests ±0    654 ✅ ±0  10 💤 ±0  0 ❌ ±0 
1 328 runs  ±0  1 306 ✅ ±0  22 💤 ±0  0 ❌ ±0 

Results for commit 2351c6d. ± Comparison against base commit 946c118.

♻️ This comment has been updated with latest results.

.mvn/maven.config Outdated Show resolved Hide resolved
@laeubi
Copy link
Member

laeubi commented Mar 6, 2023

FYI I have adjusted the build here:

so maybe the both approaches should be merged.

@HannesWell
Copy link
Contributor Author

so maybe the both approaches should be merged.

Merged your changes to and move the specification of the maven.test.error/failure.ignore properties to the CI scripts so that local builds can fail.

@HannesWell
Copy link
Contributor Author

@laeubi I lost a bit track of your work in regards to support properties in the maven.config and are therefore not sure if it is supposed to work now? When I prepared the update to this PR m2e did not complain in my m2e-dev workspace so I assume this can be merged as soon as we agree upon it?

@HannesWell HannesWell marked this pull request as ready for review March 8, 2023 22:32
@laeubi
Copy link
Member

laeubi commented Mar 9, 2023

Status is it should work in all relevant cases but not sure about leminx and maybe there are still some areas uncovered :-D

@HannesWell HannesWell force-pushed the simplifyBuild branch 2 times, most recently from 66c24b4 to 0cf7b90 Compare July 30, 2023 18:38
@HannesWell
Copy link
Contributor Author

Status is it should work in all relevant cases but not sure about leminx and maybe there are still some areas uncovered :-D

OK, I can get my workspace into a state where at least m2e shows no errors about a missing tycho.version property.
But as soon as I open a pom, the language server complains about a missing version.

@mickaelistria could you help add support for maven.configs in the language server?
Would it be sufficient to adjust the InitializationOptionsProvider respectively the MavenRuntimeClasspathProvider?
I belive some parts of the magic could happen in.

LanguageServers.forProject(null).withPreferredServer(definition).excludeInactive()
.collectAll((w, ls) -> CompletableFuture.completedFuture(ls)).thenAccept(lss -> lss.stream()
.forEach(ls -> ls.getWorkspaceService().didChangeConfiguration(params)));

Move specification of the -Dmaven.test.error/failure.ignore=true
properties to the build files again, so that local builds can fail.
@HannesWell
Copy link
Contributor Author

Now that we have #1692, we can finally use this.
When trying this out locally I noticed that changes in the maven.config are not immediately picked up by the LS (at least when I hover over the tycho-version property the old value is present).

In m2e internally it seems to work, at least the effective pom shows the updated version.

@HannesWell HannesWell added this to the 2.6.0 milestone Feb 20, 2024
@laeubi
Copy link
Member

laeubi commented Feb 20, 2024

You need to edit the file to get the changes reflected I think, or the LS must watch the file for changes but as one no really change this very often I think it is acceptable and the same will happen if you for example change a parent pom file that is currently not opened as a file in the editor.

@mickaelistria is there a way m2e can tell the language server to flush its cache?

@mickaelistria
Copy link
Contributor

is there a way m2e can tell the language server to flush its cache?

No, and as mentioned in previous discussion, the goal is that m2e decides smartly and automatically when to flush its cache by monitoring all the files that participate to resolution (including maven.config) and flush the cache on changes, like it already does for pom.xml files; without involving the client.

@laeubi
Copy link
Member

laeubi commented Feb 20, 2024

No, and as mentioned in previous discussion, the goal is that m2e decides smartly and automatically when to flush its cache by monitoring all the files that participate to resolution (including maven.config) and flush the cache on changes

I assume you mean lemminx? Where is this "automatic watching" implemented in lemminx? The main point is if two components watching files this double work can maybe avoided.

@mickaelistria
Copy link
Contributor

Indeed, I mean lemminx*=maven*. There is no automatic watching implemeted in lemminx-maven at the moment, because LSP sends notifications for changed files that the clients configures as supported by this LS (currently only pom.xml files).

The main point is if two components watching files this double work can maybe avoided.

lemminx-maven work at best on its own without m2e. If this means duplicated work from m2e to lemminx-maven, then it's worth it.

@HannesWell HannesWell changed the title Introduce maven.config to unify/simplify the build arguments Move the tycho-version into the maven.config and unify build arguments Feb 20, 2024
@HannesWell
Copy link
Contributor Author

HannesWell commented Feb 20, 2024

The main point is if two components watching files this double work can maybe avoided.

lemminx-maven work at best on its own without m2e. If this means duplicated work from m2e to lemminx-maven, then it's worth it.

If there is a way to share things between m2e and the LSP I would consider it an advantage if this means less CPU-cycles are burned on a users computer and less memory is used. And having duplicated implementations is something I personally consider relatively bad and would only choose as last or at least later resort. I understand that the LemMinX-LSP want's to be standalone, but I still see an advantage in the things said before. Probably a good compromise has to be found.
I guess m2e can somehow poke the LSP using the approach asked in #848 (comment), can't it?

Anyways I think it would be best to discuss enhancements of the LSP integration in a dedicated ticket.

Now that #1692 is integrated and tested, we can finally eat our own dog-food and use this in m2e after only 146 builds in Jenkins.

@HannesWell HannesWell merged commit 369b34f into eclipse-m2e:master Feb 20, 2024
6 of 7 checks passed
@HannesWell HannesWell deleted the simplifyBuild branch February 20, 2024 17:43
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 this pull request may close these issues.

None yet

3 participants