Closed jirir closed 3 years ago
If you have Ruby installed, the notebook system currently requires rouge to be installed (bin/gem install rouge) for syntax highlighting. We should turn this into a soft dependency at some point and hint the user to install rouge somehow.
I did sudo gem install rogue
from the Terminal but the error is still there. Perhaps rogue
has to be installed somehow into the grallvm ..?
You must use the "gem" binaries that comes with installing TruffleRuby, which is right next to bin/trufflesqueak.
Even after
/Applications/graalvm/graalvm-ce-java11-20.2.0/Contents/Home/bin/gem install rogue
the error is still there.
The error appears also after typing into a Markdown cell. A message Initializing ruby for polyglot text styler
appears shortly and then the error described above appears.
The TruffleSqueak standalone bundle would be a godsend👍🏻
Did you restart TruffleSqueak after installing the gem?
Yes. The TruffleSueak was restarted after installing the gem.
I removed everything and started from scratch. But now the rogue gem
will not install because:
<internal:core> core/kernel.rb:234:in
gem_original_require': Library "/usr/lib/libSystem.B.dylib" does not exist. (RuntimeError)`
The process:
graalvm-ce-java11-20.2.0
into /Applications/graalvm/
sudo xattr -r -d com.apple.quarantine /Applications/graalvm/graalvm-ce-java11-20.2.0
/Applications/graalvm/graalvm-ce-java11-20.2.0/Contents/Home/bin/gu -C https://raw.githubusercontent.com/hpi-swa/trufflesqueak/master/gu-catalog.properties install smalltalk
/Applications/graalvm/graalvm-ce-java11-20.2.0/Contents/Home/bin/trufflesqueak
/Applications/graalvm/graalvm-ce-java11-20.2.0/Contents/Home/bin/gu install ruby
/Applications/graalvm/graalvm-ce-java11-20.2.0/Contents/Home/bin/gem install rogue
Could not find OpenSSL headers, install via Homebrew or MacPorts or set OPENSSL_PREFIX
sudo port -v selfupdate
sudo port install openssl
(it also installs zlib
)/Applications/graalvm/graalvm-ce-java11-20.2.0/Contents/Home/bin/gem install rogue
<internal:core> core/kernel.rb:234:in
gem_original_require': Library "/usr/lib/libSystem.B.dylib" does not exist. (RuntimeError)` (plus about 10 more lines ..)So now it's ducked:-|
Sorry for the inconvenience. I'm afraid TruffleRuby 20.2.0 does not support macOS Big Sur, 21.0.0 does. We haven't done a TruffleSqueak release for 21.0.0 yet. But you can force-install TruffleSqueak on top of 21.0.0 via: bin/gu install -f -u https://github.com/hpi-swa/trufflesqueak/releases/download/20.2.0/trufflesqueak-installable-java11-darwin-amd64-20.2.0.jar
Ok :-)
GraalVM 21.0.0 in /Applications/graalvm/graalvm-ce-java11-21.0.0
sudo xattr -r -d com.apple.quarantine /Applications/graalvm/graalvm-ce-java11-21.0.0
/Applications/graalvm/graalvm-ce-java11-21.0.0/Contents/Home/bin/gu install ruby
/Applications/graalvm/graalvm-ce-java11-21.0.0/Contents/Home/bin/gem install rogue
ERROR: Loading command: install (RuntimeError) you may need to install the system OpenSSL library libssl - see https://github.com/oracle/truffleruby/blob/master/doc/user/installing-libssl.md (dlopen(/usr/local/opt/openssl/lib/libssl.1.0.0.dylib, 2): image not found) ERROR: While executing gem ... (NoMethodError) undefined method `invoke_with_build_args' for nil:NilClass
The reference (https://github.com/oracle/truffleruby/blob/master/doc/user/installing-libssl.md) says about openssl on macOS:
We recommend installing libssl via Homebrew.
brew install openssl
MacPorts should also work but is not actively tested.
sudo port install openssl
sudo port install openssl
before Step 1.Note 1: There is /opt/local/lib/libssl.1.1.dylib
on the Mac which looks rather different from the /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
mentioned in the error. I bet the /opt/local/lib/libssl.1.1.dylib
was added by the sudo port install openssl
.
Note 2: TruffleSqueak 20.2.0 (without TruffleRuby) works OK on top of the 21.0.0 GraalVM.
Ducked again it seems:-|
Hi @jirir, I believe the only step you've missed is to call the following right after installing TruffleRuby:
$GRAALVM_HOME/languages/ruby/lib/truffle/post_install_hook.sh
This step is mentioned in the post installation notice of TruffleRuby. It needs to relink against your local openssl installation to function properly.
Good to hear that TruffleSqueak 20.2.0 works on GraalVM 21.0.0!
Ok. Now gem install rogue
complains about issuer certificates.
$GRAALVM_HOME/languages/ruby/lib/truffle/post_install_hook.sh
$GRAALVM_HOME/bin/gem install rogue
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR: You must add /OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign to your local trusted store
Now how do I add /OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign
to my local trusted store ?
Mh interesting... maybe try reinstalling TruffleRuby (remove it via bin/gu remove ruby
and install it again). Here are some additional information on libssl and TruffleRuby, but it seems sudo port install openssl
should be supported.
As a workaround, you could also just disable rouge-based highlighting by changing PolyglotTextStyler>>style:language:
to:
style: aText language: aLanguageID
^ aLanguageID = Polyglot languageIdSmalltalk
ifTrue: [ (stStyler ifNil: [ stStyler := SHTextStylerST80 new ]) styledTextFor: aText ]
ifFalse: [ aText ]
This is a genuine nightmare adventure:-o Giving up.
I'm sorry to hear that. If you have any additional feedback (apart from that you'd like a bundle), please let me know.
It may be too late, but I'll try to finalize the TruffleSqueak release for 21.0.0 tomorrow.
The 21.0.0 release is now available. I'm going to close this for now... please re-open if there's anything else I can help with.
With the PolyglotTextyler>>style:language:
changed (actually syntax highligt turned off I guess) the 21.0.0 stack works. I hope I'll be finally able to try demos with ruby/python/smalltalk interchage.
Great! If you'd like to reproduce our polyglot notebook demo, have a look at the notes from our ECOOP20 Tutorial. And feel free to ask any questions, here, under discussions, or in the #trufflesqueak
channel of the GraalVM Slack.
PS: I just noticed that the website layout of "https://2020.ecoop.org/people-index" recently changed, so you either need to adapt the notebook's code or change the url to point to the web archive (e.g. "https://web.archive.org/web/20201024115530/https://2020.ecoop.org/people-index").
Too early to hope:-|
PolyglotTextStyler>>style:language:
style: aText language: aLanguageID ^ aLanguageID = Polyglot languageIdSmalltalk ifTrue: [ (stStyler ifNil: [ stStyler := SHTextStylerST80 new ]) styledTextFor: aText ] ifFalse: [ aText ]
% /Applications/graalvm/graalvm-ce-java11-21.0.0/Contents/Home/languages/smalltalk/bin/trufflesqueak ; exit; [trufflesqueak] Running Squeak/Smalltalk on GraalVM CE... [trufflesqueak] Image loaded in 3148ms. ERROR: java.lang.NullPointerException org.graalvm.polyglot.PolyglotException: java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Objects.java:221) at de.hpi.swa.trufflesqueak.nodes.context.frame.FrameStackReadNode.create(FrameStackReadNode.java:44) at de.hpi.swa.trufflesqueak.nodes.bytecodes.PushBytecodes$PushTemporaryLocationNode.executeVoid(PushBytecodes.java:581) at de.hpi.swa.trufflesqueak.nodes.ExecuteBytecodeNode.interpretBytecode(ExecuteBytecodeNode.java:134) at de.hpi.swa.trufflesqueak.nodes.ExecuteBytecodeNode.execute(ExecuteBytecodeNode.java:70) at de.hpi.swa.trufflesqueak.nodes.StartContextRootNode.execute(StartContextRootNode.java:54) at
PolyglotTextStyler>>style:language:(Unknown) at PNBCodeCellEditor>>applyStyle(PNBCodeCellEditor>>applyStyle:10:213-242) at MessageSend>>value(MessageSend>>value:14:262-298) at MorphicAlarm>>value:(MorphicAlarm>>value::22:415-433) at [] in WorldState>>triggerAlarmsBefore:([] in WorldState>>triggerAlarmsBefore::3:38-56) at SequenceableCollection>>do:(SequenceableCollection>>do::14:244-263) at WorldState>>triggerAlarmsBefore:(WorldState>>triggerAlarmsBefore::32:733-749) at WorldState>>runLocalStepMethodsIn:(WorldState>>runLocalStepMethodsIn::10:246-280) at WorldState>>runStepMethodsIn:(WorldState>>runStepMethodsIn::33:717-753) at PasteUpMorph>>runStepMethods(PasteUpMorph>>runStepMethods:3:33-63) at WorldState>>doOneCycleNowFor:(WorldState>>doOneCycleNowFor::23:605-633) at CTX WorldState>>doOneCycleFor: @69ba3f4e(WorldState>>doOneCycleFor::12:264-295)
... about 240 lines of error messages.
Thanks for reporting the crash, I will try to reproduce and address the crash. In the meantime, please try again without changing PolyglotTextStyler>>style:language:
(ensure that rouge is installed: bin/gem install rouge
).
Cannot get rogue installed:-/ It complains about SSL:
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR: You must add /OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign to your local trusted store
I thought I would ignore the complaining rogue using the PolyglotTextStyler>>style:language:
modification and get to the demo :-)
At this point, I'm afraid I can only make two suggestions:
1) Option
According to this,
MacPorts should also work but is not actively tested.
Is there any way you could install openssl via homebrew? I've been using homebrew and have never seen the error you reported. It may be a good idea to open an issue against TruffleRuby. It seems there are many issues with openssl.
2) Option
Unzip TruffleSqueakImage-21.0.0-rouge-disabled.zip) and replace the two files in $GRAALVM_HOME/Contents/Home/languages/smalltalk/resources/
. The zip contains the 21.0.0 image/changes with rouge disabled. I only created it using an OpenSmalltalkVM (there may be a bug in the image saving logic of TruffleSqueak).
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR: You must add /OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign to your local trusted store
According to @eregon, this doesn't seem like a TruffleRuby issue, but an issue with your OpenSSL installation. You may be able to install rouge via http, not https (this is obviously insecure and only a workaround):
bin/gem install rouge --source http://rubygems.org
To check if it's an issue with your OpenSSL installation, you could run:
openssl s_client -connect rubygems.org:443
and see whether there are any verification issues.
Note that the above should use the MacPorts openssl, so something like:
/opt/local/bin/openssl s_client -connect rubygems.org:443
It seems clear that your MacPorts openssl is missing certificates, please fix that, otherwise nothing on the system using MacPorts openssl will work.
Updating SSL Certificates with MacPorts
from http://railsapps.github.io/openssl-certificate-verify-failed.html might be helpful to fix it.
Polyglot class(Object)>>error: Polyglot class>>signalPolyglotError Polyglot class>>primitive Eval:string:inInnerContext: Polyglot class>>eval:string: PolyglotTextStyler>>newRougueFormater PolyglotTextStyler>>formatter PolygloTextStyler>>style:language: PNBCodeCellEditor>>applyStyle MorphicAlarm(MesageSend)>>value MorphicAlarm>>value: