Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Update packages for compatibility with macOS 11 Big Sur
Browse files Browse the repository at this point in the history
Summary:
# Context

macOS 11 adopts the [dyld shared cache](https://iphonedevwiki.net/index.php/Dyld_shared_cache) which means that the system libraries do not actually exist on the filesystem. This broke JNA and it was fixed in late June 2020 ([issue#1215](java-native-access/jna#1215)).

# Changes

Because we have other third-party JARs which depend on JNA, we had to update those. In summary, we updated all of the following modules:

- JNA
- nailgun
- NuProcess
- oshi
- Java Obj-C Bridge

Reviewed By: blackm00n

fbshipit-source-id: f29c775912ac3a84ec5615f6999b7bccf212ead7
  • Loading branch information
milend authored and facebook-github-bot committed Sep 29, 2020
1 parent bae1f42 commit a2912b9
Show file tree
Hide file tree
Showing 48 changed files with 119 additions and 53 deletions.
14 changes: 7 additions & 7 deletions .idea/libraries/buck_lib.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions .idea/libraries/jna.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions .idea/libraries/jna_platform.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions build.xml
Expand Up @@ -126,9 +126,9 @@
<include name="jackson/jackson-module-kotlin-2.9.9.jar" />
<include name="kotlin/kotlin-reflect.jar" />
<include name="android/sdklib-25.3.0.jar" />
<include name="nailgun/nailgun-server-1.0.0.jar" />
<include name="jna/jna-4.5.1.jar" />
<include name="jna/jna-platform-4.5.1.jar" />
<include name="nailgun/nailgun-server-1.0.1.jar" />
<include name="jna/jna-5.6.0.jar" />
<include name="jna/jna-platform-5.6.0.jar" />
<include name="sqlite/sqlite-jdbc-3.20.0.jar" />
<include name="remote-apis/remote-apis.jar" />
</fileset>
Expand All @@ -141,7 +141,7 @@

<fileset dir="${third-party.dir}/java" id="third-party.jars">
<patternset refid="third-party.jars.private"/>
<include name="ObjCBridge/ObjCBridge.jar" />
<include name="ObjCBridge/java-objc-bridge-1.1-SNAPSHOT.jar" />
<include name="aapt2-proto/aapt2-proto-0.4.0.jar" />
<include name="android/common-25.3.0.jar" />
<include name="android/layoutlib-api-25.3.0.jar" />
Expand Down Expand Up @@ -204,14 +204,14 @@
<include name="kotlinx-metadata-jvm/kotlinx-metadata-jvm-0.1.0.jar" />
<include name="jsr/javax.inject-1.jar" />
<include name="jsr/jsr305.jar" />
<include name="nuprocess/nuprocess-1.2.4.jar" />
<include name="nuprocess/nuprocess-2.0.1.jar" />
<include name="objenesis/objenesis-1.2.jar" />
<include name="okhttp/okhttp-3.11.0.jar" />
<include name="okhttp/okhttp-tls-3.11.0.jar" />
<include name="okio/okio-1.13.0.jar" />
<include name="opencensus/opencensus-api-0.24.0.jar" />
<include name="opencensus/opencensus-contrib-grpc-metrics-0.24.0.jar" />
<include name="oshi/oshi-core-3.3-SNAPSHOT.jar" />
<include name="oshi/oshi-core-5.2.5.jar" />
<include name="pf4j/pf4j-2.0.0-SNAPSHOT.jar" />
<include name="protobuf/protobuf-java-3.7.0.jar" />
<include name="protobuf/protobuf-java-util-3.7.0.jar" />
Expand Down
12 changes: 6 additions & 6 deletions programs/classpaths
Expand Up @@ -59,20 +59,20 @@ third-party/java/jackson/jackson-datatype-jdk8-2.9.7.jar
third-party/java/jackson/jackson-module-kotlin-2.9.9.jar
third-party/java/jdom/jdom-2.0.6.jar
third-party/java/jetty/jetty-all-9.4.9.v20180320-uber.jar
third-party/java/jna/jna-4.5.1.jar
third-party/java/jna/jna-platform-4.5.1.jar
third-party/java/jna/jna-5.6.0.jar
third-party/java/jna/jna-platform-5.6.0.jar
third-party/java/jopt-simple/jopt-simple-4.6.jar
third-party/java/json-simple/json-simple-1.1.1.jar
third-party/java/jsr/javax.inject-1.jar
third-party/java/jsr/jsr305.jar
third-party/java/kxml2/kxml2-2.3.0.jar
third-party/java/nailgun/nailgun-server-1.0.0.jar
third-party/java/nuprocess/nuprocess-1.2.4.jar
third-party/java/ObjCBridge/ObjCBridge.jar
third-party/java/nailgun/nailgun-server-1.0.1.jar
third-party/java/nuprocess/nuprocess-2.0.1.jar
third-party/java/ObjCBridge/java-objc-bridge-1.1-SNAPSHOT.jar
third-party/java/objenesis/objenesis-1.2.jar
third-party/java/okhttp/okhttp-3.9.0.jar
third-party/java/okio/okio-1.13.0.jar
third-party/java/oshi/oshi-core-3.3-SNAPSHOT.jar
third-party/java/oshi/oshi-core-5.2.5.jar
third-party/java/opencensus/opencensus-api-0.24.0.jar
third-party/java/opencensus/opencensus-contrib-grpc-metrics-0.24.0.jar
third-party/java/pf4j/pf4j-2.0.0-SNAPSHOT.jar
Expand Down
2 changes: 1 addition & 1 deletion src/com/facebook/buck/cli/BuckDaemon.java
Expand Up @@ -48,7 +48,7 @@ public final class BuckDaemon {
*
* <p>See: https://github.com/java-native-access/jna/issues/652
*/
public static final int JNA_POINTER_SIZE = Pointer.SIZE;
public static final int JNA_POINTER_SIZE = Native.POINTER_SIZE;

private static final int AFTER_COMMAND_AUTO_GC_DELAY_MS = 5000;
private static final int SUBSEQUENT_GC_DELAY_MS = 10000;
Expand Down
4 changes: 2 additions & 2 deletions src/com/facebook/buck/cli/MainRunner.java
Expand Up @@ -241,7 +241,7 @@
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.sun.jna.Pointer;
import com.sun.jna.Native;
import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.FileNotFoundException;
Expand Down Expand Up @@ -294,7 +294,7 @@ public final class MainRunner {
*
* <p>See: https://github.com/java-native-access/jna/issues/652
*/
public static final int JNA_POINTER_SIZE = Pointer.SIZE;
public static final int JNA_POINTER_SIZE = Native.POINTER_SIZE;

private static final Optional<String> BUCKD_LAUNCH_TIME_NANOS =
Optional.ofNullable(System.getProperty("buck.buckd_launch_time_nanos"));
Expand Down
2 changes: 1 addition & 1 deletion src/com/facebook/buck/util/ProcessHelper.java
Expand Up @@ -68,7 +68,7 @@ public static ProcessHelper getInstance() {
try {
LOG.verbose("Getting process tree...");
OperatingSystem os = OSHI.getOperatingSystem();
OSProcess[] processes = os.getProcesses(100, OperatingSystem.ProcessSort.NEWEST);
List<OSProcess> processes = os.getProcesses(100, OperatingSystem.ProcessSort.NEWEST);
for (OSProcess process : processes) {
tree.add(process);
}
Expand Down
3 changes: 2 additions & 1 deletion third-party/java/ObjCBridge/BUCK
@@ -1,9 +1,10 @@
prebuilt_jar(
name = "ObjCBridge",
binary_jar = "ObjCBridge.jar",
binary_jar = "java-objc-bridge-1.1-SNAPSHOT.jar",
licenses = [
"LICENSE",
],
source_jar = "java-objc-bridge-1.1-SNAPSHOT-sources.jar",
visibility = ["PUBLIC"],
deps = [
"//third-party/java/jna:jna",
Expand Down
Binary file removed third-party/java/ObjCBridge/ObjCBridge.jar
Binary file not shown.
14 changes: 12 additions & 2 deletions third-party/java/ObjCBridge/README.facebook
@@ -1,6 +1,16 @@
Project: Java Objective-C Bridge
Version: Git revision c22107743c2751f1fbaef3f509d59683f16adb60
Release Date: 2014-08-06
Version: Git revision c38d607820e18bdc607067457ba6680a6277f7cd
Release Date: Sun Nov 3 19:35:06 2019 +0100
Website: https://github.com/shannah/Java-Objective-C-Bridge/
License: Apache 2.0
Description: JNA library to allow Java programs to invoke Objective-C APIs
Instructions:
brew install maven
brew install gpg
gpg --gen-key
git clone https://github.com/shannah/Java-Objective-C-Bridge.git
cd Java-Objective-C-Bridge
Edit pom.xml (or apply patch.diff)
Change <maven.compiler.target> to version 8
Change <maven.compiler.source> to version 8
mvn clean install -Drelease=true
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified third-party/java/ObjCBridge/libjcocoa.dylib
Binary file not shown.
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.libjcocoa.dylib</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
Binary file not shown.
27 changes: 27 additions & 0 deletions third-party/java/ObjCBridge/patch.diff
@@ -0,0 +1,27 @@
diff --git a/pom.xml b/pom.xml
index 76d7547..50fef9a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,8 +40,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <maven.compiler.target>11</maven.compiler.target>
- <maven.compiler.source>11</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+ <maven.compiler.source>8</maven.compiler.source>
<xcodeScheme>Debug</xcodeScheme>
</properties>

diff --git a/src/main/java/ca/weblite/objc/Proxy.java b/src/main/java/ca/weblite/objc/Proxy.java
index 0654519..7aba1f5 100644
--- a/src/main/java/ca/weblite/objc/Proxy.java
+++ b/src/main/java/ca/weblite/objc/Proxy.java
@@ -501,7 +501,6 @@ public class Proxy implements Peerable {
*/
@Override
public String toString(){
- System.out.println("The peer is "+getPeer());
if ( getPeer() == null ){
return "null";
}
8 changes: 4 additions & 4 deletions third-party/java/jna/BUCK
@@ -1,19 +1,19 @@
prebuilt_jar(
name = "jna",
binary_jar = "jna-4.5.1.jar",
binary_jar = "jna-5.6.0.jar",
licenses = [
"LICENSE",
],
source_jar = "jna-4.5.1-sources.jar",
source_jar = "jna-5.6.0-sources.jar",
visibility = ["PUBLIC"],
)

prebuilt_jar(
name = "jna-platform",
binary_jar = "jna-platform-4.5.1.jar",
binary_jar = "jna-platform-5.6.0.jar",
licenses = [
"LICENSE",
],
source_jar = "jna-platform-4.5.1-sources.jar",
source_jar = "jna-platform-5.6.0-sources.jar",
visibility = ["PUBLIC"],
)
4 changes: 2 additions & 2 deletions third-party/java/jna/README.facebook
Expand Up @@ -2,6 +2,6 @@ README for JNA

URL: https://github.com/java-native-access/jna
Downloaded From:
http://central.maven.org/maven2/net/java/dev/jna/jna/4.5.1/
http://central.maven.org/maven2/net/java/dev/jna/jna-platform/4.5.1/
https://search.maven.org/artifact/net.java.dev.jna/jna/5.6.0/jar
https://search.maven.org/artifact/net.java.dev.jna/jna-platform/5.6.0/jar
License: Apache 2.0 and LPGL 2.1 dual license
Binary file removed third-party/java/jna/jna-4.5.1-sources.jar
Binary file not shown.
Binary file removed third-party/java/jna/jna-4.5.1.jar
Binary file not shown.
Binary file added third-party/java/jna/jna-5.6.0-javadoc.jar
Binary file not shown.
Binary file added third-party/java/jna/jna-5.6.0-sources.jar
Binary file not shown.
Binary file added third-party/java/jna/jna-5.6.0.jar
Binary file not shown.
Binary file removed third-party/java/jna/jna-platform-4.5.1-sources.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions third-party/java/nailgun/BUCK
@@ -1,10 +1,10 @@
prebuilt_jar(
name = "nailgun",
binary_jar = "nailgun-server-1.0.0.jar",
binary_jar = "nailgun-server-1.0.1.jar",
licenses = [
"LICENSE",
],
source_jar = "nailgun-server-1.0.0-sources.jar",
source_jar = "nailgun-server-1.0.1-sources.jar",
visibility = [
"//src/com/facebook/buck/cli:cli",
"//src/com/facebook/buck/cli/exceptions/handlers:handlers",
Expand Down
7 changes: 4 additions & 3 deletions third-party/java/nailgun/README.txt
@@ -1,7 +1,8 @@
nailgun-server-1.0.0.jar and nailgun-server-1.0.0-sources.jar were
built from https://github.com/facebook/nailgun
Repository: https://github.com/facebook/nailgun
URL: https://search.maven.org/artifact/com.facebook/nailgun-server/1.0.1/jar
Version: 1.0.1

To regenerate these jars:
Build Instructions:

0) install maven (brew install maven)
1) git clone https://github.com/facebook/nailgun
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions third-party/java/nuprocess/BUCK
@@ -1,10 +1,10 @@
prebuilt_jar(
name = "nuprocess",
binary_jar = "nuprocess-1.2.4.jar",
binary_jar = "nuprocess-2.0.1.jar",
licenses = [
"LICENSE",
],
source_jar = "nuprocess-1.2.4-sources.jar",
source_jar = "nuprocess-2.0.1-sources.jar",
visibility = ["PUBLIC"],
deps = [
"//third-party/java/jna:jna",
Expand Down
8 changes: 5 additions & 3 deletions third-party/java/nuprocess/README.facebook
@@ -1,6 +1,8 @@
README for NuProcess

URL: https://github.com/brettwooldridge/NuProcess
Revision: 562e0b39cd893ca389ba2d0b3689dde305b7632d
Built With: mvn package
Repository: https://github.com/brettwooldridge/NuProcess
URL: https://search.maven.org/artifact/com.zaxxer/nuprocess/2.0.1/bundle
Version: 2.01
Build Instructions:
mvn package
License: Apache 2.0 license
Binary file not shown.
Binary file removed third-party/java/nuprocess/nuprocess-1.2.4.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added third-party/java/nuprocess/nuprocess-2.0.1.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions third-party/java/oshi/BUCK
@@ -1,10 +1,10 @@
prebuilt_jar(
name = "oshi-core",
binary_jar = "oshi-core-3.3-SNAPSHOT.jar",
binary_jar = "oshi-core-5.2.5.jar",
licenses = [
"LICENSE.html",
],
source_jar = "oshi-core-3.3-SNAPSHOT-sources.jar",
source_jar = "oshi-core-5.2.5-sources.jar",
visibility = ["PUBLIC"],
deps = [
"//third-party/java/jna:jna",
Expand Down
7 changes: 4 additions & 3 deletions third-party/java/oshi/README.facebook
@@ -1,8 +1,9 @@
README for OSHI

URL: https://github.com/oshi/oshi/commit/e51f8e84f20bc4b132aa02601a4760b20bd4a198
Version: 3.3-SNAPSHOT e51f8e84f20bc4b132aa02601a4760b20bd4a198
Built with:
Repository: https://github.com/oshi/oshi
URL: https://search.maven.org/artifact/com.github.oshi/oshi-core/5.2.5/jar
Version: 5.2.5
Build Instructions:
mvn package
mvn source:jar
License: Eclipse Public License v1.0
Binary file not shown.
Binary file removed third-party/java/oshi/oshi-core-3.3-SNAPSHOT.jar
Binary file not shown.
Binary file added third-party/java/oshi/oshi-core-5.2.5-javadoc.jar
Binary file not shown.
Binary file not shown.
Binary file added third-party/java/oshi/oshi-core-5.2.5.jar
Binary file not shown.

0 comments on commit a2912b9

Please sign in to comment.