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

Extend demo bnd-workspace with subbundles #4661

Conversation

chrisrueger
Copy link
Contributor

@chrisrueger chrisrueger commented Jan 30, 2025

see the bnd.bnd of the new tycho.demo.markdown bundle.
it uses the -sub: *.bnd instruction to create 2 jar files based on the other .bnd files (api.bnd and impl.bnd)

this build currently fails (which is intentional) and we want to use that to fix tycho to make it compile.
It seems that tycho currently does not recognize the 2 (sub) jars so it cannot find them as dependencies for the HelloWorldService

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-bnd-plugin:4.0.10:compile (compile) on project tycho.demo.impl: javac failed /bnd-workspace/tycho.demo.impl/src/main/java/org/eclipse/tycho/demo/impl/HelloWorldService.java:18: error: package tycho.demo.utils.markdown.api does not exist
[ERROR] import tycho.demo.utils.markdown.api.MarkdownRenderer;
[ERROR]                                     ^
[ERROR] /bnd-workspace/tycho.demo.impl/src/main/java/org/eclipse/tycho/demo/impl/HelloWorldService.java:24: error: cannot find symbol
[ERROR]     private MarkdownRenderer markdown;
[ERROR]             ^
[ERROR]   symbol:   class MarkdownRenderer
[ERROR]   location: class HelloWorldService
[ERROR] 2 errors

Expected result

The build should have produced two jars in tycho.demo.markdown

  • tycho.demo.markdown.api.jar
  • tycho.demo.markdown.impl.jar

And those should be recognized as dependency as required by the -buildpath of the tycho.demo.impl/bnd.bnd, so that tycho.demo.impl compiles successfully.

Copy link
Member

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

Thanks for enhancing the example, we need some license headers on the java code and it would be good to squash all into one commit (it is the easier to later cherry pick/backport the test).

@chrisrueger chrisrueger force-pushed the extend-demo-bndworkspace-with-subbundles branch from de5eba7 to 9cb9035 Compare January 30, 2025 17:30
@chrisrueger chrisrueger force-pushed the extend-demo-bndworkspace-with-subbundles branch from 638c519 to 641e7d0 Compare January 31, 2025 09:04
@chrisrueger chrisrueger force-pushed the extend-demo-bndworkspace-with-subbundles branch from 32d9b76 to 41ce326 Compare January 31, 2025 17:12
@laeubi laeubi added the backport-to-tycho-4.0.x Can be added to a PR to trigger an automatic backport of the change label Jan 31, 2025
@chrisrueger
Copy link
Contributor Author

chrisrueger commented Jan 31, 2025

I can confirm that #4666 fixes the build of demo/bnd-workspace in this PR

Note to self:

  1. Build tycho from PR Add support for building sub-bundle with tycho-bnd-extension #4666 with: mvn clean install -T1C -DskipTests
  2. switch to this PR and build it with
cd demo/bnd-workspace
mvn clean install -Dtycho-version=5.0.0-SNAPSHOT
[INFO] Reactor Summary for bnd-parent 1.0.0-SNAPSHOT:
[INFO] 
[INFO] bnd-parent ......................................... SUCCESS [  0.059 s]
[INFO] tycho.demo.api ..................................... SUCCESS [  0.987 s]
[INFO] tycho.demo.markdown ................................ SUCCESS [  0.908 s]
[INFO] tycho.demo.impl .................................... SUCCESS [  0.769 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.616 s
[INFO] Finished at: 2025-01-31T20:25:59+01:00
[INFO] ------------------------------------------------------------------------

@laeubi
Copy link
Member

laeubi commented Feb 1, 2025

This now has failed the DemoTest#testTychoBndWorkspaceDemo in the CI as expected 👍

@chrisrueger can you please:

  1. rebase the PR on current main
  2. shorten / cleanup the commit message a bit, it currently contains some intermediate comments and we don't need the detailed failure description I think

If that is done the test should be green again and we can already merge this!

@chrisrueger
Copy link
Contributor Author

chrisrueger commented Feb 1, 2025

@laeubi will do.
Question: Which version should I put in .mvn/maven.config
-Dtycho-version=4.0.11
or
-Dtycho-version=5.0.0-SNAPSHOT

?

@laeubi
Copy link
Member

laeubi commented Feb 1, 2025

Use the current released version: -Dtycho-version=4.0.10 in the build this will be overridden by 5.0.0-SNAPSHOT or 4.0.11-SNAPSHOT (depending on branch).

@chrisrueger chrisrueger force-pushed the extend-demo-bndworkspace-with-subbundles branch from 41ce326 to 8ffc3aa Compare February 1, 2025 06:36
see the bnd.bnd of the new tycho.demo.markdown bundle.
it uses the -sub: *.bnd instruction to create 2 jar files based on the other .bnd files (api.bnd and impl.bnd)

Co-Authored-By: Christoph Läubrich <[email protected]>
@chrisrueger chrisrueger force-pushed the extend-demo-bndworkspace-with-subbundles branch from 8ffc3aa to 9cbd37d Compare February 1, 2025 06:38
@laeubi laeubi enabled auto-merge (rebase) February 1, 2025 09:11
@laeubi laeubi merged commit 6d565f3 into eclipse-tycho:main Feb 1, 2025
14 checks passed
@eclipse-tycho-bot
Copy link

💚 All backports created successfully

Status Branch Result
tycho-4.0.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@laeubi
Copy link
Member

laeubi commented Feb 1, 2025

@chrisrueger thanks for enhancing the example!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-tycho-4.0.x Can be added to a PR to trigger an automatic backport of the change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants