Skip to content

Commit

Permalink
GHA OpenBSD: Try GDC host compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Mar 3, 2024
1 parent ffac345 commit a55bc0a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ jobs:
export N="$(nproc)"
export CI_DFLAGS="-version=TARGET_FREEBSD${freebsd_major}"
elif [[ "$OS_NAME" == "openbsd" ]]; then
# cannot install host compiler via install.sh; the ldc package is installed as prerequisite
export DMD=ldmd2
# cannot install host compiler via install.sh; the gdc package is installed as prerequisite
export DMD=gdmd
export N="$(sysctl -n hw.ncpu)"
fi
Expand Down
8 changes: 5 additions & 3 deletions ci/cirrusci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ elif [ "$OS_NAME" == "freebsd" ]; then
ln -s /usr/local/bin/gmake /usr/bin/make
ln -s /usr/local/bin/llvm-dwarfdump12 /usr/bin/llvm-dwarfdump
elif [ "$OS_NAME" == "openbsd" ]; then
packages="ldc git gdiff gmake llvm%16"
pkg_add $packages
packages="gdc git gdiff gmake llvm%16"
pkg_add -vvv $packages
# replace default diff & make by GNU versions
rm /usr/bin/{diff,make}
ln -s /usr/local/bin/gdiff /usr/bin/diff
ln -s /usr/local/bin/gmake /usr/bin/make
ln -s /usr/local/bin/llvm-dwarfdump-16 /usr/bin/llvm-dwarfdump
ldmd2 --version
ln -s /usr/local/bin/egdc /usr/local/bin/gdc
egdc --version
gdc --version
diff --version
make --version
llvm-dwarfdump --version
Expand Down
9 changes: 7 additions & 2 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,12 @@ download_install_sh() {

# install D host compiler
install_host_compiler() {
if [ "${HOST_DMD:0:5}" == "gdmd-" ] ; then
if [ "$OS_NAME" == "openbsd" ] ; then
# fetch the gdmd wrapper for CLI compatibility with dmd
sudo curl -fsSL -A "$CURL_USER_AGENT" --connect-timeout 5 --speed-time 30 --speed-limit 1024 --retry 5 --retry-delay 5 https://raw.githubusercontent.com/D-Programming-GDC/GDMD/master/dmd-script -o /usr/local/bin/gdmd
sudo chmod +x /usr/local/bin/gdmd
gdmd --version
elif [ "${HOST_DMD:0:5}" == "gdmd-" ] ; then
local gdc_version="${HOST_DMD:5}"
if [ ! -e ~/dlang/gdc-$gdc_version/activate ] ; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
Expand All @@ -230,7 +235,7 @@ install_host_compiler() {
echo "export DMD=gdmd-$gdc_version" > ~/dlang/gdc-$gdc_version/activate
echo "deactivate(){ echo;}" >> ~/dlang/gdc-$gdc_version/activate
fi
elif [[ "$OS_NAME" != "windows" && "$OS_NAME" != "openbsd" ]]; then
elif [ "$OS_NAME" != "windows" ] ; then
local install_sh="install.sh"
download_install_sh "$install_sh"
CURL_USER_AGENT="$CURL_USER_AGENT" bash "$install_sh" "$HOST_DMD"
Expand Down

0 comments on commit a55bc0a

Please sign in to comment.