clj-easy / graal-docs

Scripts and tips to get Clojure latest working with GraalVM latest
Eclipse Public License 1.0
387 stars 20 forks source link

Mention how to apply xattr to downloaded GraalVM #54

Open borkdude opened 3 years ago

borkdude commented 3 years ago

Normally I set GRAALVM_HOME to my downloaded GraalVM installation which currently looks like: /Users/borkdude/Downloads/graalvm-ce-java11-21.2.0/Contents/Home. Since Big Sur I need to apply sudo xattr -r -d com.apple.quarantine to the GraalVM installation to remove the quarantine attribute. But this does not work when you pass include Contents/Home: pass the part without it, like:

sudo xattr -r -d com.apple.quarantine $GRAALVM_HOME/../..

or

sudo xattr -r -d com.apple.quarantine /Users/borkdude/Downloads/graalvm-ce-java11-21.2.0/Contents/Home
borkdude commented 3 years ago

Actually the above is wrong, you should (according to a GraalVM slack user):

xattr -c download.file.tar.gz"

and then extract the file.

sogaiu commented 3 years ago

According to an online xattr man page for macos:

Clear all attributes including their associated values:
      xattr -c [-rsv] file ...

So I guess this gets rid of the quarantine attribute but any others as well. No clue whether there are usually any other ones.

borkdude commented 3 years ago

@sogaiu Perhaps it works like this, but I'm not sure:

When extracting a tar.gz the files inside the tar.gz inherit the attributes from the tar.gz file?

How else can macOS place these attributes on files inside a tar.gz file? Does it process the tar.gz file while downloading and rewrites all files inside of it? Not sure!

borkdude commented 3 years ago

It seems that's how it works if the information on this website is correct:

https://www.advsofteng.com/macos_unquarantine.html

sogaiu commented 3 years ago

Nice find!