cryogen-project / cryogen

A simple static site generator written in Clojure
http://cryogenweb.org/
Eclipse Public License 1.0
1.1k stars 96 forks source link

Unable to load library 'Carbon' #218

Closed jacekschae closed 4 years ago

jacekschae commented 4 years ago

Seems like with update to newest macOS Big Sur the /System/Library/Frameworks/Carbon.framework is not working. When you start a new project:

~ $ lein new cryogen my-blog
~ $ cd my-blog
~/my-blog $ lein ring server
2020-07-06 13:52:34.745:INFO::main: Logging initialized @1035ms
loading module: Flexmark parser
compiling assets...
compiling sass
copying theme resources
     themes/blue/css --> public/blog/css
     themes/blue/js --> public/blog/js
     themes/blue/html/404.html --> public/blog/404.html
copying resources
     content/img --> public/blog/img
     content/md/posts --> public/blog/posts
     content/md/pages --> public/blog/pages
compiling pages
--> /blog/pages-output/about/
--> /blog/pages-output/another-page/
compiling posts
--> /blog/posts-output/2016-01-07-docs/
--> /blog/posts-output/2014-11-04-second-post/
--> /blog/posts-output/2014-03-10-first-post/
compiling tags
--> /blog/tags-output/cryogen/
--> /blog/tags-output/very fetch/
--> /blog/tags-output/not fetch/
compiling tags page
compiling index
compiling archives
generating authors views
compiling authors
--> /blog/authors-output/Bob Bobbert/
generating site map
generating main rss
generating filtered rss
    --> /blog/cryogen.xml
"Elapsed time: 508.405309 msecs"
Exception in thread "main" Syntax error compiling at (/private/var/folders/sn/ghv7jdx906vf42xc_njg7dn40000gn/T/form-init16798120602090615094.clj:1:126).
    at clojure.lang.Compiler.load(Compiler.java:7647)
    at clojure.lang.Compiler.loadFile(Compiler.java:7573)
    at clojure.main$load_script.invokeStatic(main.clj:452)
    at clojure.main$init_opt.invokeStatic(main.clj:454)
    at clojure.main$init_opt.invoke(main.clj:454)
    at clojure.main$initialize.invokeStatic(main.clj:485)
    at clojure.main$null_opt.invokeStatic(main.clj:519)
    at clojure.main$null_opt.invoke(main.clj:516)
    at clojure.main$main.invokeStatic(main.clj:598)
    at clojure.main$main.doInvoke(main.clj:561)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.lang.Var.applyTo(Var.java:705)
    at clojure.main.main(main.java:37)
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'Carbon': dlopen(libCarbon.dylib, 9): image not found
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)
    at com.sun.jna.Library$Handler.<init>(Library.java:140)
    at com.sun.jna.Native.loadLibrary(Native.java:372)
    at com.sun.jna.Native.loadLibrary(Native.java:357)
    at com.barbarysoftware.jna.CarbonAPI.<clinit>(CarbonAPI.java:6)
    at com.barbarysoftware.jna.CFStringRef.toCFString(CFStringRef.java:10)
    at com.barbarysoftware.watchservice.MacOSXListeningWatchService.register(MacOSXListeningWatchService.java:30)
    at com.barbarysoftware.watchservice.WatchableFile.register(WatchableFile.java:30)
    at com.barbarysoftware.watchservice.WatchableFile.register(WatchableFile.java:39)
    at hawk.watcher$fn__133.invokeStatic(watcher.clj:102)
    at hawk.watcher$fn__133.invoke(watcher.clj:99)
    at hawk.watcher$fn__38$G__29__47.invoke(watcher.clj:24)
    at hawk.core$watch_BANG_.invokeStatic(core.clj:83)
    at hawk.core$watch_BANG_.doInvoke(core.clj:59)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at cryogen_core.watcher$start_watcher_BANG_.invokeStatic(watcher.clj:35)
    at cryogen_core.watcher$start_watcher_BANG_.invoke(watcher.clj:31)
    at cryogen.server$init.invokeStatic(server.clj:18)
    at cryogen.server$init.invoke(server.clj:14)
    at clojure.lang.Var.invoke(Var.java:380)
    at ring.server.standalone$serve.invokeStatic(standalone.clj:96)
    at ring.server.standalone$serve.doInvoke(standalone.clj:75)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at ring.server.leiningen$serve.invokeStatic(leiningen.clj:19)
    at ring.server.leiningen$serve.invoke(leiningen.clj:16)
    at user$eval12427.invokeStatic(form-init16798120602090615094.clj:1)
    at user$eval12427.invoke(form-init16798120602090615094.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:7176)
    at clojure.lang.Compiler.eval(Compiler.java:7166)
    at clojure.lang.Compiler.load(Compiler.java:7635)
    ... 12 more
Subprocess failed (exit code: 1)

I don't know if this helps in shadow-cljs you can work around this be setting a flag in the shadow-cljs.edn

:fs-watch {:hawk false}

hawk is the file watching lib used on macOS because the jvm default is "slow"

Keep in mind that this issue appears on macOS beta, and it might be different for public release.

lacarmen commented 4 years ago

Cloesd by cryogen-project/cryogen-core#144

jacekschae commented 4 years ago

Thanks!

lacarmen commented 4 years ago

@jacekschae @sankara I will push out an update to clojars sometime this week! Waiting on another PR first.

alexander-yakushev commented 2 months ago

I started getting this error again on MacOS Sonoma 14.6.1 with M1 processor. Here's the complete exception:

#error {
 :cause "/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp: dlopen(/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp, 0x0001): tried: '/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (no such file), '/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64'))"
 :via
 [{:type java.lang.UnsatisfiedLinkError
   :message "/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp: dlopen(/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp, 0x0001): tried: '/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (no such file), '/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64'))"
   :at [jdk.internal.loader.NativeLibraries load "NativeLibraries.java" -2]}]
 :trace
 [[jdk.internal.loader.NativeLibraries load "NativeLibraries.java" -2]
  [jdk.internal.loader.NativeLibraries$NativeLibraryImpl open "NativeLibraries.java" 331]
  [jdk.internal.loader.NativeLibraries loadLibrary "NativeLibraries.java" 197]
  [jdk.internal.loader.NativeLibraries loadLibrary "NativeLibraries.java" 139]
  [java.lang.ClassLoader loadLibrary "ClassLoader.java" 2399]
  [java.lang.Runtime load0 "Runtime.java" 852]
  [java.lang.System load "System.java" 2030]
  [com.sun.jna.Native loadNativeDispatchLibraryFromClasspath "Native.java" 906]
  [com.sun.jna.Native loadNativeDispatchLibrary "Native.java" 881]
  [com.sun.jna.Native <clinit> "Native.java" 156]
  [com.barbarysoftware.jna.CarbonAPI <clinit> "CarbonAPI.java" 6]
  [com.barbarysoftware.jna.CFStringRef toCFString "CFStringRef.java" 10]
  [com.barbarysoftware.watchservice.MacOSXListeningWatchService register "MacOSXListeningWatchService.java" 30]
  [com.barbarysoftware.watchservice.WatchableFile register "WatchableFile.java" 30]
  [com.barbarysoftware.watchservice.WatchableFile register "WatchableFile.java" 39]
  [hawk.watcher$fn__133 invokeStatic "watcher.clj" 102]
  [hawk.watcher$fn__133 invoke "watcher.clj" 99]
  [hawk.watcher$fn__38$G__29__47 invoke "watcher.clj" 24]
  [hawk.core$watch_BANG_ invokeStatic "core.clj" 83]
  [hawk.core$watch_BANG_ doInvoke "core.clj" 59]
  [clojure.lang.RestFn applyTo "RestFn.java" 139]
  [clojure.core$apply invokeStatic "core.clj" 669]
  [clojure.core$apply invoke "core.clj" 662]
  [cryogen_core.watcher$watch_with_fallback_BANG_ invokeStatic "watcher.clj" 36]
  [cryogen_core.watcher$watch_with_fallback_BANG_ doInvoke "watcher.clj" 31]
  [clojure.lang.RestFn invoke "RestFn.java" 423]
  [cryogen_core.watcher$start_watcher_for_changes_BANG_ invokeStatic "watcher.clj" 52]
  [cryogen_core.watcher$start_watcher_for_changes_BANG_ doInvoke "watcher.clj" 41]
  [clojure.lang.RestFn invoke "RestFn.java" 445]
  [cryogen_core.watcher$start_watcher_BANG_ invokeStatic "watcher.clj" 58]
  [cryogen_core.watcher$start_watcher_BANG_ invoke "watcher.clj" 55]
  [generator.watch$init invokeStatic "watch.clj" 16]
  [generator.watch$init invoke "watch.clj" 9]
  [clojure.lang.Var invoke "Var.java" 384]
  [clojure.run.exec$exec invokeStatic "exec.clj" 89]
  [clojure.run.exec$exec invoke "exec.clj" 78]
  [clojure.run.exec$_main$fn__287 invoke "exec.clj" 228]
  [clojure.run.exec$_main invokeStatic "exec.clj" 224]
  [clojure.run.exec$_main doInvoke "exec.clj" 192]
  [clojure.lang.RestFn invoke "RestFn.java" 397]
  [clojure.lang.AFn applyToHelper "AFn.java" 152]
  [clojure.lang.RestFn applyTo "RestFn.java" 132]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.main$main_opt invokeStatic "main.clj" 514]
  [clojure.main$main_opt invoke "main.clj" 510]
  [clojure.main$main invokeStatic "main.clj" 664]
  [clojure.main$main doInvoke "main.clj" 616]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.main main "main.java" 40]]} "WARN - no native fs events; falling back to polling filesystem"
#error {
 :cause "Exception java.lang.UnsatisfiedLinkError: /private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp: dlopen(/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp, 0x0001): tried: '/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (no such file), '/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')) [in thread \"main\"]"
 :via
 [{:type java.lang.NoClassDefFoundError
   :message "Could not initialize class com.barbarysoftware.jna.CarbonAPI"
   :at [com.barbarysoftware.jna.CFStringRef toCFString "CFStringRef.java" 10]}
  {:type java.lang.ExceptionInInitializerError
   :message "Exception java.lang.UnsatisfiedLinkError: /private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp: dlopen(/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp, 0x0001): tried: '/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (no such file), '/private/var/folders/zy/3gfxx9h1355dgvtkcyz2stc40000gn/T/jna-2996766/jna6487982472884405313.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')) [in thread \"main\"]"
   :at [jdk.internal.loader.NativeLibraries load "NativeLibraries.java" -2]}]
 :trace
 [[jdk.internal.loader.NativeLibraries load "NativeLibraries.java" -2]
  [jdk.internal.loader.NativeLibraries$NativeLibraryImpl open "NativeLibraries.java" 331]
  [jdk.internal.loader.NativeLibraries loadLibrary "NativeLibraries.java" 197]
  [jdk.internal.loader.NativeLibraries loadLibrary "NativeLibraries.java" 139]
  [java.lang.ClassLoader loadLibrary "ClassLoader.java" 2399]
  [java.lang.Runtime load0 "Runtime.java" 852]
  [java.lang.System load "System.java" 2030]
  [com.sun.jna.Native loadNativeDispatchLibraryFromClasspath "Native.java" 906]
  [com.sun.jna.Native loadNativeDispatchLibrary "Native.java" 881]
  [com.sun.jna.Native <clinit> "Native.java" 156]
  [com.barbarysoftware.jna.CarbonAPI <clinit> "CarbonAPI.java" 6]
  [com.barbarysoftware.jna.CFStringRef toCFString "CFStringRef.java" 10]
  [com.barbarysoftware.watchservice.MacOSXListeningWatchService register "MacOSXListeningWatchService.java" 30]
  [com.barbarysoftware.watchservice.WatchableFile register "WatchableFile.java" 30]
  [com.barbarysoftware.watchservice.WatchableFile register "WatchableFile.java" 39]
  [hawk.watcher$fn__133 invokeStatic "watcher.clj" 102]
  [hawk.watcher$fn__133 invoke "watcher.clj" 99]
  [hawk.watcher$fn__38$G__29__47 invoke "watcher.clj" 24]
  [hawk.core$watch_BANG_ invokeStatic "core.clj" 83]
  [hawk.core$watch_BANG_ doInvoke "core.clj" 59]
  [clojure.lang.RestFn applyTo "RestFn.java" 139]
  [clojure.core$apply invokeStatic "core.clj" 669]
  [clojure.core$apply invoke "core.clj" 662]
  [cryogen_core.watcher$watch_with_fallback_BANG_ invokeStatic "watcher.clj" 36]
  [cryogen_core.watcher$watch_with_fallback_BANG_ doInvoke "watcher.clj" 31]
  [clojure.lang.RestFn invoke "RestFn.java" 423]
  [cryogen_core.watcher$start_watcher_for_changes_BANG_ invokeStatic "watcher.clj" 52]
  [cryogen_core.watcher$start_watcher_for_changes_BANG_ doInvoke "watcher.clj" 41]
  [clojure.lang.RestFn invoke "RestFn.java" 445]
  [cryogen_core.watcher$start_watcher_BANG_ invokeStatic "watcher.clj" 58]
  [cryogen_core.watcher$start_watcher_BANG_ invoke "watcher.clj" 55]
  [generator.watch$init invokeStatic "watch.clj" 16]
  [generator.watch$init invoke "watch.clj" 9]
  [clojure.lang.Var invoke "Var.java" 384]
  [clojure.run.exec$exec invokeStatic "exec.clj" 89]
  [clojure.run.exec$exec invoke "exec.clj" 78]
  [clojure.run.exec$_main$fn__287 invoke "exec.clj" 228]
  [clojure.run.exec$_main invokeStatic "exec.clj" 224]
  [clojure.run.exec$_main doInvoke "exec.clj" 192]
  [clojure.lang.RestFn invoke "RestFn.java" 397]
  [clojure.lang.AFn applyToHelper "AFn.java" 152]
  [clojure.lang.RestFn applyTo "RestFn.java" 132]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.main$main_opt invokeStatic "main.clj" 514]
  [clojure.main$main_opt invoke "main.clj" 510]
  [clojure.main$main invokeStatic "main.clj" 664]
  [clojure.main$main doInvoke "main.clj" 616]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.main main "main.java" 40]]} "WARN - no native fs events; falling back to polling filesystem"