Skip to content

Commit

Permalink
Strip PATH= from langkit/manage.py setenv
Browse files Browse the repository at this point in the history
to avoid mixed path separators MSYS2 (Windows).
Reuse preinstalled MSYS2 on Windows to speed up.
Use GCC 13.2 from Alire.

Fixes #1115
  • Loading branch information
reznikmm committed Oct 19, 2023
1 parent 197e850 commit e0c7729
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
35 changes: 15 additions & 20 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ jobs:
build:
name: Build and deploy

# The only purpose of this workflow is to upload builds, so do not run it
# in contexts when upload is impossible: only the official repository has
# the secrets to upload binaries to Bintray.
if: ${{ github.repository == 'AdaCore/libadalang' }}

strategy:
fail-fast: false
matrix: # Build debug and/or production
Expand All @@ -21,15 +16,19 @@ jobs:
steps:
- run: git config --global core.autocrlf input
shell: bash
- name: Force Alire to use preinstalled MSYS2
if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
mkdir -p ~/.config/alire
echo '[msys2]' >> ~/.config/alire/config.toml
echo 'install_dir = "C:\\msys64"' >> ~/.config/alire/config.toml
- name: Install iconv and gmp (Windows only)
run: pacman --noconfirm -S mingw64/mingw-w64-x86_64-libiconv mingw64/mingw-w64-x86_64-gmp
if: ${{ runner.os == 'Windows' }}
uses: msys2/setup-msys2@v2
with:
path-type: inherit
update: true
install: >-
mingw64/mingw-w64-x86_64-libiconv
mingw64/mingw-w64-x86_64-gmp
shell: c:\msys64\usr\bin\bash.exe -l -e -o pipefail {0}
env:
MSYSTEM: MINGW64
- name: Get libadalang
uses: actions/checkout@v3
- name: Get gprbuild for libgpr
Expand Down Expand Up @@ -75,22 +74,18 @@ jobs:
- uses: actions/cache@v3
with:
path: ./cached_gnat
key: ${{ runner.os }}-alire-2022
key: ${{ runner.os }}-alire-2023
- name: Get GNAT toolchain with alire
uses: alire-project/setup-alire@v2
with:
toolchain: gnat_native^12 gprbuild^22
toolchain: gnat_native^13 gprbuild^22
toolchain_dir: ./cached_gnat
- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build Libadalang and its dependencies (Windows)
if: ${{ runner.os == 'Windows' }}
shell: msys2 {0}
run: utils/gh-build-binaries.sh "${{ matrix.debug }}" ${{ runner.os }}
- name: Build Libadalang and its dependencies (non-Windows)
if: ${{ runner.os != 'Windows' }}
- name: Build Libadalang and its dependencies
shell: bash
run: utils/gh-build-binaries.sh "${{ matrix.debug }}" ${{ runner.os }}
- name: Keep artifacts
uses: actions/upload-artifact@v3
Expand Down
8 changes: 4 additions & 4 deletions utils/gh-build-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export CPATH=/usr/local/include
export LIBRARY_PATH=/usr/local/lib
if [ $RUNNER_OS = Windows ]; then
export prefix=/opt/ADALIB_DIR
export CPATH=`cygpath -w /mingw64/include`
export LIBRARY_PATH=`cygpath -w /mingw64/lib`
mount `cygpath -w $RUNNER_TEMP|cut -d: -f1`:/opt /opt
export CPATH=`cygpath -w /c/msys64/mingw64/include`
export LIBRARY_PATH=`cygpath -w /c/msys64/mingw64/lib`
mount D:/opt /opt
fi
export PROCESSORS=0
export GPR_PROJECT_PATH=$prefix/share/gpr
Expand All @@ -20,7 +20,7 @@ echo PATH=$PATH
pip install -r langkit/requirements-github.txt
pip install jsonschema
pip install langkit/
eval `langkit/manage.py setenv`
eval `langkit/manage.py setenv | grep -v ^PATH=`
alr --non-interactive get xmlada

build_archive()
Expand Down

0 comments on commit e0c7729

Please sign in to comment.