Skip to content

Commit

Permalink
Update llvm-sys to make building easier
Browse files Browse the repository at this point in the history
This removes the need for fiddling around with PATH and LIBRARY_PATH on
macOS and FreeBSD. See
https://gitlab.com/taricorp/llvm-sys.rs/-/merge_requests/45 for more
details.

Changelog: other
  • Loading branch information
yorickpeterse committed Aug 3, 2024
1 parent eaf9ec9 commit f5aa237
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 37 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ jobs:
freebsd-amd64:
name: FreeBSD AMD64
runs-on: ubuntu-latest
env:
LIBRARY_PATH: /usr/local/lib
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
Expand All @@ -150,6 +148,6 @@ jobs:
operating_system: freebsd
version: '14.0'
memory: 8G
environment_variables: 'CARGO_HOME RUSTUP_HOME LIBRARY_PATH CARGO_REGISTRIES_CRATES_IO_PROTOCOL'
environment_variables: 'CARGO_HOME RUSTUP_HOME CARGO_REGISTRIES_CRATES_IO_PROTOCOL'
image_url: 'https://github.com/inko-lang/freebsd-builder/releases/download/v0.8.0/freebsd-14.0-x86-64.qcow2'
run: ./ci/freebsd.sh
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions ci/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@ rustup-init --quiet -y --no-modify-path --profile minimal \
echo "::endgroup::"

echo "::group::Updating PATH"
echo "$(brew --prefix llvm@${LLVM_VERSION})/bin" >> $GITHUB_PATH
echo "LIBRARY_PATH=$(brew --prefix llvm@${LLVM_VERSION})/lib:$(brew --prefix zstd)/lib" \
>> $GITHUB_ENV
echo "${CARGO_HOME}/bin" >> $GITHUB_PATH
echo "::endgroup::"
29 changes: 0 additions & 29 deletions docs/source/setup/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,41 +273,12 @@ Older versions of Fedora aren't supported.
sudo pkg install llvm17 rust git
```

You may have to set the `LIBRARY_PATH` variable as follows:

```bash
export LIBRARY_PATH="/usr/local/lib"
```

Without this the linker may fail to find the zstd and libffi libraries, which
are needed by LLVM on FreeBSD.

### macOS

```bash
brew install llvm@17 rust git
```

You may have to set `LIBRARY_PATH` as follows:

```bash
export LIBRARY_PATH="$(brew --prefix llvm@17)/lib:$(brew --prefix zstd)/lib"
```

You may also have to add the LLVM `bin` directory to your `PATH` as follows:

```bash
export PATH="$(brew --prefix llvm@17)/bin:$PATH"
```

Without setting these variables, it's possible building of Inko fails due to the
build process not finding the necessary LLVM libraries.

::: tip
See [this Homebrew issue](https://github.com/Homebrew/brew/issues/13481) for
details on why this might be necessary.
:::

### Ubuntu

For Ubuntu 24.04 and newer:
Expand Down

0 comments on commit f5aa237

Please sign in to comment.