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

Sign macOS binaries so that they work on Apple Silicon machines. #116

Merged
merged 1 commit into from Nov 22, 2021

Conversation

charleskorn
Copy link
Contributor

Resolves jnr/jnr-ffi#257.

An ad-hoc signature seems to be sufficient based on reports from users in batect/batect#963.

Signature can be verified with codesign -dv build/jni/libjffi-1.2.jnilib.

charleskorn added a commit to batect/batect that referenced this pull request Nov 21, 2021
…e Silicon machines.

This can be reverted once jnr/jnr-ffi#257 is
resolved (likely with jnr/jffi#116).

See #963.
@headius
Copy link
Member

headius commented Nov 22, 2021

Let's go with this for now and I can look into a proper signature once we have the right mojo in place.

@headius headius merged commit 95dddcf into jnr:master Nov 22, 2021
@headius headius added this to the 1.3.7 milestone Nov 22, 2021
@headius
Copy link
Member

headius commented Nov 22, 2021

I'll spin releases of JNR today.

@headius
Copy link
Member

headius commented Nov 23, 2021

Ugh... of course I should have rebuilt the Darwin binary. I will try to get to a new release before Thanksgiving (US), but not sure I will be able to do so.

charleskorn added a commit to batect/batect that referenced this pull request Nov 23, 2021
… libjffi on Apple Silicon machines.""

This reverts commit 7eabe8d.

See jnr/jffi#116 (comment)
@mikeclarke
Copy link

@headius will the rebuilt Darwin binary be released as a new minor release on maven (1.3.8)? thanks!

@headius
Copy link
Member

headius commented Dec 1, 2021

@mikeclarke Yup, doing that now.

@headius headius modified the milestones: 1.3.7, 1.3.8 Dec 1, 2021
headius added a commit that referenced this pull request Dec 1, 2021
@headius
Copy link
Member

headius commented Dec 1, 2021

I have released jffi 1.3.8 with the rebuilt and signed binary. Please confirm?

@mikeclarke
Copy link

@headius i could be missing something, but it looks like the 1.3.7 release had a jffi-1.3.7-native.jar that contained the shared libraries for all platforms, but that isn't appearing in the 1.3.8 release (so I'm now hitting an error with 1.3.8 java.lang.UnsatisfiedLinkError: could not locate stub library in jar file. Tried [jni/Darwin/libjffi-1.2.dylib, /jni/Darwin/libjffi-1.2.dylib]).

@headius
Copy link
Member

headius commented Dec 2, 2021

@mikeclarke Hmm, nothing should have changed in the 1.3.8 build. I just checked maven central and the native jar is there with all the binaries in it.

https://repo1.maven.org/maven2/com/github/jnr/jffi/1.3.8/

[] /tmp/jffi $ jar xvf ~/Downloads/jffi-1.3.8-native.jar 
  created: META-INF/
 inflated: META-INF/MANIFEST.MF
  created: jni/
  created: jni/x86_64-SunOS/
 inflated: jni/x86_64-SunOS/libjffi-1.2.so
  created: jni/arm-Linux/
 inflated: jni/arm-Linux/libjffi-1.2.so
  created: jni/i386-Linux/
 inflated: jni/i386-Linux/libjffi-1.2.so
  created: jni/sparcv9-Linux/
 inflated: jni/sparcv9-Linux/libjffi-1.2.so
  created: jni/x86_64-DragonFlyBSD/
 inflated: jni/x86_64-DragonFlyBSD/libjffi-1.2.so
  created: jni/ppc64-Linux/
 inflated: jni/ppc64-Linux/libjffi-1.2.so
  created: jni/ppc64le-Linux/
 inflated: jni/ppc64le-Linux/libjffi-1.2.so
  created: jni/x86_64-Linux/
 inflated: jni/x86_64-Linux/libjffi-1.2.so
  created: jni/ppc-AIX/
 inflated: jni/ppc-AIX/libjffi-1.2.a
  created: jni/i386-Windows/
 inflated: jni/i386-Windows/jffi-1.2.dll
  created: jni/x86_64-Windows/
 inflated: jni/x86_64-Windows/jffi-1.2.dll
  created: jni/aarch64-FreeBSD/
 inflated: jni/aarch64-FreeBSD/libjffi-1.2.so
  created: jni/x86_64-OpenBSD/
 inflated: jni/x86_64-OpenBSD/libjffi-1.2.so
  created: jni/Darwin/
 inflated: jni/Darwin/libjffi-1.2.jnilib
  created: jni/i386-SunOS/
 inflated: jni/i386-SunOS/libjffi-1.2.so
  created: jni/aarch64-Linux/
 inflated: jni/aarch64-Linux/libjffi-1.2.so
  created: jni/mips64el-Linux/
 inflated: jni/mips64el-Linux/libjffi-1.2.so
  created: jni/x86_64-FreeBSD/
 inflated: jni/x86_64-FreeBSD/libjffi-1.2.so
  created: jni/sparcv9-SunOS/
 inflated: jni/sparcv9-SunOS/libjffi-1.2.so
  created: jni/ppc64-AIX/
 inflated: jni/ppc64-AIX/libjffi-1.2.a
  created: jni/s390x-Linux/
 inflated: jni/s390x-Linux/libjffi-1.2.so

[] /tmp/jffi $ ls -lR jni/Darwin/
total 664
-rw-r--r--  1 headius  wheel  337808 Dec  1 03:37 libjffi-1.2.jnilib

@headius
Copy link
Member

headius commented Dec 2, 2021

I checked 1.3.7 and the files there are the same, including the jnilib extension. I'm not sure where the dylib search is coming from but nothing appears to have changed here between 1.3.7 and 1.3.8.

@mikeclarke
Copy link

I checked 1.3.7 and the files there are the same, including the jnilib extension. I'm not sure where the dylib search is coming from but nothing appears to have changed here between 1.3.7 and 1.3.8.

you're right, this was my fault (I was checking my local .m2 directory and seeing something unexpected). upgrading to latest jnr-ffi‎ 2.2.10 which now includes jffi 1.3.8 fixed the issue I was seeing - thanks so much!

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.

mac m1 + code signing == failure
3 participants