Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back port of documentation changes to main #2797

Merged
merged 1 commit into from Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 50 additions & 0 deletions website/docs/_advanced_install.mdx
Expand Up @@ -13,10 +13,12 @@ import {currentOs} from "../src/components/osUtils";
{label: 'Windows', value: 'windows'},
{label: 'MacOs', value: 'mac'},
{label: 'Linux', value: 'linux'},
{label: 'BSD (experimental)', value: 'bsd'},
]}>
<TabItem value="windows"></TabItem>
<TabItem value="mac"></TabItem>
<TabItem value="linux"></TabItem>
<TabItem value="bsd"></TabItem>
</Tabs>
</SectionAbout>

Expand All @@ -31,6 +33,7 @@ values={[
{label: 'Windows', value: 'windows'},
{label: 'MacOs', value: 'mac'},
{label: 'Linux', value: 'linux'},
{label: 'BSD', value: 'bsd'},
]}
>
<TabItem value="linux">
Expand Down Expand Up @@ -251,6 +254,7 @@ winget install virtuslab.scalacli
</Tabs>

</TabItem>

<TabItem value="mac">

<Tabs
Expand Down Expand Up @@ -330,6 +334,52 @@ sdk install scalacli
</Tabs>

</TabItem>

<TabItem value="bsd">
<Tabs
groupId="bsd"
defaultValue="manual"
values={[
{label: 'Manual', value: 'manual'},
]}
>

<TabItem value="manual">
FreeBSD support (and support for other BSDs) is currently experimental and not stable. Scala CLI is not being distributed for FreeBSD, but you can install it via Coursier's standalone JAR.

Before running Coursier and installing Scala CLI, make sure you have Java 17 or higher installed and in your $PATH:
```bash
pkg install openjdk17
```
Note: Java 17 has to be installed manually on BSD systems at this time.

Download Coursier via the [Any JAR option](https://get-coursier.io/docs/cli-installation#latest-launchers).

After downloading Coursier, you can use it to install Scala CLI:
```console
chmod +x coursier
./coursier install scala-cli
```
Scala CLI is now installed on your system. It is installed as a JAR rather than a native binary, and so the startup time is slightly longer.

To run scala-cli anywhere on your system, you need to add its binary path to the $PATH variable. For a given **user-directory**:
```bash
export PATH="$PATH:/home/user-directory/.local/share/coursier/bin"
```
Add this command to your shell's RC file to make the setting permanent.

Depending on the Java distribution you are using, it has been observed that Bloop (the build server used by Scala CLI) may have trouble starting on FreeBSD. You may try to customise Bloop JVM options with the `BLOOP_JAVA_OPTS` environment variable. Alternatively, you may skip using the build server altogether and use the compiler directly by passing the `--server=false` option. Please note that doing this will noticably extend project build times.

```bash
scala-cli run -e 'println("Hello FreeBSD")' --server=false
```

Any features relying on third-party JVMs (such as ```--jvm``` and ```package --native-image```) may not work on FreeBSD, as those JVMs may not have BSD distributions provided. They may be made to work when a compatible JVM path is provided directly (refer to individual sub-commands' `--help`).
</TabItem>

</Tabs>
</TabItem>

</Tabs>

</div></div>
Expand Down