Skip to content

Commit a0f9878

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents 149f00a + 9fedc72 commit a0f9878

File tree

6 files changed

+53
-11
lines changed

6 files changed

+53
-11
lines changed

.github/workflows/build-binaries.sh

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ DEBUG=$1 # Value is '' or 'debug'
77
RUNNER_OS=$2 # ${{ runner.os }} is Linux, Windiws, maxOS
88
TAG=$3 # For master it's 24.0.999, while for tag it's the tag itself
99
NO_REBASE=$4 # Specify this to skip the rebase over the edge branch. Used for local debugging.
10+
CROSS=$5 # '' for native, aarch64 for ARM cross
1011

1112
prefix=/tmp/ADALIB_DIR
13+
TARGET=${CROSS:+$CROSS-linux} # '' or aarch64-linux
14+
TARGET_OPTION=${TARGET:+--target=$TARGET} # '' or --target=aarch64-linux
1215

1316
export CPATH=/usr/local/include
1417
export LIBRARY_PATH=/usr/local/lib
@@ -24,6 +27,7 @@ if [ $RUNNER_OS = Windows ]; then
2427
fi
2528

2629
export GPR_PROJECT_PATH=$prefix/share/gpr:\
30+
$prefix/$TARGET/share/gpr:\
2731
$PWD/subprojects/VSS/gnat:\
2832
$PWD/subprojects/gnatdoc/gnat:\
2933
$PWD/subprojects/lal-refactor/gnat:\
@@ -52,7 +56,7 @@ cd -
5256

5357
# Get libadalang binaries
5458
mkdir -p $prefix
55-
FILE=libadalang-$RUNNER_OS-$BRANCH${DEBUG:+-dbg}-static.tar.gz
59+
FILE=libadalang-$RUNNER_OS-$BRANCH${CROSS:+-$CROSS}${DEBUG:+-dbg}-static.tar.gz
5660
# If the script is run locally for debugging, it is not always possible
5761
# to download libadalang from AWS S3. Instead, allow for the file to
5862
# be obtained otherwise and placed in the current directory for the script
@@ -82,11 +86,22 @@ fi
8286
# Log info about the compiler and library paths
8387
gnatls -v
8488

89+
# Get architecture and platform information from node.
90+
NODE_PLATFORM=$(node -e "console.log(process.platform)")
91+
92+
if [ "$CROSS" = "aarch64" ]; then
93+
NODE_ARCH=arm64
94+
else
95+
NODE_ARCH=$(node -e "console.log(process.arch)")
96+
fi
97+
8598
make -C subprojects/templates-parser setup prefix=$prefix \
86-
ENABLE_SHARED=no \
99+
ENABLE_SHARED=no ${TARGET:+TARGET=$TARGET} \
87100
${DEBUG:+BUILD=debug} build-static install-static
88101

89-
make LIBRARY_TYPE=static VERSION=$TAG all check
102+
make LIBRARY_TYPE=static VERSION=$TAG all GPRBUILD_EXTRA=$TARGET_OPTION NODE_ARCH=$NODE_ARCH
103+
[ -z "$CROSS" ] && make LIBRARY_TYPE=static check
104+
90105

91106
function fix_rpath ()
92107
{
@@ -97,9 +112,6 @@ function fix_rpath ()
97112
install_name_tool -add_rpath @executable_path $1
98113
}
99114

100-
# Get architecture and platform information from node.
101-
NODE_ARCH=$(node -e "console.log(process.arch)")
102-
NODE_PLATFORM=$(node -e "console.log(process.platform)")
103115
ALS_EXEC_DIR=integration/vscode/ada/$NODE_ARCH/$NODE_PLATFORM
104116

105117
if [ $RUNNER_OS = macOS ]; then
@@ -123,6 +135,10 @@ if [ "$DEBUG" != "debug" ]; then
123135
# system (or by XCode).
124136
dsymutil "$ALS"
125137
strip "$ALS"
138+
elif [ "$CROSS" = "aarch64" ]; then
139+
aarch64-linux-gnu-objcopy --only-keep-debug ${ALS} ${ALS}.debug
140+
aarch64-linux-gnu-objcopy --strip-all ${ALS}
141+
aarch64-linux-gnu-objcopy --add-gnu-debuglink=${ALS}.debug ${ALS}
126142
else
127143
objcopy --only-keep-debug ${ALS} ${ALS}.debug
128144
objcopy --strip-all ${ALS}

.github/workflows/build-binaries.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ jobs:
1616
matrix: # Build debug and/or production
1717
debug: [''] # '' if production, 'debug' for debug
1818
os: [macos-11, ubuntu-20.04, windows-latest]
19+
cross: ['', aarch64]
20+
exclude:
21+
- os: windows-latest
22+
cross: aarch64
23+
- os: macos-11
24+
cross: aarch64
1925
runs-on: ${{ matrix.os }}
2026
steps:
2127
- name: Setup Python
@@ -31,6 +37,18 @@ jobs:
3137
else
3238
echo "TAG=$DEFAULT_TAG" >> $GITHUB_ENV
3339
fi
40+
- name: Unpack cross toolchain from AWS S3
41+
if: ${{ matrix.cross != '' }}
42+
env:
43+
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}}
44+
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}}
45+
AWS_DEFAULT_REGION: eu-west-1
46+
run: |
47+
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256
48+
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256
49+
sudo apt install -y libc6-dev-arm64-cross linux-libc-dev-arm64-cross binutils-aarch64-linux-gnu
50+
sudo tar xavf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 -C /
51+
sudo tar xavf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 -C /
3452
- name: Force Alire use preinstalled MSYS2
3553
shell: bash
3654
if: ${{ runner.os == 'Windows' }}
@@ -98,12 +116,12 @@ jobs:
98116
run: |
99117
# This is to avoid locking .sh on win that prevents its updating
100118
cp .github/workflows/build-binaries.sh .github/workflows/build-binaries.sh_
101-
.github/workflows/build-binaries.sh_ "${{ matrix.debug }}" ${{ runner.os }} ${{ env.TAG }}
119+
.github/workflows/build-binaries.sh_ "${{ matrix.debug }}" ${{ runner.os }} ${{ env.TAG }} "" "${{ matrix.cross }}"
102120
- name: Archive ALS binary
103121
if: ${{ github.event_name == 'push' }}
104122
uses: actions/upload-artifact@v3
105123
with:
106-
name: als-${{ runner.os }}-${{ matrix.debug }}
124+
name: als-${{ runner.os }}-${{ matrix.debug }}${{ matrix.cross }}
107125
# We know that only one of the following entries will match on a given
108126
# run, so we use globs here to try to avoid warnings on unmatched
109127
# entries

.github/workflows/pack-binaries.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ function make_change_log()
1717
done
1818
}
1919

20-
chmod -R -v +x als-*-$DEBUG
20+
chmod -R -v +x als-*-$DEBUG als-Linux-${DEBUG}aarch64
2121

2222
for X in Linux macOS Windows ; do
2323
rsync -rva als-$X-$DEBUG/ integration/vscode/ada/
2424
done
2525

26+
rsync -rva als-Linux-${DEBUG}aarch64/ integration/vscode/ada/
27+
2628
# VS Code is supported on arm, arm64 and x64 so we only consider those
2729
# architectures
2830
rm -rf -v integration/vscode/ada/{arm,arm64,x64}/{linux,darwin,win32}/*.{debug,dSYM}

gnat/lsp_server.gpr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ project LSP_Server is
4747

4848
for Object_Dir use "../.obj/server";
4949
for Main use ("lsp-ada_driver.adb");
50+
for Languages use ("Ada", "C++");
5051

5152
package Compiler is
5253
for Default_Switches ("Ada") use
5354
LSP_3_17.Compiler'Default_Switches ("Ada");
5455
for Switches ("lsp-ada_driver.adb") use
5556
LSP_3_17.Compiler'Default_Switches ("Ada")
5657
& ("-gnateDVERSION=""" & VERSION & """",
57-
"-gnateDBUILD_DATE=""" & BUILD_DATE & """");
58+
"-gnateDBUILD_DATE=""" & BUILD_DATE & """");
5859
for Switches ("s-memory.adb") use ("-g", "-O2", "-gnatpg");
5960
for Local_Configuration_Pragmas use "gnat.adc";
6061
end Compiler;
6162

6263
package Linker is
63-
for Driver use "g++";
6464
case Library_Type is
6565
when "static" | "static-pic" =>
6666
case OS is

integration/vscode/ada/src/helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ export function assertSupportedEnvironments(mainChannel: winston.Logger) {
200200
{ arch: 'x64', platform: 'linux' },
201201
{ arch: 'x64', platform: 'win32' },
202202
{ arch: 'x64', platform: 'darwin' },
203+
{ arch: 'arm64', platform: 'linux' },
203204
{ arch: 'arm64', platform: 'darwin' },
204205
];
205206

source/gpr/lsp-gpr_handlers.adb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,15 @@ package body LSP.GPR_Handlers is
489489
Value : LSP.Structures.InitializeParams)
490490
is
491491
Response : LSP.Structures.InitializeResult;
492+
Capabilities : LSP.Structures.ServerCapabilities;
492493

493494
begin
494495
Self.File_Reader := LSP.GPR_File_Readers.Create (Self'Unchecked_Access);
495496

497+
Capabilities.hoverProvider := LSP.Constants.True;
498+
499+
Response.capabilities := Capabilities;
500+
496501
Response.capabilities.textDocumentSync :=
497502
(Is_Set => True,
498503
Value => (Is_TextDocumentSyncOptions => True,

0 commit comments

Comments
 (0)