Skip to content

Commit

Permalink
Update Windows workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-s committed Dec 5, 2024
1 parent 71aafbd commit 4b63813
Showing 1 changed file with 36 additions and 10 deletions.
46 changes: 36 additions & 10 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,45 @@ jobs:
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o miniconda.exe
Start-Process -FilePath ".\miniconda.exe" -ArgumentList "/S" -Wait
del miniconda.exe
- name: install conda-build
run: |
source ~/miniconda3/etc/profile.d/conda.sh
conda activate
conda config --add channels conda-forge
conda install -y conda-build
- name: build and install conda package
env:
LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime
DYLD_LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime
run: |
source ~/miniconda3/etc/profile.d/conda.sh
conda activate
conda build recipe --output-folder conda-bld
conda install -c ${{ github.workspace }}/conda-bld/ sbcl-librarian
- name: set environment variables
run: |
source ~/miniconda3/etc/profile.d/conda.sh
conda activate
echo "LIBRARY_PATH=$LIBSBCL_PATH:$CONDA_PREFIX/lib" >> "$GITHUB_ENV"
echo "DYLD_LIBRARY_PATH=$LIBSBCL_PATH:$CONDA_PREFIX/lib" >> "$GITHUB_ENV"
echo "C_INCLUDE_PATH=$CONDA_PREFIX/include" >> "$GITHUB_ENV"
- name: build and run example
working-directory: examples/libcalc
env:
SBCL_SRC: ${{ github.workspace }}/../sbcl
CL_SOURCE_REGISTRY: "${{ github.workspace }}//"
MSYS2_PATH_TYPE: inherit
run: |
conda install --offline ${{ github.workspace }}/conda-bld/osx-64/
source ~/miniconda3/etc/profile.d/conda.sh
conda activate
$SBCL_SRC/run-sbcl.sh --load script.lisp --quit
${{ matrix.cc }} -Wall -fPIC -shared -Wl,--export-all-symbols -o libcalc.dll libcalc.c -Wl,--whole-archive $SBCL_SRC/src/runtime/libsbcl.a -Wl,--no-whole-archive -ladvapi32 -lsynchronization -lws2_32 -lzstd -I../../lib
${{ matrix.cc }} -Wall -o example example.c -lcalc -L. -I../../lib
mv libcalc.dll $MSYSTEM_PREFIX/bin
cp libcalc.core $MSYSTEM_PREFIX/bin
echo "(+ 1 2)" | ./example.exe | tr -d '\r\n' | grep "> 3> "
echo "(+ 1 2)" | python ./example.py | tr -d '\r\n' | grep "> 3> "
python ./exhaust_heap.py | grep "returned to Python with error code 2 after heap exhaustion"
pushd libcalc
mkdir build
pushd build
cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..
cmake --build .
cmake --install .
popd
popd
gcc -Wall -o example example.c -lcalc -lsbcl_librarian
echo "(+ 1 2)" | ./example | tr -d '\n' | grep "> 3> "
echo "(+ 1 2)" | python ./example.py | tr -d '\n' | grep "> 3> "
python ./exhaust_heap.py | grep "returned to Python after heap exhaustion (attempt 1)"

0 comments on commit 4b63813

Please sign in to comment.