Skip to content

Commit 1428b3f

Browse files
reznikmmpmderodat
authored andcommitted
U922-009 Use GCC 11 toolchain by alire
and get rid of outdated GNAT CE 2020 for Mac OS
1 parent 4036873 commit 1428b3f

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

.github/workflows/build-binaries.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,9 @@ jobs:
3737
uses: actions/checkout@v2
3838
with:
3939
repository: AdaCore/gprbuild
40-
path: gprbuild
41-
fetch-depth: 0 # To be able do `git revert`
42-
- name: Revert a libgpr patch (MacOS X only)
43-
# The latest libgpr doesn't support GNAT CE 2020, but on MacOS X we
44-
# don't have GNAT CE 2021. Let's revert this commit for now.
45-
if: ${{ runner.os == 'macOS' }}
46-
run: git -C gprbuild revert --no-edit 3341766255bf5ab90fe05a8e162894b7830adca6
40+
# `gprbuild` directory raises a conflict in alr:
41+
# https://github.com/alire-project/alire/issues/864
42+
path: gprbuild_
4743
- name: Get gnatcoll core
4844
uses: actions/checkout@v2
4945
with:
@@ -66,19 +62,12 @@ jobs:
6662
- uses: actions/cache@v2
6763
with:
6864
path: ./cached_gnat
69-
key: ${{ runner.os }}-gnat-ce-2021
70-
- name: Get GNAT Community 2021 toolchain
71-
if: ${{ runner.os != 'macOS' }}
72-
uses: ada-actions/toolchain@ce2021
65+
key: ${{ runner.os }}-alire-2021
66+
- name: Get GNAT toolchain with alire
67+
uses: alire-project/setup-alire@v1
7368
with:
74-
distrib: community
75-
install_dir: ./cached_gnat
76-
- name: Get GNAT Community 2020 toolchain
77-
if: ${{ runner.os == 'macOS' }}
78-
uses: ada-actions/toolchain@ce2020
79-
with:
80-
distrib: community
81-
install_dir: ./cached_gnat
69+
toolchain: gnat_native^11 gprbuild^21
70+
toolchain_dir: ./cached_gnat
8271
- name: Setup Python 3.8
8372
uses: actions/setup-python@v2
8473
with:

utils/gh-build-binaries.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ export GPR_PROJECT_PATH=$prefix/share/gpr
1212
export CPATH=/usr/local/include:/mingw64/include
1313
export LIBRARY_PATH=/usr/local/lib:/mingw64/lib
1414
export DYLD_LIBRARY_PATH=/usr/local/lib
15+
export PATH=`ls -d $PWD/cached_gnat/*/bin |tr '\n' ':'`$PATH
16+
echo PATH=$PATH
17+
1518
if [ $RUNNER_OS = Linux ]; then
1619
LIBRARY_TYPES="relocatable,static"
1720
else
@@ -20,11 +23,14 @@ fi
2023
pip install -r langkit/REQUIREMENTS.dev
2124
pip install jsonschema
2225
pip install langkit/
23-
# gnat-ce installation is cached, so gnatcoll/gpr could be uninstalled already
24-
gprinstall --uninstall gnatcoll || true
25-
gprinstall --uninstall gpr || true
2626

27-
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}
27+
alr --non-interactive get xmlada
28+
cd xmlada*
29+
./configure --prefix=$prefix ${DEBUG:+--enable-build=Debug}
30+
make all install
31+
cd ..
32+
33+
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}
2834
BUILD=`echo $DEBUG| tr [a-z] [A-Z]` # Convert to uppercase
2935
make -C gnatcoll-core prefix=$prefix BUILD=${BUILD:-PROD} LIBRARY_TYPES="${LIBRARY_TYPES/,/ }" build install
3036
python gnatcoll-bindings/iconv/setup.py build ${DEBUG:+--debug} -j0 --prefix=$prefix --library-types=$LIBRARY_TYPES
@@ -37,12 +43,14 @@ langkit/manage.py build-langkit-support --library-types $LIBRARY_TYPES
3743
langkit/manage.py install-langkit-support $prefix --library-types $LIBRARY_TYPES
3844

3945
BUILD=${DEBUG:+dev} # Convert debug to dev
46+
4047
# Build libadalang static library
4148
./manage.py generate
4249
./manage.py build --library-types=static --build-mode ${BUILD:-prod}
4350
./manage.py install --library-types=static --build-mode ${BUILD:-prod} $prefix
4451
gprinstall --uninstall --prefix=$prefix mains.gpr
4552
tar czf libadalang-$RUNNER_OS-`basename $GITHUB_REF`${DEBUG:+-dbg}-static.tar.gz -C $prefix .
53+
4654
# Build libadalang relocatable library
4755
if [ "$LIBRARY_TYPES" != static ]; then
4856
gprinstall --uninstall --prefix=$prefix libadalang.gpr

0 commit comments

Comments
 (0)