Skip to content

Commit

Permalink
U922-009 Use GCC 11 toolchain by alire
Browse files Browse the repository at this point in the history
and get rid of outdated GNAT CE 2020 for Mac OS
  • Loading branch information
reznikmm authored and pmderodat committed Oct 1, 2021
1 parent 4036873 commit 1428b3f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
27 changes: 8 additions & 19 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@ jobs:
uses: actions/checkout@v2
with:
repository: AdaCore/gprbuild
path: gprbuild
fetch-depth: 0 # To be able do `git revert`
- name: Revert a libgpr patch (MacOS X only)
# The latest libgpr doesn't support GNAT CE 2020, but on MacOS X we
# don't have GNAT CE 2021. Let's revert this commit for now.
if: ${{ runner.os == 'macOS' }}
run: git -C gprbuild revert --no-edit 3341766255bf5ab90fe05a8e162894b7830adca6
# `gprbuild` directory raises a conflict in alr:
# https://github.com/alire-project/alire/issues/864
path: gprbuild_
- name: Get gnatcoll core
uses: actions/checkout@v2
with:
Expand All @@ -66,19 +62,12 @@ jobs:
- uses: actions/cache@v2
with:
path: ./cached_gnat
key: ${{ runner.os }}-gnat-ce-2021
- name: Get GNAT Community 2021 toolchain
if: ${{ runner.os != 'macOS' }}
uses: ada-actions/toolchain@ce2021
key: ${{ runner.os }}-alire-2021
- name: Get GNAT toolchain with alire
uses: alire-project/setup-alire@v1
with:
distrib: community
install_dir: ./cached_gnat
- name: Get GNAT Community 2020 toolchain
if: ${{ runner.os == 'macOS' }}
uses: ada-actions/toolchain@ce2020
with:
distrib: community
install_dir: ./cached_gnat
toolchain: gnat_native^11 gprbuild^21
toolchain_dir: ./cached_gnat
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
Expand Down
16 changes: 12 additions & 4 deletions utils/gh-build-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export GPR_PROJECT_PATH=$prefix/share/gpr
export CPATH=/usr/local/include:/mingw64/include
export LIBRARY_PATH=/usr/local/lib:/mingw64/lib
export DYLD_LIBRARY_PATH=/usr/local/lib
export PATH=`ls -d $PWD/cached_gnat/*/bin |tr '\n' ':'`$PATH
echo PATH=$PATH

if [ $RUNNER_OS = Linux ]; then
LIBRARY_TYPES="relocatable,static"
else
Expand All @@ -20,11 +23,14 @@ fi
pip install -r langkit/REQUIREMENTS.dev
pip install jsonschema
pip install langkit/
# gnat-ce installation is cached, so gnatcoll/gpr could be uninstalled already
gprinstall --uninstall gnatcoll || true
gprinstall --uninstall gpr || true

make -C gprbuild prefix=$prefix BUILD=${DEBUG:-production} GPRBUILD_OPTIONS="-cargs:C -Dst_mtim=st_mtimespec -gargs" libgpr.build.{shared,static} libgpr.install.{shared,static}
alr --non-interactive get xmlada
cd xmlada*
./configure --prefix=$prefix ${DEBUG:+--enable-build=Debug}
make all install
cd ..

make -C gprbuild_ prefix=$prefix BUILD=${DEBUG:-production} GPRBUILD_OPTIONS="-cargs:C -Dst_mtim=st_mtimespec -gargs" libgpr.build.{shared,static} libgpr.install.{shared,static}
BUILD=`echo $DEBUG| tr [a-z] [A-Z]` # Convert to uppercase
make -C gnatcoll-core prefix=$prefix BUILD=${BUILD:-PROD} LIBRARY_TYPES="${LIBRARY_TYPES/,/ }" build install
python gnatcoll-bindings/iconv/setup.py build ${DEBUG:+--debug} -j0 --prefix=$prefix --library-types=$LIBRARY_TYPES
Expand All @@ -37,12 +43,14 @@ langkit/manage.py build-langkit-support --library-types $LIBRARY_TYPES
langkit/manage.py install-langkit-support $prefix --library-types $LIBRARY_TYPES

BUILD=${DEBUG:+dev} # Convert debug to dev

# Build libadalang static library
./manage.py generate
./manage.py build --library-types=static --build-mode ${BUILD:-prod}
./manage.py install --library-types=static --build-mode ${BUILD:-prod} $prefix
gprinstall --uninstall --prefix=$prefix mains.gpr
tar czf libadalang-$RUNNER_OS-`basename $GITHUB_REF`${DEBUG:+-dbg}-static.tar.gz -C $prefix .

# Build libadalang relocatable library
if [ "$LIBRARY_TYPES" != static ]; then
gprinstall --uninstall --prefix=$prefix libadalang.gpr
Expand Down

0 comments on commit 1428b3f

Please sign in to comment.