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

Feature/newworkspace #6070

Merged
merged 5 commits into from Apr 4, 2024
Merged

Feature/newworkspace #6070

merged 5 commits into from Apr 4, 2024

Conversation

pkriens
Copy link
Member

@pkriens pkriens commented Apr 3, 2024

This is a rather large PR. It achieves the following:

  • Support for pmvn and pobr files. The pmvn is a MavenBndRepository mvn GAV file. If it is placed in the cnf/ext directory, it will get its own MavenBndRepository. A pobr file is an OSGi Repository XML file and with result in an OSGiRepository. This is based on new support where you can place a different typed file in the ext directory which is then translated to a set of properties that become part of build.bnd.
  • Minor update of utils
    • IO on Windows will properly handle paths with /C:/foo/bar or c:/foo/bar.
    • Added a NullAppendable
    • Minor tweaks in RE
  • Added a FragmentTemplateEngine to handle the complexity of fragment templates for workspaces
  • Added a NewBndWorkspaceWizard. The old one is deprecated but still available
  • Improved the startup, recognizing a new workspace.

---
 Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>

Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>
---
 Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>

Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>
---
 Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>

Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>
---
 Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>

Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>
---
 Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>

Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>
aQute.libg/src/aQute/lib/io/Other.java Dismissed Show dismissed Hide dismissed
aQute.libg/src/aQute/lib/io/Other.java Dismissed Show dismissed Hide dismissed
aQute.libg/src/aQute/lib/io/Windows.java Dismissed Show dismissed Hide dismissed
biz.aQute.bndlib/src/aQute/bnd/build/MagicBnd.java Dismissed Show dismissed Hide dismissed
@pkriens pkriens merged commit c9cb862 into bndtools:master Apr 4, 2024
8 of 10 checks passed
@pkriens pkriens deleted the feature/newworkspace branch April 4, 2024 14:37
@scottslewis
Copy link
Contributor

@pkriens I tried this out and wasn't able to get it to create/setup a bndtools workspace. Is that expected?

What's the expected timeline for introducing this...and deprecating workspace templates? Sometime after 7.1? Seems like it's a very big change to bndtools usage (as everyone has to make a bndtools workspace) to introduce.

Questions:

  1. You currently only seem to support Mvn repos and osgi repos (not p2 repos). Do you expect to support p2 repos also for workspace fragments?

  2. I don't understand how these workspace fragments will/might interact with each other. Isn't it possible for them to conflict and cause problems with each other?

@pkriens
Copy link
Member Author

pkriens commented Apr 8, 2024

@pkriens I tried this out and wasn't able to get it to create/setup a bndtools workspace. Is that expected?
Giving some diagnostic information would be appreciated ... It is a new feature, works for me, but it will likely require some debugging to make it work reliable for all envs. But then I need some info on your setup.

You currently only seem to support Mvn repos and osgi repos (not p2 repos). Do you expect to support p2 repos also for workspace fragments?
As far as I can see, p2 repos are just a url to an external repo or a full blown jar. If it is just a URL, it is easier to provide a bnd file in ext? If it is a full blown jar with a repo, we run into the problem that it is frowned upon to put jars in the git repos ... But I am open to proposals. The obr & mvn were a no brainer but I am more than open to extend this to other format

Yes, if you're not careful the fragments will clash. Before I commit the set of fragments to the new workspace, I do detect duplicates and will append them if allowed by the setup. I could go much more fancy but I'd like to get some feedback first. The javascript world seems to thrive by not making everything an unreadable UUID so I've deferred the counter measures for now. Making a fragment template is as far as I can see limited to a small set of people. And when you commit a PR, we can detect any conflicts. I do not expect lots of PRs (although I'd love to have that problem!)

The current workspaces are now deprecated because, as you pointed out so clearly, they did not work very well. However, I am easy to convince to keep them around. If I get push back I could add a first page to the wizard to select the classic workspace templates.

@scottslewis
Copy link
Contributor

@pkriens I tried this out and wasn't able to get it to create/setup a bndtools workspace. Is that expected?
Giving some diagnostic information would be appreciated ... It is a new feature, works for me, but it will likely require some debugging to make it work reliable for all envs. But then I need some info on your setup.

Running latest code in Eclipse 3.7 debugger

image

I click finish and Eclipse dies with nothing more than this in debug console output


Welcome to Apache Felix Gogo

g! setting Text {} C:\Users\slewi\workspace\untitled-0
2024-04-08 17:07:05,544 [HttpClient,https://raw.githubusercontent.com/bndtools/workspace-templates/master/index.bnd] INFO a.bnd.build.LoggingProgressPlugin - Download https://raw.githubusercontent.com/bndtools/workspace-templates/master/index.bnd
2024-04-08 17:08:22,914 [HttpClient,https://github.com/bndtools/workspace-templates/archive/master.zip] INFO a.bnd.build.LoggingProgressPlugin - Download https://github.com/bndtools/workspace-templates/archive/master.zip
2024-04-08 17:08:23,322 [HttpClient,https://codeload.github.com/bndtools/workspace-templates/zip/refs/heads/master] INFO a.bnd.build.LoggingProgressPlugin - Download https://codeload.github.com/bndtools/workspace-templates/zip/refs/heads/master

I did it a second time with this new workspace config

image

Finish doesn't crash eclipse, but this is output to log

2024-04-08 17:12:05,906 [HttpClient,https://github.com/bndtools/workspace-templates/archive/master.zip] INFO a.bnd.build.LoggingProgressPlugin - Download https://github.com/bndtools/workspace-templates/archive/master.zip
2024-04-08 17:12:06,242 [HttpClient,https://codeload.github.com/bndtools/workspace-templates/zip/refs/heads/master] INFO a.bnd.build.LoggingProgressPlugin - Download https://codeload.github.com/bndtools/workspace-templates/zip/refs/heads/master
2024-04-08 17:12:06,609 [HttpClient,https://github.com/bndtools/workspace-templates/archive/master.zip] INFO a.bnd.build.LoggingProgressPlugin - Download https://github.com/bndtools/workspace-templates/archive/master.zip
2024-04-08 17:12:06,695 [HttpClient,https://codeload.github.com/bndtools/workspace-templates/zip/refs/heads/master] INFO a.bnd.build.LoggingProgressPlugin - Download https://codeload.github.com/bndtools/workspace-templates/zip/refs/heads/master
2024-04-08 17:12:06,789 [HttpClient,https://github.com/bndtools/workspace-templates/archive/master.zip] INFO a.bnd.build.LoggingProgressPlugin - Download https://github.com/bndtools/workspace-templates/archive/master.zip
2024-04-08 17:12:06,876 [HttpClient,https://codeload.github.com/bndtools/workspace-templates/zip/refs/heads/master] INFO a.bnd.build.LoggingProgressPlugin - Download https://codeload.github.com/bndtools/workspace-templates/zip/refs/heads/master

And afaict no bndtools workspace was created...this is after the above completes (no errors reported)

image

You currently only seem to support Mvn repos and osgi repos (not p2 repos). Do you expect to support p2 repos also for workspace fragments?
As far as I can see, p2 repos are just a url to an external repo or a full blown jar. If it is just a URL, it is easier to provide a bnd file in ext? If it is a full blown jar with a repo, we run into the problem that it is frowned upon to put jars in the git repos ... But I am open to proposals. The obr & mvn were a no brainer but I am more than open to extend this to other format

I'm talking about being able to point to p2 repos in workspace template fragments (as I am currently with workspace templates). In an existing workspace template is this (in ext/defaults.bnd):

... (other maven repos)

-plugin.4.ECFRSSDK:
aQute.bnd.repository.p2.provider.P2Repository;
url = https://download.eclipse.org/rt/ecf/latest/site.p2;
name = ECF Remote Services SDK

-plugin.5.ECFGRPC:
aQute.bnd.repository.p2.provider.P2Repository;
url = https://raw.githubusercontent.com/ECF/grpc-RemoteServicesProvider/master/build/;
pretty = true;
name = ECF gRPC Distribution Provider

All I'm asking is that I be able to put the above into workspace template fragments. If this is already supported, great.

Yes, if you're not careful the fragments will clash. Before I commit the set of fragments to the new workspace, I do detect duplicates and will append them if allowed by the setup. I could go much more fancy but I'd like to get some feedback first. The javascript world seems to thrive by not making everything an unreadable UUID so I've deferred the counter measures for now. Making a fragment template is as far as I can see limited to a small set of people.

That's not what you intend is it? That is, it seems to me the whole reason for workspace template fragments is so that a more 'modular' approach to workspace templating can be used...making it easier with more reuse to be able to create workspace templates? I'll surely be able to work it out for my workspace template use case, but if you want others to use it/build upon it, I would think making it more usable than 'good luck' will be needed.

And when you commit a PR, we can detect any conflicts. I do not expect lots of PRs (although I'd love to have that problem!)

See above.

The current workspaces are now deprecated because, as you pointed out so clearly, they did not work very well. However, I am easy to convince to keep them around. If I get push back I could add a first page to the wizard to select the classic workspace templates.

I don't think it even makes sense to deprecate the existing workspace templates until the new mechanism is out, well-tested under actual usage conditions, by community, etc. Otherwise you are basically making it impossible to use bndtools at all for those that need to setup a bndtools workspace to begin with.

I would suggest leaving the existing mechanism in place for at least two minor releases.

@pkriens
Copy link
Member Author

pkriens commented Apr 9, 2024

If you run Eclipse in the bnd debugger, it exits on restart. This is because the debugger uses its own launcher. The Eclipse way of restarting is exiting the VM and the outer exe then restarts the VM. That said, even running it in a normal eclipse restarts correctly but it opens the old workspace. I use a mechanism suggested by ChatGPT(setting some system properties) but that does not work. Can't find any documentation about this so I have to debug further.

For the p2 repos/plugins, the old way works find as a bnd file in the ext directory. No change there. It was just that obr & mvn needed a bnd file and an index file, the pmvn and pobr merge this into a single file.

As I said already many times, the older mechanism will not disappear any time soon. Just want to push people in the direction of the fragments because I think they have many advantages. But the coming months we'll see.

@scottslewis
Copy link
Contributor

As I said already many times, the older mechanism will not disappear any time soon. Just want to push people in the direction of the fragments because I think they have many advantages. But the coming months we'll see.

I'll make you a deal on this: I have an existing workspace template for ECF remote services here: https://github.com/ECF/bndtools.workspace. I would like to refactor (by creating new repos) into 2 or more workspace template fragments, with the goal of ultimately contributing URLs to your newworkspace fragments list.

I would expect to base these template fragments on one or more of the 3 that are there already. We can use these workspace template fragments to test your newworkspace/template fragment mechanisms. And we can use the testing to identify the areas where merging or dependency problems might imply refactoring of the fragments or some tooling for preventing or dealing with fragment conflicts.

@pkriens
Copy link
Member Author

pkriens commented Apr 11, 2024

I will give it a go. Your ECF was on my mind for this.

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

2 participants