Skip to content

Commit 51cf85b

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents a0f1213 + 490b6ef commit 51cf85b

File tree

2 files changed

+43
-20
lines changed

2 files changed

+43
-20
lines changed

.github/workflows/build-binaries.sh

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash
2+
3+
# -x causes commands to be logged before invocation
4+
# -e causes the execution to terminate as soon as any command fails
25
set -x -e
36
DEBUG=$1 # Value is '' or 'debug'
47
RUNNER_OS=$2 # ${{ runner.os }} is Linux, Windiws, maxOS
@@ -44,20 +47,34 @@ cd -
4447
# Get libadalang binaries
4548
mkdir -p $prefix
4649
FILE=libadalang-$RUNNER_OS-$BRANCH${DEBUG:+-dbg}-static.tar.gz
47-
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/$FILE . --sse=AES256
48-
tar xzf $FILE -C $prefix
49-
rm -f -v $FILE
50+
# If the script is run locally for debugging, it is not always possible
51+
# to download libadalang from AWS S3. Instead, allow for the file to
52+
# be obtained otherwise and placed in the current directory for the script
53+
# to use. Thus, if the file is already there, we don't download it again
54+
# and we don't delete it after use.
55+
if [ ! -f "$FILE" ]; then
56+
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/$FILE . --sse=AES256
57+
tar xzf $FILE -C $prefix
58+
rm -f -v $FILE
59+
else
60+
# Untar the existing file and don't delete it
61+
tar xzf $FILE -C $prefix
62+
fi
5063

51-
which python
52-
pip install --user e3-testsuite
53-
python -c "import sys;print('e3' in sys.modules)"
64+
which python3
65+
which pip3
66+
pip3 install --user e3-testsuite
67+
python3 -c "import sys;print('e3' in sys.modules)"
5468

5569
if [ "$DEBUG" = "debug" ]; then
5670
export BUILD_MODE=dev
5771
else
5872
export BUILD_MODE=prod
5973
fi
6074

75+
# Log info about the compiler and library paths
76+
gnatls -v
77+
6178
make -C subprojects/templates-parser setup prefix=$prefix \
6279
ENABLE_SHARED=no \
6380
${DEBUG:+BUILD=debug} build-static install-static
@@ -74,21 +91,27 @@ function fix_rpath ()
7491
}
7592

7693
if [ $RUNNER_OS = macOS ]; then
77-
cp -v /usr/local/opt/gmp/lib/libgmp.10.dylib integration/vscode/ada/darwin/
94+
cp -v -f /usr/local/opt/gmp/lib/libgmp.10.dylib integration/vscode/ada/darwin/
7895
fix_rpath integration/vscode/ada/darwin/ada_language_server
7996
fi
8097

8198
if [ "$DEBUG" != "debug" ]; then
82-
if [ $RUNNER_OS = macOS ]; then
83-
# Install binutils to have objcopy on Mac OS X
84-
brew install binutils
85-
export PATH="/usr/local/opt/binutils/bin:$PATH"
86-
fi
8799
ALS=`ls integration/vscode/ada/*/ada_language_server*`
88-
objcopy --only-keep-debug ${ALS} ${ALS}.debug
89-
objcopy --strip-all ${ALS}
90100
cd `dirname $ALS`
91101
ALS=`basename ${ALS}`
92-
objcopy --add-gnu-debuglink=${ALS}.debug ${ALS}
102+
if [ $RUNNER_OS = macOS ]; then
103+
# On macOS using objcopy from binutils to strip debug symbols to a
104+
# separate file doesn't work. Namely, the last step `objcopy
105+
# --add-gnu-debuglink` yields an executable that crashes at startup.
106+
#
107+
# Instead we use dsymutil and strip which are commands provided by the
108+
# system (or by XCode).
109+
dsymutil "$ALS"
110+
strip "$ALS"
111+
else
112+
objcopy --only-keep-debug ${ALS} ${ALS}.debug
113+
objcopy --strip-all ${ALS}
114+
objcopy --add-gnu-debuglink=${ALS}.debug ${ALS}
115+
fi
93116
cd -
94117
fi

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ ifneq ($(COVERAGE),)
113113
endif
114114

115115
clean:
116-
$(GPRCLEAN) -P gnat/lsp.gpr $(LIBRARY_FLAGS)
117-
$(GPRCLEAN) -P gnat/lsp_server.gpr $(LIBRARY_FLAGS)
118-
$(GPRCLEAN) -P gnat/tester.gpr $(LIBRARY_FLAGS)
119-
$(GPRCLEAN) -P gnat/codec_test.gpr $(LIBRARY_FLAGS)
120-
rm -rf integration/vscode/ada/$(PLATFORM)
116+
-$(GPRCLEAN) -P gnat/lsp.gpr $(LIBRARY_FLAGS)
117+
-$(GPRCLEAN) -P gnat/lsp_server.gpr $(LIBRARY_FLAGS)
118+
-$(GPRCLEAN) -P gnat/tester.gpr $(LIBRARY_FLAGS)
119+
-$(GPRCLEAN) -P gnat/codec_test.gpr $(LIBRARY_FLAGS)
120+
-rm -rf integration/vscode/ada/$(PLATFORM)
121121

122122
vscode:
123123
cd integration/vscode/ada; LD_LIBRARY_PATH= npm install --no-audit && npm run compile

0 commit comments

Comments
 (0)