Skip to content

Commit

Permalink
CI: specify cosmocc version
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmorgner committed Mar 11, 2024
1 parent 20e59ce commit d7da9e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
26 changes: 9 additions & 17 deletions .github/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,12 @@ case "$1" in
sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register"
sudo mkdir -p /opt
sudo chmod 1777 /opt
test -d /opt/cosmo || git clone https://github.com/jart/cosmopolitan /opt/cosmo
cd /opt/cosmo
make toolchain 2>/dev/null
mkdir -p /opt/cosmos/bin
/opt/cosmo/bin/cosmocc --update
cd -
test -d /opt/cosmo || (wget https://cosmo.zip/pub/cosmocc/cosmocc-3.3.1.zip && sudo unzip cosmocc-3.3.1.zip -d /opt/cosmo)
test -d openssl || git clone --depth=1 https://github.com/openssl/openssl.git -b openssl-3.0 openssl
# see also https://github.com/ahgamut/superconfigure/blob/main/lib/openssl/BUILD.mk
cd openssl
git apply ../.github/openssl_getrandom.diff
./config --with-rand-seed=getrandom no-asm no-shared no-dso no-engine no-dynamic-engine -DPURIFY CC=/opt/cosmo/bin/cosmocc
find /opt/cosmo/tool/scripts/
./Configure linux-aarch64 --with-rand-seed=getrandom no-asm no-shared no-dso no-engine no-dynamic-engine no-pic no-autoalginit no-autoerrinit no-tests -DPURIFY CC="/opt/cosmo/bin/cosmocc -I/opt/cosmo/include -L/opt/cosmo/lib" AR=/opt/cosmo/bin/cosmoar
make
cd -
;;
Expand All @@ -61,11 +56,7 @@ case "$1" in
./configure --enable-python --enable-java --enable-ruby --enable-go
;;
ape)
./configure CC=/opt/cosmo/bin/cosmocc CRYPTO_CFLAGS="-I$PWD/openssl/include" CRYPTO_LIBS="-L$PWD/openssl -lcrypto" --disable-shared
echo "#define ossl_unused" >> config.h
echo "#define ossl_inline" >> config.h
echo "#define __owur" >> config.h
echo "#define ossl_noreturn" >> config.h
./configure CC=/opt/cosmo/bin/cosmocc INSTALL="/opt/cosmo/bin/cosmoinstall" AR="/opt/cosmo/bin/cosmoar" CRYPTO_CFLAGS="-I$PWD/openssl/include" CRYPTO_LIBS="-L$PWD/openssl -lcrypto" --disable-shared
;;
macos)
./configure
Expand All @@ -87,11 +78,12 @@ esac

case "$1" in
ape)
mkdir -p openpace_ape
for file in openssl/apps/openssl src/eactest src/cvc-create src/cvc-print
mkdir -p openpace-bin
for file in src/eactest src/cvc-create src/cvc-print
do
objcopy -SO binary $file openpace_ape/${file##*/}.com
#objcopy -SO binary $file openpace-bin/${file##*/}.com
cp $file openpace-bin/${file##*/}.com
done
cp -r docs openpace_ape
cp -r docs openpace-bin
;;
esac
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
- run: .github/build.sh ape
- uses: actions/upload-artifact@v2
with:
name: openpace-ape
name: openpace-bin
path:
openpace_ape
openpace-bin

0 comments on commit d7da9e8

Please sign in to comment.