teesloane / firn

Org Mode Static Site Generator
Eclipse Public License 1.0
324 stars 24 forks source link

Container failing to launch due to missing shared library #70

Closed BobyMCbobs closed 3 years ago

BobyMCbobs commented 3 years ago

Recently the CI for my docs has broken.

The error:

$ firn build
Exception in thread "main" java.io.FileNotFoundException: /home/user/.firn/libfirn_parser.dylib (Permission denied)
    at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST:Ljava_io_FileNotFoundException_2_0002e_0003cinit_0003e_00028Ljava_lang_String_2Ljava_lang_String_2_00029V(JNIJavaCallWrappers.java:0)
    at java.io.FileOutputStream.open0(FileOutputStream.java)
    at java.io.FileOutputStream.open(FileOutputStream.java:298)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:237)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:187)
    at clojure.java.io$fn__11548.invokeStatic(io.clj:319)
    at clojure.java.io$fn__11548.invoke(io.clj:319)
    at clojure.lang.MultiFn.invoke(MultiFn.java:239)
    at clojure.java.io$copy.invokeStatic(io.clj:406)
    at clojure.java.io$copy.doInvoke(io.clj:391)
    at clojure.lang.RestFn.invoke(RestFn.java:425)
    at firn.core$init_BANG_.invokeStatic(core.clj:25)
    at firn.core$_main.invokeStatic(core.clj:95)
    at firn.core$_main.doInvoke(core.clj:89)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at firn.core.main(Unknown Source)

Has the name of the shared library been updated?

Also taking note that it's a macOS dylib, which is currently mistakenly referred to in the build stage https://github.com/theiceshelf/firn/blob/b60443a81180b181520f95736d4be9b7f91557f8/Dockerfile#L26

teesloane commented 3 years ago

Sorry 'bout that! Looks like the docker image is being built on PR's and https://github.com/theiceshelf/firn/pull/69 has posted the :latest image from the past CI automation. More incentive to figure out how to tag releases. Edit: just merged #69 - please let me know if things are up and running once the CI process on master has finished.

BobyMCbobs commented 3 years ago

Sorry 'bout that! Looks like the docker image is being built on PR's and #69 has posted the :latest image from the past CI automation.

Woohoo! glad to see you're giving the shared library a more suited name.

More incentive to figure out how to tag releases.

Release tag mapping to container tag would be wonderful

This should be fixed shortly when I merge in #69

Sweet as, thanks for your efforts :smiley:

BobyMCbobs commented 3 years ago

Using theiceshelf/firn@sha256:ea5da5997d18e32fe1653e22611304d53910db9510070747532fdca83d23344e which appears to be the latest according to https://hub.docker.com/r/theiceshelf/firn/tags?page=1&ordering=last_updated, I'm now getting almost the same error.

$ firn build
Exception in thread "main" java.io.FileNotFoundException: /home/user/.firn/libfirnparser.dylib (Permission denied)
    at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST:Ljava_io_FileNotFoundException_2_0002e_0003cinit_0003e_00028Ljava_lang_String_2Ljava_lang_String_2_00029V(JNIJavaCallWrappers.java:0)
    at java.io.FileOutputStream.open0(FileOutputStream.java)
    at java.io.FileOutputStream.open(FileOutputStream.java:298)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:237)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:187)
    at clojure.java.io$fn__11548.invokeStatic(io.clj:319)
    at clojure.java.io$fn__11548.invoke(io.clj:319)
    at clojure.lang.MultiFn.invoke(MultiFn.java:239)
    at clojure.java.io$copy.invokeStatic(io.clj:406)
    at clojure.java.io$copy.doInvoke(io.clj:391)
    at clojure.lang.RestFn.invoke(RestFn.java:425)
    at firn.core$init_BANG_.invokeStatic(core.clj:25)
    at firn.core$_main.invokeStatic(core.clj:95)
    at firn.core$_main.doInvoke(core.clj:89)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at firn.core.main(Unknown Source)
BobyMCbobs commented 3 years ago

This might be the fix: https://github.com/theiceshelf/firn/pull/71

teesloane commented 3 years ago

I believe we need that dylib compile flag with Graalvm; can you try pulling in again — I think it might have just took a second as the digest is now : 8eccd326b9825ce27ee8a8149896ce70a1df724d1ce58c96db6f6dce0af8b983?

BobyMCbobs commented 3 years ago

I believe we need that dylib compile flag with Graalvm; can you try pulling in again — I think it might have just took a second as the digest is now : 8eccd326b9825ce27ee8a8149896ce70a1df724d1ce58c96db6f6dce0af8b983?

Unfortunately, on theiceshelf/firn@sha256:8eccd326b9825ce27ee8a8149896ce70a1df724d1ce58c96db6f6dce0af8b983 it's got the same error

teesloane commented 3 years ago

Strange. I'm not sure what it is, because previously, having the flag included as mylib.dylib worked. The Dylib is needed so, I don't think we can remove the flag in #71; something else is going on...

BobyMCbobs commented 3 years ago

There appears to be a build dylib in clojure/resources/libfirnparser.dylib on the master branch. I copied it inside a live firn container as /home/user/.firn/libfirnparser.dylib with docker cp clojure/resources/libfirnparser.dylib friendly_chatterjee:/home/user/.firn/ and it's now working. That's weird that it's worked in the past, since it's never actually included it

teesloane commented 3 years ago

Oh, woops(?) In #69 I also I think I changed .gitignore to include the dylib as a vendored thing. I imagine it will be overwritten at compile time.

Sorry for the bumps - I am trying to do some cleanup and don't use docker a ton. I'll put up a PR shortly to change the CI process with a tagging mechanism and tag you on it if you don't mind. It might not be convenient as I won't be releasing 0.13 for some time, so hopefully you can keep using a specific docker image until it's working?

BobyMCbobs commented 3 years ago

Oh, woops(?) In #69 I also I think I changed .gitignore to include the dylib as a vendored thing. I imagine it will be overwritten at compile time.

It happens. Should be!

Sorry for the bumps - I am trying to do some cleanup and don't use docker a ton. I'll put up a PR shortly to change the CI process with a tagging mechanism and tag you on it if you don't mind. It might not be convenient as I won't be releasing 0.13 for some time, so hopefully you can keep using a specific docker image until it's working?

That's OK, with the tagging we'll be able to get it to a place of stability and allowing for disruption. This looks like what we wanna do: https://github.com/docker/build-push-action#handle-tags-and-labels

BobyMCbobs commented 3 years ago

It appears to not actually use /home/user/.firn/libfirnparser.dylib, since when I make an empty file with that name it runs normally.

I can use this as a hot fix

teesloane commented 3 years ago

Strange. I will have to investigate what is going on behind the scenes. Docker support will likely be unstable for an unknown time, but I will try and ping you when I release next so it can be tested if you like.