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

DIRSTUDIO-1293 | Changes for native Apple Silicon M1 build #36

Merged
merged 1 commit into from Jun 9, 2023

Conversation

tied
Copy link
Contributor

@tied tied commented Jun 9, 2022

I'm not sure about these Eclipse targets and version numbers in general, but I've used the same approach for another project ) as I really need the tools and don't want to install Rosetta.

But with that change I'm able to build and use it without Rosetta :)

@MindTooth
Copy link

MindTooth commented Dec 26, 2022

Care to perhaps upstream this using the correct channels? 😄 Would love to see this being included in an official release.

@raydoom
Copy link

raydoom commented Feb 3, 2023

I apply you change, and get the error when mvn clean install

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.apache.directory.studio.aciitemeditor 2.0.0.qualifier
[ERROR]   Missing requirement: org.apache.directory.studio.ldapbrowser.core 2.0.0.qualifier requires 'osgi.bundle; org.apache.commons.commons-text 0.0.0' but it could not be found
[ERROR]   Cannot satisfy dependency: org.apache.directory.studio.aciitemeditor 2.0.0.qualifier depends on: osgi.bundle; org.apache.directory.studio.ldapbrowser.core 0.0.0
[ERROR] 
[ERROR] See https://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: org.apache.directory.studio:org.apache.directory.studio.aciitemeditor:2.0.0-SNAPSHOT @ /Users/maxd/work/git/directory-studio/plugins/aciitemeditor/pom.xml: See log for details -> [Help 1]

the official branch code is no error, @tied

@roubert
Copy link
Contributor

roubert commented May 14, 2023

I apply you change, and get the error when mvn clean install

I don't get this error that you got. I just now applied this change to my local repository and ran ./build.sh and it finished with a BUILD SUCCESS message, generating a new ApacheDirectoryStudio-2.0.0-SNAPSHOT-macosx.cocoa.aarch64.tar.gz archive which when unpacked and executed on my M1 Mac with macOS Ventura 13.3.1 (a) ran perfectly fine.

I don't know how this is all supposed to be done, whether this proposed solution with version="0.0.0" is really the preferred way of doing this, but as far as I can tell it works perfectly fine and solves the immediate problem of generating a binary that runs out-of-the-box on M1 hardware.

@roubert
Copy link
Contributor

roubert commented May 14, 2023

In case the maintainers would prefer to keep using explicit version numbers here (instead of version="0.0.0"), I've now prepared PR #43 which does that.

@raydoom
Copy link

raydoom commented Jun 9, 2023

first I only modify org.apache.directory.studio.eclipse-trgt-platform.template, It give me the error,
and now I modify org.apache.directory.studio.eclipse-trgt-platform.target and org.apache.directory.studio.eclipse-trgt-platform.template with the follow

      <unit id="org.eclipse.rcp.feature.group" version="4.24.0.v20220607-0700"/>
      <unit id="org.eclipse.rcp.source.feature.group" version="4.24.0.v20220607-0700"/>
      <unit id="org.eclipse.platform.feature.group" version="4.24.0.v20220607-0700"/>
      <unit id="org.eclipse.platform.source.feature.group" version="4.24.0.v20220607-0700"/>
      <unit id="org.eclipse.jdt.feature.group" version="3.18.1200.v20220607-0700"/>
      <unit id="org.eclipse.jdt.source.feature.group" version="3.18.1200.v20220607-0700"/>
      <unit id="org.eclipse.pde.feature.group" version="3.14.1200.v20220607-0700"/>
      <unit id="org.eclipse.pde.source.feature.group" version="3.14.1200.v20220607-0700"/>
      <unit id="org.eclipse.equinox.p2.user.ui.feature.group" version="2.4.1600.v20220518-1326"/>
      <unit id="org.eclipse.equinox.executable.feature.group" version="3.8.1700.v20220509-0833"/>
      <repository location="https://download.eclipse.org/eclipse/updates/4.24"/>

it works!

@elecharny elecharny merged commit da6c0c7 into apache:master Jun 9, 2023
@roubert
Copy link
Contributor

roubert commented Jun 9, 2023

I apply you change, and get the error when mvn clean install

I think I've figured out where your errors came from: After org.apache.directory.studio.eclipse-trgt-platform.template has been updated it's necessary to regenerate org.apache.directory.studio.eclipse-trgt-platform.target which should be done by running mvn -f pom-first.xml clean install. (This is done automatically if one runs build.sh, which probably is the reason for why no-one else has encountered those errors.)

@elecharny
Copy link
Contributor

Indeed, the build.sh script launch the mvn -f pom-first.xml clean install first then the mvn clean install.
If you start mvn -f pom-first.xml clean installalone, it will fail, because the targets have not been generated.
It's a bit cumbersome, but I believe Stefan hasn't found a better way.

Btw, the README.txt contains the instruction on how to build the project.

@FireBurn
Copy link

FireBurn commented Jul 6, 2023

I've tried building this from source and also applied #43 neither solved the issue of the missing JNI_CreateJavaVM symbol

@roubert
Copy link
Contributor

roubert commented Jul 6, 2023

This is unexpected. After build.sh has finished at current HEAD, you shoud get two products for macOS:

ApacheDirectoryStudio-2.0.0-SNAPSHOT-macosx.cocoa.aarch64.tar.gz
ApacheDirectoryStudio-2.0.0-SNAPSHOT-macosx.cocoa.x86_64.tar.gz

Do you get this? If not, what exactly do you get?

If you try to use either of those on the other kind of Apple hardware, you should get the JNI_CreateJavaVM error, but using the aarch64 one on Apple silicon is expected to work. Are you really using the right one?

@FireBurn
Copy link

FireBurn commented Jul 7, 2023

Thanks for pointing that out, I was using the dmg creator in "installers/macos/src/dmg" I thought it was a universal binary

I've edited that script to create an aarch64 dmg and it's all working great

@FireBurn
Copy link

Are there any plans do make a new release with this included?

@roubert
Copy link
Contributor

roubert commented Feb 14, 2024

Are there any plans do make a new release with this included?

Unfortunately I don't know anything about that, but I hope that an aarch64 build will be made for the next release, whenever that might happen.

@PierreSmits
Copy link
Member

Hi all,

I have created https://issues.apache.org/jira/browse/DIRSTUDIO-1319 to follow and work on. Let's continue the conversation there rather then continueing here on this merged pull request.

If you have any insights on what is needed to get this improvement implemented (and tested), please share those in the ticket.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants