Stream: ideas

Topic: Adding ROC_INSTALL_DIR in install_roc.sh


view this post on Zulip Aurélien Geron (Jun 23 2026 at 10:14):

To install Roc in a Docker container, I used this command:

curl --proto '=https' --tlsv1.2 -sSf https://roc-lang.org/install_roc.sh \
    | ROC_CONTINUE_IF_STALE=y ROC_ADD_TO_PATH=n sh

But this installs Roc in the following INSTALL_DIR:

DIR_NAME="roc_nightly-${PLATFORM}_${ARCH_NAME}-${VERSION_DATE}-${BUILD_ID}"
INSTALL_DIR="$PWD/$DIR_NAME"

It would be nice to be able to run:

curl --proto '=https' --tlsv1.2 -sSf https://roc-lang.org/install_roc.sh \
    | ROC_CONTINUE_IF_STALE=y ROC_ADD_TO_PATH=n ROC_INSTALL_DIR=/usr/local/bin sh

I can submit a PR if you think that's a good idea? Maybe this opens a security breach I haven't noticed?

view this post on Zulip Luke Boswell (Jun 23 2026 at 10:19):

This looks like something @Anton would be best to answer. I don't see why we couldn't do this though --- I'd suggest you open a PR and we can pick it up with a review if there are any issues.

view this post on Zulip Anton (Jun 23 2026 at 12:21):

That should be fine, the install scrips are located here: https://github.com/roc-lang/www.roc-lang.org/tree/main/website/public

view this post on Zulip Romain Lepert (Jun 23 2026 at 12:37):

/usr/local/bin is sudo gated.

~/.local/bin is not

many tool install in the equivalent of $HOME/.roc/bin
and would call $HOME/.roc ROC_HOME

then they symlink or add to path

view this post on Zulip Aurélien Geron (Jun 23 2026 at 23:22):

I submitted this PR: https://github.com/roc-lang/www.roc-lang.org/pull/82
It adds an optional ROC_INSTALL_DIR environment variable: if set, the roc executable is copied to that directory after the tarball is extracted. I could have extracted the tarball directly to that directory, but it contains LICENSE and legal_details which I felt should stay in the extracted directory rather than end up in a bin folder. I also considered cleaning up the tarball and extracted directory after installation, but I felt that the user might want to keep them. Wdyt?

view this post on Zulip Aurélien Geron (Jun 23 2026 at 23:23):

For example:

export ROC_INSTALL_DIR=~/.roc/bin
export ROC_CONTINUE_IF_STALE=y
export ROC_ADD_TO_PATH=n
curl --proto '=https' --tlsv1.2 -sSf https://roc-lang.org/install_roc.sh | sh

Last updated: Jul 23 2026 at 13:15 UTC