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
Migrate equinox.security.win32 to JNA to enhance CPU-arch compatibility #564
Migrate equinox.security.win32 to JNA to enhance CPU-arch compatibility #564
Conversation
6445191
to
477d7e7
Compare
If the with that implied dependency to
As it was done in fdebce6, we could also retain the old fragment and require the new one using a p2.inf, but I hope that this is not necessary. |
477d7e7
to
39560a6
Compare
Great work in using JNA for the Are there any (existing) unit/integration tests for this security bundle? I see the
I really hope not, for sanity's sake. Seeing empty fragments lying around and contributing nothing is the most confusing aspect when working with Eclipse repositories. |
Thanks.
Does
The
Personally that's also my favorite solution, but we have to keep in mind existing users and should be gentle to them, but as written in my initial comment and if I'm not mistaken, there is probably not a case where the renaming of a fragment should break existing users since one has to re-build everything that can reference it any ways. |
39560a6
to
47c898b
Compare
I also checked if that fragment could be referenced as dependency in a feature and at least the PDE Feature editor does not permit that. I also analyzed the SimRel and nobody except the following three features in the Eclipse SDK seem to require that fragment:
The feature org.eclipse.equinox.core.sdk is adapted with this PR, Considering all that I think it is ok, to just rename the fragment. |
@chirontt btw. according to Wikipedia, JNA is in average ten times slower than JNI. This probably only refers to the invocation itself, but for invocations of short-running methods this is probably a show-stopper if it is performance critical. |
@HannesWell we might improve this in the future by using FFM API is crypt32.dll a standard Windows API or does it needs to be installed/included in the bundle? |
47c898b
to
dd0fe71
Compare
Absolutely.
As far as I can tell it is a standard Windows API and available by default on all Windows computers. |
This allows to use equinox.security.win32 also on aarch64 CPU-architectures and not only on x86_64. Rename the fragment from org.eclipse.equinox.security.win32.x86_64 to org.eclipse.equinox.security.win32 to reflect that it's not architecture specific anymore.
dd0fe71
to
1f2c66f
Compare
I don't want to discount the potential for FFM, but it is in preview for Java 21 so I don't think we can consider using it by default for a while yet until it is finalized. |
Yes, unfortunately FFM has been finalized only in Java 22. Given the FFM-API code necessary for this didn't change between 21 and 22, in general we could consider to use it with 21 already. Given we would agree that running Eclipse with But to come back to the topic of this PR: I have now tested this extensively running the a debugged secondary Eclipse and everything worked well. It wasn't that simple since there is no simple user of ISecurePreferences in the SDK but with some modification I could verify that existing an secure-storage on Windows can be read and new entries can be added. I also tried to rename the With all that, I think this is ready for submission. |
This was forgotten in PR eclipse-equinox#564
Now that the o.e.equinox.security.win32 fragment is architecture independent (because it is implemented through JNA) restricting it to one arch when including it in features is not necessary anymore. This was forgotten in PR eclipse-equinox#564
Now that the o.e.equinox.security.win32 fragment is architecture independent (because it is implemented through JNA) restricting it to one arch when including it in features is not necessary anymore. This was forgotten in PR eclipse-equinox#564
Now that the o.e.equinox.security.win32 fragment is architecture independent (because it is implemented through JNA) restricting it to one arch when including it in features is not necessary anymore. This was forgotten in PR #564
- eclipse-equinox/equinox#564 Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
- eclipse-equinox/equinox#564 Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
Migrate equinox.security.win32 to JNA to enhance CPI-arch compatibility, just like it is done for equinox.security.linux.
This simplifies the build and allows to use
equinox.security.win32
not only onx86_64
but also ARM CPUs, as it is required in #559.Use
Crypt32Util
class from jna.platform to get high-level java access toCrypt32.dll
respectively the methods defined indpapi.h
.Rename the fragment from
org.eclipse.equinox.security.win32.x86_64
toorg.eclipse.equinox.security.win32
to reflect that it's not architecture specific anymore. This should be a save change since fragments can only be referenced from products and features and not from other bundles (at least not by their symbolic name).Because features lock the bundle version one has to re-build the feature anyways to pick-up a new version and I think it is similar for plugin-based Products. One has to re-build them to pick-up a new version and then also also change the name.
The org.eclipse.equinox.p2.core.feature feature has to be adapted to the new name too.