Skip to content

Commit

Permalink
Fix NetBSD support (#777)
Browse files Browse the repository at this point in the history
* Use LLVM 18 on NetBSD
* netbsd.yml: Re-enable workflow (#771)
* bootstrap.sh: Remove GNUisms

Co-authored-by: Akuli <[email protected]>
Fixes: #567
  • Loading branch information
taahol and Akuli committed Feb 19, 2025
1 parent 933629b commit ab3e4ea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/netbsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,21 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
# TODO: disabled for now because freezes with no output for some reason.
# Started happening in #562, so it has something to do with self-hosted compiler.
#
with:
fetch-depth: 0 # Fetch the whole Git history
# TODO: don't use an action for this? could we instead install qemu from apt and call it?
- if: false
uses: cross-platform-actions/[email protected]
- uses: cross-platform-actions/[email protected]
env:
PKG_PATH: 'https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/10.0/All'
with:
operating_system: netbsd
version: '10.0'
environment_variables: PKG_PATH
run: |
sudo pkgin -y install clang libLLVM gmake diffutils && \
sudo pkgin -y install clang gmake diffutils git && \
gmake && \
./runtests.sh --verbose --stage1 && \
./runtests.sh --verbose --stage2 && \
./runtests.sh --verbose && \
./runtests.sh --verbose --jou-flags "--verbose" && \
mv jou jou_bootstrap && gmake && \
./runtests.sh --verbose && \
gmake clean && \
./doctest.sh
4 changes: 2 additions & 2 deletions Makefile.posix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Linux has llvm-config-xx in PATH, where xx is version number
# On macos, brew installs LLVM to a weird place in /usr/local/
# On NetBSD, use llvm-config from libLLVM (package from pkgsrc)
# On NetBSD, llvm-config is unversioned.
LLVM_CONFIG ?= $(shell \
which llvm-config-19 \
|| which /usr/local/opt/llvm@19/bin/llvm-config \
Expand All @@ -20,7 +20,7 @@ LLVM_CONFIG ?= $(shell \
|| which llvm-config-14 \
|| which /usr/local/opt/llvm@14/bin/llvm-config \
|| which /opt/homebrew/opt/llvm@14/bin/llvm-config \
|| which /usr/pkg/libexec/libLLVM/llvm-config \
|| which llvm-config \
)

all: jou
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ shortcomings.
1. Install the dependencies:
```
# pkgin install bash clang git gmake libLLVM
# pkgin install bash clang git gmake
```
Optionally `diffutils` can be installed for coloured diff outputs.
2. Download and compile Jou.
Expand Down
4 changes: 2 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# The Jou compiler is written in Jou, but it doesn't help you very much if you
# have nothing that can compile or run Jou code. That's why this script exists.
Expand Down Expand Up @@ -87,7 +87,7 @@ for i in $(seq 1 ${#commits[@]}); do

folder=$(folder_of_commit $i)
rm -rf $folder
mkdir -vp $folder
mkdir -p $folder

# This seems to be the best way to checkout a commit into a folder.
git archive --format=tar $commit | (cd $folder && tar xf -)
Expand Down

0 comments on commit ab3e4ea

Please sign in to comment.