Stream: announcements

Topic: rocup - compiler installation management tool


view this post on Zulip Krzysztof Kielak (May 16 2024 at 20:36):

Hi!, I have created for myself rocup (https://github.com/appblue/rocup) simple tool for installing the latest nightly build version of the compiler and making it available on the PATH by symlinking to the /usr/local/bin (usually available in the path on U*ix systems).

The tool keeps all previously downloaded nightly versions, so subsequent executions allow for selection of one of the previous versions.

Hope it will be useful for someone :)

view this post on Zulip Krzysztof Kielak (May 16 2024 at 21:38):

BTW, there was a problem with the installation procedure - it should be fixed now

view this post on Zulip Ayaz Hafiz (May 16 2024 at 22:10):

This is very cool, thank you for sharing!

view this post on Zulip Norbert Hajagos (May 17 2024 at 05:57):

Yes, very nicely done! Also, respect for keeping the name consistent with expectations. I would have named it rocon, for the memes at the cost of confusing every newcomer.:grinning_face_with_smiling_eyes:

view this post on Zulip Richard Feldman (May 17 2024 at 06:26):

nice! @Krzysztof Kielak do you have any interest in integrating this into roc itself? We talked about that awhile back - it's something I've never seen a language do, but I think it would be awesome because (just like with testing and formatting and package management) it's something every language wants, so why not ship it with the roc CLI itself? :smiley:

view this post on Zulip Krzysztof Kielak (May 17 2024 at 07:36):

@Richard Feldman I would love to work with the team on that! I will review past conversations and "rust-off" my Rust skills :)

view this post on Zulip Richard Feldman (May 17 2024 at 07:49):

awesome! Feel free to start a thread in #contributing if you have any questions about any part of it, including Rust questiosn! :smiley:

view this post on Zulip Vladimir Zotov (May 19 2024 at 15:40):

So funny how I finally got to do the same just now before reading this :grinning:
https://github.com/rgripper/roc-installer/blob/main/install.sh

curl -fSL https://raw.githubusercontent.com/rgripper/roc-installer/main/install.sh | bash -

Is there a reason for sudos in your script @Krzysztof Kielak ? (I'm not a shell expert)

I personally absolutely for including such a one-liner install script instead of what is there now (looking at how tools like pnpm did it). For someone who past the "play with roc on the website" stage, but can't be bothered manually running it every time we need to update it (or for anyone who periodically corrupts their WSL distro). OFC that's until we get the proper self-install.

view this post on Zulip Krzysztof Kielak (May 19 2024 at 17:12):

@Vladimir Zotov I'm using sudo, so I can put the links into /usr/local/bin directory. This is one time operation, as we are dealing with double indirection:

/usr/local/bin/roc -> ~/.rocup/roc/roc and ~/.rocup/roc symlink is linking to currently selected nightly build directory in the ~/.rocup directory

If the links are already present the only modifications happens in ~/.rocup directory. The other option would be to add ~/.rocup/roc directory to the PATH ... as you decided to do it.

view this post on Zulip Krzysztof Kielak (May 19 2024 at 17:16):

BTW, I have started digging around to add this option to rocCLI tool, as suggested by @Richard Feldman - will keep you posted

view this post on Zulip Andy Ferris (May 21 2024 at 12:42):

Richard Feldman said:

it's something I've never seen a language do

This has started to appear elsewhere recently. Definitely both deno and bun have upgrade commands that IMO work really nicely (but they are designed to track the latest version and are not multi-version configurers like nvm). Julia has julia +1.10 for example to run Julia 1.10, like the proposed roc use ..., with a seperate juliaup CLI utility to actually install and upgrade versions (it works by making the default julia in PATH a simple program that looks for the +x.y setting and dispatches to the "real" julia binary as appropriate).

view this post on Zulip Kasper Møller Andersen (May 21 2024 at 14:37):

I love having a good upgrade tool integrated! One thing that would be really cool as well (at some indeterminate point in the future), would be to have it configurable in a way that's shareable with your coworkers and co-contributors (not to mention your CI pipeline). If the upgrading mechanism is part of the roc binary, then maybe there's an officially sanctioned place to store that kind of information too. I don't know if there are plans to have something like a roc.toml configuration file where that might live.

view this post on Zulip Anton (May 21 2024 at 14:39):

We planned to put version info in the file with the app header, so people can easily share single file scripts

view this post on Zulip Kasper Møller Andersen (May 21 2024 at 14:42):

And then another mechanism to help your roc binary pull the correct version from some unofficial repository (in case your company wants hermetic builds, or you're generally not allowed to pull from the internet, but you can pull from a local JFrog repo). The fact that the Elm binaries basically require Internet access to build has been quite a pain for us where I work for example :face_with_diagonal_mouth:

view this post on Zulip Richard Feldman (May 21 2024 at 16:09):

yeah it’s an explicit goal to never have a roc.toml or anything like that - it should always be possible to give someone a single .roc file that specifies both all the code and also all the dependencies and metadata! :smiley:

view this post on Zulip Krzysztof Kielak (May 22 2024 at 10:31):

Interesting observation: the tool juliaup for managing installation of Julia programming language is written in Rust ...

view this post on Zulip Hannes (May 22 2024 at 12:21):

Yeah, Julia's JIT takes a little while to spin up, so it's not suitable for short running scripts, plus there's no way to bundle a Julia script into a standalone executable without including the entire Julia compiler yet. However most of Julia itself is actually written in Julia, whereas Roc's compiler is mostly Rust :grinning_face_with_smiling_eyes: Glad people pick the best tool for the job instead of insisting on self hosting everything :sweat_smile:

view this post on Zulip Vinicius Ataide (Jun 07 2024 at 13:14):

hello I just ran rocup and found an error message that was already solved in this issue https://github.com/roc-lang/roc/issues/6053 but not solved in my case. I feel like there's a version mismatch but I don't know where to go.

roc dev
dyld[4825]: Library not loaded: /opt/homebrew/opt/z3/lib/libz3.4.12.dylib
  Referenced from: <272B98B2-FD66-358E-BE02-A5B8B0A20C95> /Users/viniciusataide/.bin/roc_nightly-macos_apple_silicon-2024-01-08-b58121ff06f/roc
  Reason: tried: '/opt/homebrew/opt/z3/lib/libz3.4.12.dylib

and the z3 version installed by brew is

libz3.4.13.0.0.dylib

view this post on Zulip Vinicius Ataide (Jun 07 2024 at 13:15):

maybe downgrade my brew z3 version installation?

view this post on Zulip Vinicius Ataide (Jun 07 2024 at 13:15):

why is it looking for a specific version? maybe my mistake was using rocup with an existing manual roc installation. would that be it?

view this post on Zulip Krzysztof Kielak (Jun 07 2024 at 13:17):

@Vinicius Ataide , unfortunately rocup is not managing any dependencies for roc compiler - only downloading the latest version of the compiler available, or potentially activating one of the already downloaded/installed old versions

view this post on Zulip Vinicius Ataide (Jun 07 2024 at 13:19):

oh makes sense. so what would I do? downgrade z3?

view this post on Zulip Vinicius Ataide (Jun 07 2024 at 13:19):

I wanna use the latest version and don't worry about making support for that I know I'm at the bleeding edge and wanna learn

view this post on Zulip Krzysztof Kielak (Jun 07 2024 at 13:22):

sometimes brew allows for different versions to coexist .. maybe that's an option?

view this post on Zulip Krzysztof Kielak (Jun 07 2024 at 13:25):

in my case I'm still on 1.2.11 for libz

~ % rocup
.. apple silicon Mac detected
.. downloading latest release of the Roc compiler
.. extracting: roc_nightly-macos_apple_silicon-latest.tar.gz
.. trying to install nth latest local version (n = 1)

.. list locally available versions - with selecion marked '->'
   -----------------------------------------------------------
 ->  .rocup/roc_nightly-macos_apple_silicon-2024-06-07-b3c28ebe66b/roc
     .rocup/roc_nightly-macos_apple_silicon-2024-06-01-fa526c99ece/roc
     .rocup/roc_nightly-macos_apple_silicon-2024-05-27-9fcd5a3fe88/roc
     .rocup/roc_nightly-macos_apple_silicon-2024-05-22-33075285b72/roc
     .rocup/roc_nightly-macos_apple_silicon-2024-05-21-45a7e448dd4/roc
     .rocup/roc_nightly-macos_apple_silicon-2024-05-20-7e1a82f048f/roc
     .rocup/roc_nightly-macos_apple_silicon-2024-05-13-e5ea6dc4617/roc
     .rocup/roc_nightly-macos_apple_silicon-2024-05-11-dd9a6ff2e4a/roc

.. creating local symlink to selected downloaded version
.. installation complete
.. .. rocup tool is now available in /usr/local/bin/rocup
.. .. roc compiler is now available in /usr/local/bin/roc
.. .. roc language server is now available in /usr/local/bin/roc_language_server
.. .. roc compiler version: roc nightly pre-release, built from commit b3c28ebe66b on Fri Jun  7 09:11:53 UTC 2024

~ % otool -L /usr/local/bin/roc
/usr/local/bin/roc:
    /usr/lib/libffi.dylib (compatibility version 1.0.0, current version 30.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /opt/homebrew/opt/zstd/lib/libzstd.1.dylib (compatibility version 1.0.0, current version 1.5.6)
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
    /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)
    /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 1163.100.19)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60158.100.133)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1858.112.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)

view this post on Zulip Vinicius Ataide (Jun 07 2024 at 13:27):

yeah I'm trying to install an older z3 but it's hard haha https://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula

view this post on Zulip Vinicius Ataide (Jun 07 2024 at 13:28):

I don't care about having a newer z3 installed

view this post on Zulip JRI98 (Jun 07 2024 at 13:38):

There is a workaround that is used in CI https://github.com/roc-lang/roc/blob/main/.github/workflows/nightly_macos_apple_silicon.yml#L18

view this post on Zulip JRI98 (Jun 07 2024 at 13:39):

It is probably enough to run export LIBRARY_PATH=/opt/homebrew/Cellar/zstd/1.5.6/lib

view this post on Zulip Vinicius Ataide (Jun 07 2024 at 13:40):

will try that thanks

view this post on Zulip Vinicius Ataide (Jun 07 2024 at 13:42):

same error but this is a good clue

view this post on Zulip Vinicius Ataide (Jun 07 2024 at 13:58):

JRI98 said:

It is probably enough to run export LIBRARY_PATH=/opt/homebrew/Cellar/zstd/1.5.6/lib

where did you get the clue about this should be the correct version number

view this post on Zulip JRI98 (Jun 07 2024 at 16:18):

From the file above


Last updated: Jul 26 2025 at 12:14 UTC