status-react/nix/deps/clojure
Jakub Sokołowski 93f5b2e32c
nix: fix shadow-cljs on M1 by upgrading to 2.11.16
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.

https://github.com/thheller/shadow-cljs/commit/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: https://github.com/status-im/status-mobile/issues/14196

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-10-20 17:54:02 +02:00
..
README.md rename status-react to status-mobile 2022-07-17 14:46:16 +02:00
default.nix rename status-react to status-mobile 2022-07-17 14:46:16 +02:00
deps.json nix: fix shadow-cljs on M1 by upgrading to 2.11.16 2022-10-20 17:54:02 +02:00
deps.list nix: fix shadow-cljs on M1 by upgrading to 2.11.16 2022-10-20 17:54:02 +02:00
generate.sh nix: add missing cljfmt dependencies to nix/deps/clojure 2021-03-01 16:42:38 +01:00

README.md

Description

This folder contains the scripts and Nix derivations necessary to generate Clojure dependencies for this project.

Usage

Running generate.sh in a shell that has available shadow-cljs and clojure should update the deps.list and deps.json files.

Details

By using the following command:

shadow-cljs classpath --force-spawn

We both download the necessary JARs and POMs into ~/.m2 folder, but also get the classpath printed into standard output.

We then use the classpath in combination with contents of ~/.m2 folder to generate the following files:

  • deps.list - List of JARs relative to the ~/.m2 cache folder.
  • deps.json - Full list of JARs and POMs including their SHAs.

The deps.list file is just intermediate and for debugging purposes. The deps.json is loaded by the derivation in default.nix and used to produce a derivation that contains all the necessary dependencies:

 > grep cljfmt nix/deps/clojure/deps.list
cljfmt/cljfmt/0.6.7/cljfmt-0.6.7.jar

 > nix-build --no-out-link -A pkgs.deps.clojure
/nix/store/d7p8r9vhq6z2jmxwakxpcb262wgkc86s-status-mobile-clojure-deps

 > DEPS=$(nix-build --no-out-link -A pkgs.deps.clojure)                              

 > find $DEPS -iname 'cljfmt-0.6.7.*'
/nix/store/d7p...86s-status-mobile-clojure-deps/cljfmt/cljfmt/0.6.7/cljfmt-0.6.7.pom.sha1
/nix/store/d7p...86s-status-mobile-clojure-deps/cljfmt/cljfmt/0.6.7/cljfmt-0.6.7.pom
/nix/store/d7p...86s-status-mobile-clojure-deps/cljfmt/cljfmt/0.6.7/cljfmt-0.6.7.jar.sha1
/nix/store/d7p...86s-status-mobile-clojure-deps/cljfmt/cljfmt/0.6.7/cljfmt-0.6.7.jar