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

nix: fix shadow-cljs on M1 by upgrading to 2.11.16 #14199

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

jakubgs
Copy link
Member

@jakubgs jakubgs commented Oct 20, 2022

On M1 calling shadow-cljs fails with:

Execution error (UnsatisfiedLinkError) at java.lang.ClassLoader$NativeLibrary/load (ClassLoader.java:-2).
/private/var/folders/__/x311ykg17rqgq2wyl4kn1pdr0001yh/T/jna8753030888504535661.tmp:
    dlopen(/private/var/folders/__/x311ykg17rqgq2wyl4kn1pdr0001yh/T/jna8753030888504535661.tmp, 0x0001):
        tried: '/private/var/folders/__/x311ykg17rqgq2wyl4kn1pdr0001yh/T/jna8753030888504535661.tmp'
            (fat file, but missing compatible architecture (have (unknown,i386,x86_64), need (arm64e)))

This is due to an outdeted dependency on JNA 3.2.2, which is pulled in by hawk package which up until release 2.11.16 was a shadow-clj dependency which was removed because it was:

Only used to be used on macOS since it was slightly faster than the default JVM implementation. However in Big Sur it seems to cause issues and break completely or just be a lot slower.

thheller/shadow-cljs@f3b89b5a

Dropped the explicit dependency on org.clojure/core.async to avoid:

WARNING: The org.clojure/core.async dependency in shadow-cljs.edn was ignored.
Default version is used and override is not allowed to ensure compatibility.

Resolves: #14196

@jakubgs jakubgs requested a review from a team October 20, 2022 15:16
@jakubgs jakubgs self-assigned this Oct 20, 2022
@status-im-auto
Copy link
Member

status-im-auto commented Oct 20, 2022

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
2057060 #1 2022-10-20 15:21:21 ~4 min tests 📄log
2057060 #1 2022-10-20 15:27:16 ~10 min android 📄log
2057060 #1 2022-10-20 15:27:18 ~10 min android-e2e 📄log
✔️ 2057060 #1 2022-10-20 15:31:26 ~14 min ios 📦ipa 📲
✔️ 93f5b2e #2 2022-10-20 15:58:56 ~2 min tests 📦log
✔️ 93f5b2e #2 2022-10-20 16:04:20 ~8 min android 📦apk 📲
✔️ 93f5b2e #2 2022-10-20 16:04:21 ~8 min android-e2e 📦apk 📲
✔️ 93f5b2e #2 2022-10-20 16:08:56 ~13 min ios 📦ipa 📲

@jakubgs
Copy link
Member Author

jakubgs commented Oct 20, 2022

Looks like this upgrade won't be as simple as I was hoping for:

SHADOW import error /home/jenkins/workspace/status-mobile_prs_tests_PR-14199/target/test/cljs-runtime/status_im.utils.theme.js
/home/jenkins/workspace/status-mobile_prs_tests_PR-14199/target/test/test.js:67
    throw e;
    ^
TypeError: goog.isBoolean is not a function
    at oops$core$validate_object_access_dynamically (/home/jenkins/workspace/status-mobile_prs_tests_PR-14199/target/test/cljs-runtime/oops.core.js:114:26)
    at /home/jenkins/workspace/status-mobile_prs_tests_PR-14199/target/test/cljs-runtime/status_im.utils.theme.js:7:126
    at /home/jenkins/workspace/status-mobile_prs_tests_PR-14199/target/test/cljs-runtime/status_im.utils.theme.js:9:3
    at /home/jenkins/workspace/status-mobile_prs_tests_PR-14199/target/test/cljs-runtime/status_im.utils.theme.js:21:4
    at global.SHADOW_IMPORT (/home/jenkins/workspace/status-mobile_prs_tests_PR-14199/target/test/test.js:64:44)
    at /home/jenkins/workspace/status-mobile_prs_tests_PR-14199/target/test/test.js:1743:1
    at Object.<anonymous> (/home/jenkins/workspace/status-mobile_prs_tests_PR-14199/target/test/test.js:2482:3)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)

https://ci.status.im/blue/organizations/jenkins/status-mobile%2Fprs%2Ftests/detail/PR-14199/1/pipeline

EDIT: This was caused by use of ^ prefix on package.json which pulled in shadow-cljs version 2.20.5.

On M1 calling `shadow-cljs` fails with:
```
Execution error (UnsatisfiedLinkError) at java.lang.ClassLoader$NativeLibrary/load (ClassLoader.java:-2).
/private/var/folders/__/x311ykg17rqgq2wyl4kn1pdr0001yh/T/jna8753030888504535661.tmp:
    dlopen(/private/var/folders/__/x311ykg17rqgq2wyl4kn1pdr0001yh/T/jna8753030888504535661.tmp, 0x0001):
        tried: '/private/var/folders/__/x311ykg17rqgq2wyl4kn1pdr0001yh/T/jna8753030888504535661.tmp'
            (fat file, but missing compatible architecture (have (unknown,i386,x86_64), need (arm64e)))
```
This is due to an outdeted dependency on JNA 3.2.2, which is pulled in
by `hawk` package which up until release `2.11.16` was a `shadow-clj`
dependency which was removed because it was:

>Only used to be used on macOS since it was slightly faster than the default
>JVM implementation. However in Big Sur it seems to cause issues and break
>completely or just be a lot slower.

thheller/shadow-cljs@f3b89b5a

Dropped the explicit dependency on `org.clojure/core.async` to avoid:
```
WARNING: The org.clojure/core.async dependency in shadow-cljs.edn was ignored.
Default version is used and override is not allowed to ensure compatibility.
```

Resolves: #14196

Signed-off-by: Jakub Sokołowski <[email protected]>
@jakubgs jakubgs force-pushed the nix/fix-shadow-cljs-m1 branch from 2057060 to 93f5b2e Compare October 20, 2022 15:55
@jakubgs jakubgs merged commit 93f5b2e into develop Oct 20, 2022
@jakubgs jakubgs deleted the nix/fix-shadow-cljs-m1 branch October 20, 2022 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

shadow-cljs fails on M1 Macs due to missing architecture
3 participants