Skip to content

Commit

Permalink
Merge remote branch 'origin/master' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
automatic-merge committed Nov 29, 2023
2 parents 149f00a + 9fedc72 commit a0f9878
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 11 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/build-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ DEBUG=$1 # Value is '' or 'debug'
RUNNER_OS=$2 # ${{ runner.os }} is Linux, Windiws, maxOS
TAG=$3 # For master it's 24.0.999, while for tag it's the tag itself
NO_REBASE=$4 # Specify this to skip the rebase over the edge branch. Used for local debugging.
CROSS=$5 # '' for native, aarch64 for ARM cross

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

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

export GPR_PROJECT_PATH=$prefix/share/gpr:\
$prefix/$TARGET/share/gpr:\
$PWD/subprojects/VSS/gnat:\
$PWD/subprojects/gnatdoc/gnat:\
$PWD/subprojects/lal-refactor/gnat:\
Expand Down Expand Up @@ -52,7 +56,7 @@ cd -

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

# Get architecture and platform information from node.
NODE_PLATFORM=$(node -e "console.log(process.platform)")

if [ "$CROSS" = "aarch64" ]; then
NODE_ARCH=arm64
else
NODE_ARCH=$(node -e "console.log(process.arch)")
fi

make -C subprojects/templates-parser setup prefix=$prefix \
ENABLE_SHARED=no \
ENABLE_SHARED=no ${TARGET:+TARGET=$TARGET} \
${DEBUG:+BUILD=debug} build-static install-static

make LIBRARY_TYPE=static VERSION=$TAG all check
make LIBRARY_TYPE=static VERSION=$TAG all GPRBUILD_EXTRA=$TARGET_OPTION NODE_ARCH=$NODE_ARCH
[ -z "$CROSS" ] && make LIBRARY_TYPE=static check


function fix_rpath ()
{
Expand All @@ -97,9 +112,6 @@ function fix_rpath ()
install_name_tool -add_rpath @executable_path $1
}

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

if [ $RUNNER_OS = macOS ]; then
Expand All @@ -123,6 +135,10 @@ if [ "$DEBUG" != "debug" ]; then
# system (or by XCode).
dsymutil "$ALS"
strip "$ALS"
elif [ "$CROSS" = "aarch64" ]; then
aarch64-linux-gnu-objcopy --only-keep-debug ${ALS} ${ALS}.debug
aarch64-linux-gnu-objcopy --strip-all ${ALS}
aarch64-linux-gnu-objcopy --add-gnu-debuglink=${ALS}.debug ${ALS}
else
objcopy --only-keep-debug ${ALS} ${ALS}.debug
objcopy --strip-all ${ALS}
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ jobs:
matrix: # Build debug and/or production
debug: [''] # '' if production, 'debug' for debug
os: [macos-11, ubuntu-20.04, windows-latest]
cross: ['', aarch64]
exclude:
- os: windows-latest
cross: aarch64
- os: macos-11
cross: aarch64
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python
Expand All @@ -31,6 +37,18 @@ jobs:
else
echo "TAG=$DEFAULT_TAG" >> $GITHUB_ENV
fi
- name: Unpack cross toolchain from AWS S3
if: ${{ matrix.cross != '' }}
env:
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}}
AWS_DEFAULT_REGION: eu-west-1
run: |
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256
sudo apt install -y libc6-dev-arm64-cross linux-libc-dev-arm64-cross binutils-aarch64-linux-gnu
sudo tar xavf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 -C /
sudo tar xavf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 -C /
- name: Force Alire use preinstalled MSYS2
shell: bash
if: ${{ runner.os == 'Windows' }}
Expand Down Expand Up @@ -98,12 +116,12 @@ jobs:
run: |
# This is to avoid locking .sh on win that prevents its updating
cp .github/workflows/build-binaries.sh .github/workflows/build-binaries.sh_
.github/workflows/build-binaries.sh_ "${{ matrix.debug }}" ${{ runner.os }} ${{ env.TAG }}
.github/workflows/build-binaries.sh_ "${{ matrix.debug }}" ${{ runner.os }} ${{ env.TAG }} "" "${{ matrix.cross }}"
- name: Archive ALS binary
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v3
with:
name: als-${{ runner.os }}-${{ matrix.debug }}
name: als-${{ runner.os }}-${{ matrix.debug }}${{ matrix.cross }}
# We know that only one of the following entries will match on a given
# run, so we use globs here to try to avoid warnings on unmatched
# entries
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pack-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ function make_change_log()
done
}

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

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

rsync -rva als-Linux-${DEBUG}aarch64/ integration/vscode/ada/

# VS Code is supported on arm, arm64 and x64 so we only consider those
# architectures
rm -rf -v integration/vscode/ada/{arm,arm64,x64}/{linux,darwin,win32}/*.{debug,dSYM}
Expand Down
4 changes: 2 additions & 2 deletions gnat/lsp_server.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ project LSP_Server is

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

package Compiler is
for Default_Switches ("Ada") use
LSP_3_17.Compiler'Default_Switches ("Ada");
for Switches ("lsp-ada_driver.adb") use
LSP_3_17.Compiler'Default_Switches ("Ada")
& ("-gnateDVERSION=""" & VERSION & """",
"-gnateDBUILD_DATE=""" & BUILD_DATE & """");
"-gnateDBUILD_DATE=""" & BUILD_DATE & """");
for Switches ("s-memory.adb") use ("-g", "-O2", "-gnatpg");
for Local_Configuration_Pragmas use "gnat.adc";
end Compiler;

package Linker is
for Driver use "g++";
case Library_Type is
when "static" | "static-pic" =>
case OS is
Expand Down
1 change: 1 addition & 0 deletions integration/vscode/ada/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export function assertSupportedEnvironments(mainChannel: winston.Logger) {
{ arch: 'x64', platform: 'linux' },
{ arch: 'x64', platform: 'win32' },
{ arch: 'x64', platform: 'darwin' },
{ arch: 'arm64', platform: 'linux' },
{ arch: 'arm64', platform: 'darwin' },
];

Expand Down
5 changes: 5 additions & 0 deletions source/gpr/lsp-gpr_handlers.adb
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,15 @@ package body LSP.GPR_Handlers is
Value : LSP.Structures.InitializeParams)
is
Response : LSP.Structures.InitializeResult;
Capabilities : LSP.Structures.ServerCapabilities;

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

Capabilities.hoverProvider := LSP.Constants.True;

Response.capabilities := Capabilities;

Response.capabilities.textDocumentSync :=
(Is_Set => True,
Value => (Is_TextDocumentSyncOptions => True,
Expand Down

0 comments on commit a0f9878

Please sign in to comment.