From a4d134131913bc2615ec7f3e906063df684c9e0b Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 29 Jul 2024 11:19:48 +0300 Subject: [PATCH] Use Alire to build ALS on GitHub Ref #1387 --- .github/workflows/build-binaries.sh | 169 ------------ .github/workflows/build-binaries.yml | 158 ++++------- .github/workflows/pack-binaries.sh | 80 +----- .github/workflows/release.sh | 106 +++++--- .gitignore | 3 - Makefile | 19 +- alire.toml | 31 +++ index/index.toml | 1 + .../lal_refactor-25.0.0-20240625.toml | 18 ++ .../prettier_ada-25.0.0-20240625.toml | 18 ++ scripts/build_als.sh | 254 ++++++++++++++++++ subprojects/.gitignore | 13 + subprojects/adasat.toml | 30 +++ subprojects/gnatcoll.toml | 48 ++++ subprojects/gnatdoc.toml | 31 +++ subprojects/lal_refactor.toml | 14 + subprojects/langkit_support.toml | 18 ++ subprojects/libadalang.toml | 24 ++ subprojects/libadalang_tools.toml | 17 ++ subprojects/libgpr.toml | 34 +++ subprojects/libgpr2.toml | 35 +++ subprojects/markdown.toml | 29 ++ subprojects/prettier_ada.toml | 20 ++ subprojects/spawn.toml | 22 ++ subprojects/vss.toml | 24 ++ 25 files changed, 815 insertions(+), 401 deletions(-) delete mode 100755 .github/workflows/build-binaries.sh create mode 100644 alire.toml create mode 100644 index/index.toml create mode 100644 index/la/lal_refactor/lal_refactor-25.0.0-20240625.toml create mode 100644 index/pr/prettier_ada/prettier_ada-25.0.0-20240625.toml create mode 100755 scripts/build_als.sh create mode 100644 subprojects/adasat.toml create mode 100644 subprojects/gnatcoll.toml create mode 100644 subprojects/gnatdoc.toml create mode 100644 subprojects/lal_refactor.toml create mode 100644 subprojects/langkit_support.toml create mode 100644 subprojects/libadalang.toml create mode 100644 subprojects/libadalang_tools.toml create mode 100644 subprojects/libgpr.toml create mode 100644 subprojects/libgpr2.toml create mode 100644 subprojects/markdown.toml create mode 100644 subprojects/prettier_ada.toml create mode 100644 subprojects/spawn.toml create mode 100644 subprojects/vss.toml diff --git a/.github/workflows/build-binaries.sh b/.github/workflows/build-binaries.sh deleted file mode 100755 index 90f42cf8a..000000000 --- a/.github/workflows/build-binaries.sh +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/bash - -# -x causes commands to be logged before invocation -# -e causes the execution to terminate as soon as any command fails -set -x -e -DEBUG=$1 # Value is '' or 'debug' -RUNNER_OS=$2 # ${{ runner.os }} is Linux, Windows, macOS -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 -if [ $RUNNER_OS = Linux ] ; then - TARGET=${CROSS:+$CROSS-linux} # '' or aarch64-linux -else - TARGET=${CROSS:+$CROSS-darwin} # '' or aarch64-darwin -fi - -TARGET_OPTION=${TARGET:+--target=$TARGET} # '' or --target=aarch64-linux - -export CPATH=/usr/local/include -export LIBRARY_PATH=/usr/local/lib -export DYLD_LIBRARY_PATH=/usr/local/lib -export PATH=`ls -d $PWD/cached_gnat/*/bin |tr '\n' ':'`$PATH -export ADAFLAGS=-g1 - -if [ $RUNNER_OS = Windows ]; then - prefix=/opt/ADALIB_DIR - export CPATH=`cygpath -w /c/msys64/mingw64/include` - export LIBRARY_PATH=`cygpath -w /c/msys64/mingw64/lib` - mount D:/opt /opt -fi - -export GPR_PROJECT_PATH=$prefix/share/gpr:\ -$prefix/$TARGET/share/gpr:\ -$PWD/subprojects/gnatdoc/gnat:\ -$PWD/subprojects/lal-refactor/gnat:\ -$PWD/subprojects/libadalang-tools/src:\ -$PWD/subprojects/spawn/gnat:\ -$PWD/subprojects/stubs -echo PATH=$PATH - -BRANCH=master - -# Rebase PR on edge branch -if [[ -z "$NO_REBASE" && ${GITHUB_REF##*/} != 2*.[0-9]*.[0-9]* ]]; then - git config user.email "`git log -1 --pretty=format:'%ae'`" - git config user.name "`git log -1 --pretty=format:'%an'`" - git config core.autocrlf - git config core.autocrlf input - git rebase --verbose origin/edge -fi - -# Audit the npm packages -cd integration/vscode/ada -npm install -# Run npm audit to check for any vulnerabilities -npm audit -cd - - -# Get libadalang binaries -mkdir -p $prefix -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 -# to use. Thus, if the file is already there, we don't download it again -# and we don't delete it after use. -if [ ! -f "$FILE" ]; then - aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/$FILE . --sse=AES256 - umask 0 # To avoid permission errors on MSYS2 - tar xzf $FILE -C $prefix - rm -f -v $FILE -else - # Untar the existing file and don't delete it - tar xzf $FILE -C $prefix -fi - -which python3 -which pip3 -pip3 install --user e3-testsuite -python3 -c "import sys;print('e3' in sys.modules)" - -if [ "$DEBUG" = "debug" ]; then - export BUILD_MODE=dev -else - export BUILD_MODE=prod -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 ${TARGET:+TARGET=$TARGET} \ - ${DEBUG:+BUILD=debug} build-static install-static - -make LIBRARY_TYPE=static VERSION=$TAG all GPRBUILD_EXTRA=$TARGET_OPTION NODE_ARCH=$NODE_ARCH -[ -z "$CROSS" ] && make LIBRARY_TYPE=static check - - -# Find the path to libgmp as linked in the given executable -function get_gmp_full_path() { - otool -l "$1" | grep '^\s*name.*libgmp.10.dylib' | awk '/ name /{print $2 }' -} - -function fix_rpath() { - # Remove all rpath entries - for R in $(otool -l "$1" | grep -A2 LC_RPATH | awk '/ path /{ print $2 }'); do - install_name_tool -delete_rpath "$R" "$1" - done - # Change reference to full path of libgmp into a reference to the rpath. - gmp_full_path=$(get_gmp_full_path "$1") - if [ -n "$gmp_full_path" ]; then - install_name_tool -change "$gmp_full_path" @rpath/libgmp.10.dylib "$1" - fi - # Add the executable directory to rpath so it can find shared libraries - # packaged alongside the executable. - install_name_tool -add_rpath @executable_path "$1" -} - -ALS_EXEC_DIR=integration/vscode/ada/$NODE_ARCH/$NODE_PLATFORM - -if [ $RUNNER_OS = macOS ]; then - # Get full path of libgmp as linked in the ALS exec - gmp_full_path=$(get_gmp_full_path $ALS_EXEC_DIR/ada_language_server) - if [ -f "$gmp_full_path" ]; then - # Copy libgmp alongside the ALS exec - cp -v -f "$gmp_full_path" "$ALS_EXEC_DIR" - fi - # Fix rpath entries of the ALS exec so it can find libgmp alongside it - fix_rpath "$ALS_EXEC_DIR/ada_language_server" -fi - -if [ "$DEBUG" != "debug" ]; then - cd $ALS_EXEC_DIR - if [ $RUNNER_OS = Windows ]; then - ALS=ada_language_server.exe - else - ALS=ada_language_server - fi - if [ $RUNNER_OS = macOS ]; then - # On macOS using objcopy from binutils to strip debug symbols to a - # separate file doesn't work. Namely, the last step `objcopy - # --add-gnu-debuglink` yields an executable that crashes at startup. - # - # Instead we use dsymutil and strip which are commands provided by the - # 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} - objcopy --add-gnu-debuglink=${ALS}.debug ${ALS} - fi - cd - -fi diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 74fbea021..b02442ff2 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -1,25 +1,19 @@ on: push: - branches: - - edge tags: - 2*.*.* + workflow_dispatch: + name: Build binaries env: DEFAULT_TAG: 24.0.999 - AWS_DEFAULT_REGION: eu-west-1 jobs: build: name: Build and deploy strategy: fail-fast: false - 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 + matrix: + os: [macos-12, macos-14, ubuntu-20.04, windows-latest] runs-on: ${{ matrix.os }} steps: - name: Setup Python @@ -35,29 +29,6 @@ jobs: else echo "TAG=$DEFAULT_TAG" >> $GITHUB_ENV fi - - name: Install cross toolchain (Linux) - if: ${{ matrix.cross != '' && runner.os == 'Linux' }} - 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: | - sudo apt install -y libc6-dev-arm64-cross linux-libc-dev-arm64-cross binutils-aarch64-linux-gnu - aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256 - aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256 - sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 -C / - sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 -C / - - name: Install cross toolchain (MacOS) - if: ${{ matrix.cross != '' && runner.os != 'Linux' }} - 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/toolchain/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256 - aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256 - sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 --strip-components=3 -C /usr/local - sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 --strip-components=3 -C /usr/local - name: Force Alire use preinstalled MSYS2 shell: bash if: ${{ runner.os == 'Windows' }} @@ -65,98 +36,65 @@ jobs: mkdir -p ~/.config/alire echo '[msys2]' >> ~/.config/alire/config.toml echo 'install_dir = "C:\\msys64"' >> ~/.config/alire/config.toml - - name: Install iconv and gmp (Windows only) - run: pacman --noconfirm -S mingw64/mingw-w64-x86_64-libiconv mingw64/mingw-w64-x86_64-gmp - if: ${{ runner.os == 'Windows' }} - shell: c:\msys64\usr\bin\bash.exe -l -e -o pipefail {0} - env: - MSYSTEM: MINGW64 - name: Get als uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Get Spawn - uses: actions/checkout@v3 - with: - repository: AdaCore/spawn - path: subprojects/spawn - - name: Get LAL_Tools - uses: actions/checkout@v3 - with: - repository: AdaCore/libadalang-tools - path: subprojects/libadalang-tools - - name: Get Templates Parser - uses: actions/checkout@v3 - with: - repository: AdaCore/templates-parser - path: subprojects/templates-parser - - name: Get GNATdoc - uses: actions/checkout@v3 - with: - repository: AdaCore/gnatdoc - path: subprojects/gnatdoc - ref: edge - - name: Get LAL Refactor - uses: actions/checkout@v3 - with: - repository: AdaCore/lal-refactor - path: subprojects/lal-refactor - ref: edge - - uses: actions/cache@v3 - with: - path: ./cached_gnat - key: ${{ runner.os }}-alire-2023 - restore-keys: ${{ runner.os }}-alire-2023 - - name: Get GNAT toolchain with alire - uses: alire-project/setup-alire@v2 + - name: Get GNAT toolchain with alire (AArch64) + if: ${{ matrix.os == 'macos-14' }} + run: | + # alire-project/setup-alire doesn't work for ARM64 Mac OS X for now. + # https://github.com/alire-project/setup-alire/pull/74 + curl -L -O https://github.com/alire-project/alire/releases/download/nightly/alr-nightly-bin-aarch64-macos.zip + unzip alr-nightly-bin-aarch64-macos.zip + bin/alr index --reset-community + bin/alr toolchain --select gnat_native^14 gprbuild + echo $PWD/bin >> $GITHUB_PATH + - name: Get GNAT toolchain with alire (x86_64) + if: ${{ matrix.os != 'macos-14' }} + uses: alire-project/setup-alire@v3 with: - toolchain: gnat_native^13 gprbuild^22 - toolchain_dir: ./cached_gnat + toolchain: gnat_native^14 gprbuild - name: Build shell: bash - env: - AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}} - AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}} 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 }} "" "${{ matrix.cross }}" + alr settings --global --set dependencies.shared false + pip3 install e3-testsuite + scripts/build_als.sh all "$TAG" - name: Archive ALS binary - if: ${{ github.event_name == 'push' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: als-${{ runner.os }}-${{ matrix.debug }}${{ matrix.cross }} + name: als-${{ matrix.os }} # 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 path: | integration/vscode/ada/arm* integration/vscode/ada/x64* - package: - if: ${{ github.event_name == 'push' }} - needs: build - runs-on: ubuntu-latest - steps: - - name: Get als - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Download all workflow run artifacts - uses: actions/download-artifact@v3 - - name: Pack vscode extension + commits.txt + - name: Upload release + shell: bash + if: ${{ env.TAG != env.DEFAULT_TAG }} run: | - if [[ ${GITHUB_REF##*/} = 2*.[0-9]*.[0-9]* ]]; then - TAG="${GITHUB_REF##*/}" - .github/workflows/release.sh "" "${{ secrets.GITHUB_TOKEN }}" $TAG - # .github/workflows/release.sh "debug" "${{ secrets.GITHUB_TOKEN }}" $TAG - else - TAG="$DEFAULT_TAG" - fi - echo "TAG=$TAG" >> $GITHUB_ENV - .github/workflows/pack-binaries.sh "" "${{secrets.VSCE_TOKEN}}" "${{secrets.OPENVSX_TOKEN}}" $TAG - # .github/workflows/pack-binaries.sh "debug" "${{secrets.VSCE_TOKEN}}" "${{secrets.OPENVSX_TOKEN}}" $TAG - - name: Archive ALS vsix - uses: actions/upload-artifact@v3 + .github/workflows/release.sh "${{ secrets.GITHUB_TOKEN }}" $TAG "" + - name: Package + shell: bash + run: | + .github/workflows/pack-binaries.sh "$TAG" + - name: Archive VSIX binary + uses: actions/upload-artifact@v4 with: - name: als-vsix-${{ matrix.debug }}${{ env.TAG }} - path: '*.vsix' + name: vsix-${{ matrix.os }} + path: "*.vsix" + - name: Upload result to AWS + shell: bash + if: ${{ github.repository == 'AdaCore/ada_language_server' && startsWith(matrix.os, 'macos-') }} + env: + AWS_ACCESS_KEY_ID: ${{secrets.GHA_PUBLISH_ACCESS_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_PUBLISH_SECRET}} + AWS_DEFAULT_REGION: eu-west-1 + run: | + for FILE in *.vsix ; do + aws s3 cp ${FILE} s3://adacore-gha-tray-eu-west-1/vscode-extension/${TAG}/ --sse=AES256 + done + aws s3 ls s3://adacore-gha-tray-eu-west-1/vscode-extension/${TAG}/ diff --git a/.github/workflows/pack-binaries.sh b/.github/workflows/pack-binaries.sh index c3d2ef63c..5749b935e 100755 --- a/.github/workflows/pack-binaries.sh +++ b/.github/workflows/pack-binaries.sh @@ -1,46 +1,9 @@ #!/bin/bash set -x -e -DEBUG=$1 # Value is '' or 'debug' -VSCE_TOKEN=$2 -OVSX_TOKEN=$3 -TAG=$4 # For master it's 24.0.999, while for tag it's the tag itself - -function make_change_log() { - echo "# Release notes" - echo "" - for TAG_ID in $(git tag --list --sort=-v:refname '2*'); do - DATE=$(git show --no-patch --format=Date:%ad --date=short "$TAG_ID" | - grep Date: | sed -e s/Date://) - echo "## $TAG_ID ($DATE)" - git show --no-patch --format=%n "$TAG_ID" | sed -e '1,/Release notes/d' - done -} - -function os_to_node_platform() { - case "$1" in - Linux) - echo -n "linux" - ;; - Windows) - echo -n "win32" - ;; - macOS) - echo -n "darwin" - ;; - esac -} - -function cross_to_node_arch() { - case "$1" in - aarch64) - echo -n "arm64" - ;; - *) - echo -n "x64" - ;; - esac -} +TAG=$1 # For master it's 24.0.999, while for tag it's the tag itself +NODE_PLATFORM=$(node -e "console.log(process.platform)") +NODE_ARCH=$(node -e "console.log(process.arch)") ext_dir=integration/vscode/ada ( @@ -48,9 +11,6 @@ ext_dir=integration/vscode/ada # Set package version based on the Git tag sed -i -e "/version/s/[0-9][0-9.]*/$TAG/" package.json - # Change extension ID and name if we're in debug mode - [ -z "$DEBUG" ] || sed -i -e '/^ "name"/s/ada/ada-debug/' \ - -e '/displayName/s/Ada & SPARK/Ada & SPARK (with debug info)/' package.json # Install NPM deps npm -v @@ -58,37 +18,11 @@ ext_dir=integration/vscode/ada which node npm install - # Create change log - make_change_log >CHANGELOG.md + # Delete debug info + rm -rf -v {arm,arm64,x64}/{linux,darwin,win32}/*.{debug,dSYM} + # Create the VSIX + npx vsce package --target "${NODE_PLATFORM}-${NODE_ARCH}" ) -# At the moment we only create VSIX-es for macOS on GitHub. Other platforms are -# provided elsewhere. -# shellcheck disable=SC2043 -for OS in macOS Windows Linux; do - for CROSS in "" "aarch64"; do - source=als-"$OS"-"$DEBUG""$CROSS" - if [ -d "$source" ]; then - # Make sure the file are executable - chmod -R -v +x "$source" - # Copy the binary in place - rsync -rva als-$OS-"$DEBUG""$CROSS"/ "$ext_dir"/ - # Delete debug info - rm -rf -v "$ext_dir"/{arm,arm64,x64}/{linux,darwin,win32}/*.{debug,dSYM} - - ( - cd "$ext_dir" - # Create the VSIX - npx vsce package --target "$(os_to_node_platform $OS)-$(cross_to_node_arch $CROSS)" - ) - - # Cleanup the binary directory - rm -rf -v "$ext_dir"/{arm,arm64,x64} - fi - done -done - # Move all .vsix packages to the root of the checkout mv -v "$ext_dir"/*.vsix . -# Discard the package.json and package-lock.json changes -git checkout "$ext_dir"/package*.json diff --git a/.github/workflows/release.sh b/.github/workflows/release.sh index 86b016ab0..dd1b7aadd 100755 --- a/.github/workflows/release.sh +++ b/.github/workflows/release.sh @@ -1,60 +1,82 @@ #!/bin/bash set -x -e -DEBUG=$1 # Value is '' or 'debug' -GITHUB_ACCESS_TOKEN=$2 -TAG=$3 # Release name/tag +GITHUB_ACCESS_TOKEN=$1 +TAG=$2 # Release name/tag +NODE_ARCH_PLATFORM=$3 # One of: +# arm64/darwin +# arm64/linux +# x64/darwin +# x64/linux +# x64/win32 + +if [[ -z "$NODE_ARCH_PLATFORM" ]]; then + # Get architecture and platform information from node. + NODE_PLATFORM=$(node -e "console.log(process.platform)") + NODE_ARCH=$(node -e "console.log(process.arch)") + NODE_ARCH_PLATFORM=$NODE_ARCH/$NODE_PLATFORM + NAME=$NODE_ARCH-$NODE_PLATFORM +else + NAME=${NODE_ARCH_PLATFORM%/*}-${NODE_ARCH_PLATFORM#*/} +fi # For tags `actions/checkout@v2` action fetches a tag's commit, but # not the tag annotation itself. Let's refetch the tag from origin. # This makes `git show --no-patch --format=%n $TAG` work again. -git tag --delete $TAG +git tag --delete "$TAG" git fetch --tags -git show --no-patch --format=%n $TAG | \ - sed -e '1,/Release notes/d' > release_notes.md +function release_notes() { + echo "# Release notes" + + git show --no-patch --format=%n "$TAG" | + sed -e '1,/Release notes/d' + echo "" + + COMMITS=commits.txt + + if [ -f "$COMMITS" ]; then + { + echo "# Dependency commits" + echo "" + cat "$COMMITS" + echo "" + } + fi +} + +release_notes >release_notes.md # Try to create a release -jq --null-input --arg tag $TAG \ +jq --null-input --arg tag "$TAG" \ --rawfile body release_notes.md \ - '{"tag_name": $tag, "name": $tag, "body": $body}' | \ -curl -v \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token $GITHUB_ACCESS_TOKEN" \ - -H 'Content-Type: application/json' \ - https://api.github.com/repos/$GITHUB_REPOSITORY/releases \ - -d "@-" + '{"tag_name": $tag, "name": $tag, "body": $body}' | + curl -v \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token $GITHUB_ACCESS_TOKEN" \ + -H 'Content-Type: application/json' \ + "https://api.github.com/repos/$GITHUB_REPOSITORY/releases" \ + -d "@-" rm -f release_notes.md # Get asset upload url, drop "quotes" around it and {parameters} at the end -upload_url=$( curl \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token $GITHUB_ACCESS_TOKEN" \ - https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/$TAG | \ - jq -r '.upload_url | rtrimstr("{?name,label}")') +upload_url=$(curl \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token $GITHUB_ACCESS_TOKEN" \ + "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/$TAG" | + jq -r '.upload_url | rtrimstr("{?name,label}")') echo "upload_url=$upload_url" -chmod -R -v +x als-*-$DEBUG - -for CROSS in "" "aarch64" ; do - for X in Linux macOS Windows ; do - FILE=als-$TAG-$X${DEBUG:+-debug}_${CROSS:-amd64}.zip - if [ -d als-$X-$DEBUG$CROSS ] ; then - cd als-$X-$DEBUG$CROSS - zip -9 -r ../$FILE . - cd .. - - # Upload $FILE as an asset to the release - curl \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token $GITHUB_ACCESS_TOKEN" \ - -H 'Content-Type: application/zip' \ - --data-binary @$FILE \ - $upload_url?name=$FILE - rm -v -f $FILE - fi - done -done +FILE=$NAME.tar.gz +tar czvf "$FILE" "integration/vscode/ada/$NODE_ARCH_PLATFORM" commits.txt + +# Upload $FILE as an asset to the release +curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token $GITHUB_ACCESS_TOKEN" \ + -H 'Content-Type: application/tar+gzip' \ + --data-binary "@$FILE" \ + "$upload_url?name=$FILE" diff --git a/.gitignore b/.gitignore index 6e668c153..9c6f45ceb 100644 --- a/.gitignore +++ b/.gitignore @@ -100,9 +100,6 @@ testsuite/.als/inout.txt # GNAT Studio clangd options .clang-format -# Subprojects -subprojects/ - # Temporary testsuite's files and directories testsuite/ada_lsp/project_symlinks/link diff --git a/Makefile b/Makefile index 3fe866ee7..44f7b99f5 100644 --- a/Makefile +++ b/Makefile @@ -93,16 +93,27 @@ else -gnatyN endif +ifeq ($(ALIRE),True) + # When we use Alire to build ALS we expect BUILD_MODE and LIBRARY_TYPE + # is already set (see build_als.sh). OS is set in spawn crate TOML file. + # That's why we don't need FLAGS here. + COVERAGE_BUILD_FLAGS= + BUILD_FLAGS= +endif + all: coverage-instrument - $(GPRBUILD) -P gnat/lsp_3_17.gpr -p $(COVERAGE_BUILD_FLAGS) - $(GPRBUILD) -P gnat/tester.gpr -p $(BUILD_FLAGS) - $(GPRBUILD) -d -ws -c -u -P gnat/lsp_server.gpr -p $(BUILD_FLAGS) s-memory.adb +ifeq ($(ALIRE),True) + alr build -- -XVERSION=$(VERSION) -XBUILD_DATE=$(BUILD_DATE) $(GPRBUILD_FLAGS) +else $(GPRBUILD) -P gnat/lsp_server.gpr -p $(COVERAGE_BUILD_FLAGS) \ -XVERSION=$(VERSION) -XBUILD_DATE=$(BUILD_DATE) +endif + $(GPRBUILD) -P gnat/lsp_3_17.gpr -p $(COVERAGE_BUILD_FLAGS) + $(GPRBUILD) -P gnat/tester.gpr -p $(BUILD_FLAGS) $(GPRBUILD) -P gnat/lsp_client.gpr -p $(COVERAGE_BUILD_FLAGS) ifdef NODE mkdir -p integration/vscode/ada/$(NODE_ARCH)/$(NODE_PLATFORM) - cp -f $(ALS) integration/vscode/ada/$(NODE_ARCH)/$(NODE_PLATFORM) + cp -v -f $(ALS) integration/vscode/ada/$(NODE_ARCH)/$(NODE_PLATFORM) endif generate: diff --git a/alire.toml b/alire.toml new file mode 100644 index 000000000..359aa4e11 --- /dev/null +++ b/alire.toml @@ -0,0 +1,31 @@ +description = "An implementation of the Microsoft's Language Server Protocol for Ada" +name = "ada_language_server" +version = "24.0.7-dev" +website = "https://github.com/AdaCore/ada_language_server" +authors = ["AdaCore"] +licenses = "GPL-3.0-only" +maintainers = ["Maxim Reznik "] +maintainers-logins = ["reznikmm"] +project-files = ["gnat/lsp_server.gpr"] +tags = ["lsp", "vscode"] + +[environment] +ADA_PROJECT_PATH.set= "${CRATE_ROOT}/subprojects/stubs" + +[gpr-set-externals."case(os)".linux] +OS = "unix" +[gpr-set-externals."case(os)".macos] +OS = "osx" +[gpr-set-externals."case(os)".windows] +OS = "Windows_NT" + +[[depends-on]] +gnatcoll = "^24.0.0" +libadalang = "^24.0.0" +libgpr2 = "^24.0.0" +vss = "^24.0.0" +libadalang_tools = "^24.0.0" +lal_refactor = "25.0.0-20240625" +gnatdoc = "^24.0.0" +spawn = "^24.0.0" + diff --git a/index/index.toml b/index/index.toml new file mode 100644 index 000000000..d28b3ddc3 --- /dev/null +++ b/index/index.toml @@ -0,0 +1 @@ +version = "1.3.0" diff --git a/index/la/lal_refactor/lal_refactor-25.0.0-20240625.toml b/index/la/lal_refactor/lal_refactor-25.0.0-20240625.toml new file mode 100644 index 000000000..1c49655cc --- /dev/null +++ b/index/la/lal_refactor/lal_refactor-25.0.0-20240625.toml @@ -0,0 +1,18 @@ +name = "lal_refactor" +description = "Source code refactoring tools for the Ada" +version = "25.0.0-20240625" + +authors = ["AdaCore"] +maintainers = ["Maxim Reznik "] +maintainers-logins = ["reznikmm"] +licenses = "Apache-2.0" +website = "https://github.com/AdaCore/lal-refactor" +tags = ["static-analysis"] +project-files = ["gnat/lal_refactor.gpr"] + +[origin] +url = "git+https://github.com/AdaCore/lal-refactor" +commit = "9a09c7f910fb5a229741cb41099e97625ea6db1b" + +[[depends-on]] +libadalang_tools = "*" diff --git a/index/pr/prettier_ada/prettier_ada-25.0.0-20240625.toml b/index/pr/prettier_ada/prettier_ada-25.0.0-20240625.toml new file mode 100644 index 000000000..3656e6e7c --- /dev/null +++ b/index/pr/prettier_ada/prettier_ada-25.0.0-20240625.toml @@ -0,0 +1,18 @@ +name = "prettier_ada" +description = "A library to create formatters for any language." +version = "25.0.0-20240625" + +authors = ["AdaCore"] +maintainers = ["João Azevedo "] +maintainers-logins = ["joaopsazevedo"] +licenses = "Apache-2.0" +website = "https://github.com/AdaCore/prettier-ada" +tags = ["format", "prettier"] + +[[depends-on]] +gnatcoll = "*" +vss = "*" + +[origin] +url = "git+https://github.com/AdaCore/prettier-ada" +commit = "4635f872b1992376f89735d9dd987ad93648fe96" diff --git a/scripts/build_als.sh b/scripts/build_als.sh new file mode 100755 index 000000000..5eb306926 --- /dev/null +++ b/scripts/build_als.sh @@ -0,0 +1,254 @@ +#!/bin/bash + +set -e -x + +STEP=${1:-all} +TAG=$2 # For master it's 24.0.999, while for tag it's the tag itself +NODE_ARCH_PLATFORM=$3 # Empty - autodetect with `node`, otherwise one of: +# arm64/darwin +# arm64/linux +# x64/darwin +# x64/linux +# x64/win32 + +# Crates to pin from GitHub repo + +PINS=" +adasat +gnatcoll +gnatdoc +lal_refactor +langkit_support +libadalang +libadalang_tools +libgpr +libgpr2 +markdown +prettier_ada +spawn +vss +" + +# Pins repo names (crate name by default) + +repo_adasat=AdaSAT +repo_gnatcoll=gnatcoll-core +repo_lal_refactor=lal-refactor +repo_langkit_support=langkit +repo_libadalang_tools=libadalang-tools +repo_libgpr=gprbuild +repo_libgpr2=gpr +repo_prettier_ada=prettier-ada +repo_vss=VSS + +# Pins branches (master by default) + +branch_gnatdoc=edge +branch_lal_refactor=edge +branch_libgpr2=next +branch_prettier_ada=main + +# A temporary file for langkit setevn +SETENV=$PWD/subprojects/libadalang/setenv.sh + +# Set `prod` build mode +######################## +# for adasat,lal,langkit,lal_refactor,laltools,markdown,spawn +export BUILD_MODE=prod +# for others +export GNATCOLL_BUILD_MODE=PROD +export GPR_BUILD=production +export GPR2_BUILD=release +export VSS_BUILD_PROFILE=release +export PRETTIER_ADA_BUILD_MODE=prod + +# Install custom Alire index with missing crates +function install_index() { + alr index --del=als || true + alr index --add="$PWD" --name=als +} + +# Clone dependencies +function pin_crates() { + echo "$(git rev-parse HEAD) ada_language_server" >commits.txt + + for crate in $PINS; do + repo_var=repo_$crate + branch_var=branch_$crate + + repo=${!repo_var} + branch=${!branch_var} + + URL="https://github.com/AdaCore/${repo:-$crate}.git" + GIT="git clone --depth=1" + [ -d "subprojects/$crate" ] || + $GIT -b "${branch:-master}" "$URL" "subprojects/$crate" + commit=$(git -C "subprojects/$crate" rev-parse HEAD) + echo "$commit $crate" >>commits.txt + cp -v "subprojects/$crate".toml "subprojects/$crate/alire.toml" + alr --force --non-interactive pin "$crate" "--use=$PWD/subprojects/$crate" + done + + alr exec alr -- action -r post-fetch # Configure XmlAda, etc +} + +# Build langkit shared libraries required to generate libadalang. +# Export setenv to $SETENV +# Clean `.ali` and `.o` to avoid static vis relocatable mess +function build_so_raw() { + cd subprojects/langkit_support + echo "GPR_PROJECT_PATH=$GPR_PROJECT_PATH" + sed -i.bak -e 's/GPR_BUILD/GPR_LIBRARY_TYPE/' ./langkit/libmanage.py + pip install . + python manage.py make --no-mypy --generate-auto-dll-dirs \ + --library-types=relocatable --gargs "-cargs -fPIC" + python manage.py setenv >"$SETENV" + cd - + find . -name '*.o' -delete + find . -name '*.ali' -delete +} + +# Run build_so_raw in Alire environment +function build_so() { + LIBRARY_PATH=relocatable alr exec bash -- "$0" build_so_raw +} + +# Build ALS with alire +function build_als() { + ADALIB=$(alr exec gcc -- -print-libgcc-file-name) + + if [[ $NODE_ARCH_PLATFORM == "x64/win32" ]]; then + ADALIB=$(cygpath -u "$ADALIB") + # Fix setenv.sh to be bash script for MSYS2 by replacing + # 1) C:\ -> /C/ 2) '\' -> '/' and ';' -> ':' 3) ": export" -> "; export" + sed -i -e 's#\([A-Z]\):\\#/\1/#g' -e 'y#\\;#/:#' -e 's/: export /; export /' "$SETENV" + cat "$SETENV" + # libgcc_s_seh-1.dll is already in PATH + + elif [[ $NODE_ARCH_PLATFORM == "x64/linux" ]]; then + NEW_PATH=$(dirname "$(alr exec gcc -- -print-file-name=libgcc_s.so.1)") + else + NEW_PATH=$(dirname "$(alr exec gcc -- -print-file-name=libgcc_s.dylib.1)") + fi + + ADALIB=$(dirname "$ADALIB")/adalib + DEPS=$PWD/alire/cache/dependencies + NEW_PATH=$ADALIB:$NEW_PATH + + for ITEM in $DEPS/*/{iconv,gmp,schema,dom,sax,input_sources,unicode}; do + [ -d "$ITEM" ] && NEW_PATH=$ITEM/lib/relocatable:$NEW_PATH + done + + echo "NEW_PATH=$NEW_PATH" + export DYLD_LIBRARY_PATH=$NEW_PATH:$DYLD_LIBRARY_PATH + export PATH=$NEW_PATH":$PATH" + # Let's ignore make check exit code until it is stable + LIBRARY_TYPE=static STANDALONE=no alr exec make -- "VERSION=$TAG" check || true +} + +# Find the path to libgmp as linked in the given executable +function get_gmp_full_path() { + otool -l "$1" | grep '^\s*name.*libgmp.10.dylib' | awk '/ name /{print $2 }' +} + +function do_fix_rpath() { + # Remove all rpath entries + for R in $(otool -l "$1" | grep -A2 LC_RPATH | awk '/ path /{ print $2 }'); do + install_name_tool -delete_rpath "$R" "$1" + done + # Change reference to full path of libgmp into a reference to the rpath. + gmp_full_path=$(get_gmp_full_path "$1") + if [ -n "$gmp_full_path" ]; then + install_name_tool -change "$gmp_full_path" @rpath/libgmp.10.dylib "$1" + fi + # Add the executable directory to rpath so it can find shared libraries + # packaged alongside the executable. + install_name_tool -add_rpath @executable_path "$1" +} + +if [[ -z "$NODE_ARCH_PLATFORM" ]]; then + # Get architecture and platform information from node. + NODE_PLATFORM=$(node -e "console.log(process.platform)") + NODE_ARCH=$(node -e "console.log(process.arch)") + NODE_ARCH_PLATFORM=$NODE_ARCH/$NODE_PLATFORM +fi + +ALS_EXEC_DIR=integration/vscode/ada/$NODE_ARCH_PLATFORM + +function fix_rpath() { + if [ "$RUNNER_OS" = macOS ]; then + # Get full path of libgmp as linked in the ALS exec + gmp_full_path=$(get_gmp_full_path "$ALS_EXEC_DIR/ada_language_server") + if [ -f "$gmp_full_path" ]; then + # Copy libgmp alongside the ALS exec + cp -v -f "$gmp_full_path" "$ALS_EXEC_DIR" + fi + # Fix rpath entries of the ALS exec so it can find libgmp alongside it + do_fix_rpath "$ALS_EXEC_DIR/ada_language_server" + fi +} + +function strip_debug() { + cd "$ALS_EXEC_DIR" + + if [ "$RUNNER_OS" = Windows ]; then + ALS=ada_language_server.exe + else + ALS=ada_language_server + fi + + if [ "$RUNNER_OS" = macOS ]; then + # On macOS using objcopy from binutils to strip debug symbols to a + # separate file doesn't work. Namely, the last step `objcopy + # --add-gnu-debuglink` yields an executable that crashes at startup. + # + # Instead we use dsymutil and strip which are commands provided by the + # system (or by XCode). + dsymutil "$ALS" + strip "$ALS" + else + objcopy --only-keep-debug ${ALS} ${ALS}.debug + objcopy --strip-all ${ALS} + objcopy --add-gnu-debuglink=${ALS}.debug ${ALS} + fi + cd - +} + +case $STEP in +all) + install_index + pin_crates + build_so + build_als + fix_rpath + strip_debug + ;; + +install_index) + install_index + ;; + +pin_crates) + pin_crates + ;; + +build_so) + build_so + ;; + +build_so_raw) + build_so_raw + ;; + +build_als) + build_als + ;; + +fix_rpath) + fix_rpath + ;; + +strip_debug) + strip_debug + ;; +esac diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 5dce426cd..730166940 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -1,2 +1,15 @@ libadalang-tools VSS +adasat +gnatcoll +gnatdoc +lal_refactor +langkit_support +libadalang +libadalang_tools +libgpr +libgpr2 +markdown +prettier_ada +spawn +vss diff --git a/subprojects/adasat.toml b/subprojects/adasat.toml new file mode 100644 index 000000000..8dfd4b527 --- /dev/null +++ b/subprojects/adasat.toml @@ -0,0 +1,30 @@ +name = "adasat" +description = "Implementation of a DPLL-based SAT solver in Ada." +long-description = """ +Main features: + + - [X] Conflict analysis and backjumping + - [X] Two-watched literals scheme + - [X] Built-in support for At-Most-One constraints + - [X] Custom theories +""" +version = "24.0.0" +website = "https://github.com/AdaCore/adasat" +authors = ["AdaCore"] +licenses = "Apache-2.0 WITH LLVM-exception" +maintainers = ["chouteau@adacore.com"] +maintainers-logins = ["chouteau", "roldak"] +tags = ["sat", "solver", "theories"] + +[configuration] +disabled = true + +[[actions]] +type = "post-fetch" +command = [ + "sed", + "-i.bak", + 's/, "-flto"//', + "adasat.gpr" +] + diff --git a/subprojects/gnatcoll.toml b/subprojects/gnatcoll.toml new file mode 100644 index 000000000..33119b6cd --- /dev/null +++ b/subprojects/gnatcoll.toml @@ -0,0 +1,48 @@ +name = "gnatcoll" +version = "24.0.0" +description = "GNAT Components Collection - Core packages" +website = "https://github.com/adacore/gnatcoll-core" +authors = ["AdaCore"] +licenses = "GPL-3.0-or-later WITH GCC-exception-3.1" +maintainers = ["chouteau@adacore.com"] +maintainers-logins = ["Fabien-Chouteau"] +project-files = ["gnatcoll.gpr"] +tags = ["gnatcoll", "json", "email", "refcount", "projects", "gpr", "vfs"] + +[configuration] +disabled = true + +[environment.'case(os)'.windows.GPR_PROJECT_PATH] +prepend = "${CRATE_ROOT}/core;${CRATE_ROOT}/projects;${CRATE_ROOT}/minimal" + +[environment.'case(os)'.linux.GPR_PROJECT_PATH] +prepend = "${CRATE_ROOT}/core:${CRATE_ROOT}/projects:${CRATE_ROOT}/minimal" + +[environment.'case(os)'.macos.GPR_PROJECT_PATH] +prepend = "${CRATE_ROOT}/core:${CRATE_ROOT}/projects:${CRATE_ROOT}/minimal" + +[environment.'case(os)'.macos.DYLD_LIBRARY_PATH] +append = "${CRATE_ROOT}/projects/lib/gnatcoll_projects/relocatable:${CRATE_ROOT}/core/lib/gnatcoll_core/relocatable:${CRATE_ROOT}/minimal/lib/gnatcoll_core/relocatable" + +[environment.'case(os)'.windows.PATH] +append = "${CRATE_ROOT}/projects/lib/gnatcoll_projects/relocatable;${CRATE_ROOT}/core/lib/gnatcoll_core/relocatable;${CRATE_ROOT}/minimal/lib/gnatcoll_core/relocatable" + +[gpr-externals] +GNATCOLL_ATOMICS = ["intrinsic", "mutex"] +GNATCOLL_BUILD_MODE = ["DEBUG", "PROD"] +GNATCOLL_OS = ["windows", "unix", "osx"] +LIBRARY_TYPE = ["static", "relocatable", "static-pic"] + +[gpr-set-externals."case(os)".linux] +GNATCOLL_OS = "unix" +[gpr-set-externals."case(os)".macos] +GNATCOLL_OS = "osx" +[gpr-set-externals."case(os)".windows] +GNATCOLL_OS = "windows" + +[gpr-set-externals] +GNATCOLL_VERSION = "24.0.0" +GNATCOLL_BUILD_MODE = "PROD" + +[[depends-on]] +libgpr = "~24.0.0" diff --git a/subprojects/gnatdoc.toml b/subprojects/gnatdoc.toml new file mode 100644 index 000000000..84c8331c7 --- /dev/null +++ b/subprojects/gnatdoc.toml @@ -0,0 +1,31 @@ +name = "gnatdoc" +description = "GNAT Documentation Generation Tool" +version = "24.0.0" +tags = ["documentation", "tools"] + +authors = ["AdaCore"] +maintainers = ["Vadim Godunko ", "Maxim Reznik "] +maintainers-logins = ["godunko", "reznikmm"] +licenses = "GPL-3.0-or-later WITH GCC-exception-3.1" +website = "https://github.com/AdaCore/gnatdoc" + +project-files = ["gnat/libgnatdoc.gpr"] + +[[actions]] +type = "post-fetch" +command = [ + "sed", + "-i.bak", + "-e", + 's/gnatwa/gnatwa", "-Ofast/', + "gnat/libgnatdoc.gpr" +] + +[configuration] +disabled = true + +[[depends-on]] +vss = "^24" +libgpr2 = "^24" +libadalang = "^24" +markdown = "^24" diff --git a/subprojects/lal_refactor.toml b/subprojects/lal_refactor.toml new file mode 100644 index 000000000..bd5f090df --- /dev/null +++ b/subprojects/lal_refactor.toml @@ -0,0 +1,14 @@ +name = "lal_refactor" +description = "Source code refactoring tools for the Ada" +version = "25.0.0-20240625" + +authors = ["AdaCore"] +maintainers = ["Maxim Reznik "] +maintainers-logins = ["reznikmm"] +licenses = "Apache-2.0" +website = "https://github.com/AdaCore/lal-refactor" +tags = ["static-analysis"] +project-files = ["gnat/lal_refactor.gpr"] + +[[depends-on]] +libadalang_tools = "*" diff --git a/subprojects/langkit_support.toml b/subprojects/langkit_support.toml new file mode 100644 index 000000000..67a7e099e --- /dev/null +++ b/subprojects/langkit_support.toml @@ -0,0 +1,18 @@ +name = "langkit_support" +description = "Runtime support library for Langkit-generated libraries" +version = "24.0.0" + +authors = ["AdaCore"] +maintainers = ["Pierre-Marie de Rodat ", "chouteau@adacore.com"] +maintainers-logins = ["pmderodat", "Fabien-Chouteau"] +licenses = "Apache-2.0 WITH LLVM-exception" +website = "https://github.com/AdaCore/langkit" + +[environment] +GPR_PROJECT_PATH.prepend = "${CRATE_ROOT}/langkit/support" + +[[depends-on]] +gnatcoll = "^24" +gnatcoll_iconv = "^24" +gnatcoll_gmp = "^24" +adasat = "^24" diff --git a/subprojects/libadalang.toml b/subprojects/libadalang.toml new file mode 100644 index 000000000..f93fe0548 --- /dev/null +++ b/subprojects/libadalang.toml @@ -0,0 +1,24 @@ +name = "libadalang" +description = "Ada semantic analysis library" +version = "24.0.0" + +authors = ["AdaCore"] +maintainers = ["Pierre-Marie de Rodat ", "chouteau@adacore.com"] +maintainers-logins = ["pmderodat", "Fabien-Chouteau"] +licenses = "Apache-2.0 WITH LLVM-exception" +website = "https://github.com/AdaCore/libadalang" +tags = ["libadalang", "static-analysis"] + +[environment] +GPR_PROJECT_PATH.prepend = "${CRATE_ROOT}/build" + +[[actions]] +type = "pre-build" +command = ["bash", "-c", "-x", "source setenv.sh; pip install -r REQUIREMENTS.dev; python manage.py generate"] + +[[depends-on]] +gnatcoll = "^24" +gnatcoll_gmp = "^24" +gnatcoll_iconv = "^24" +libgpr2 = "^24" +langkit_support = "^24" diff --git a/subprojects/libadalang_tools.toml b/subprojects/libadalang_tools.toml new file mode 100644 index 000000000..e760f289a --- /dev/null +++ b/subprojects/libadalang_tools.toml @@ -0,0 +1,17 @@ +name = "libadalang_tools" +description = "Ada semantic analysis library extension and tools" +version = "24.0.0" + +authors = ["AdaCore"] +maintainers = ["Pierre-Marie de Rodat ", "Max Reznik "] +maintainers-logins = ["pmderodat", "reznikmm"] +licenses = "GPL-3.0-or-later WITH GCC-exception-3.1" +website = "https://github.com/AdaCore/libadalang-tools" +tags = ["libadalang", "static-analysis", "metric", "formatting", "generator", "gnatmetric", "gnatpp", "gnatstub", "gnattest"] +project-files = ["src/lal_tools.gpr", "src/build.gpr"] +executables = ["gnatmetric", "gnatpp", "gnatstub", "gnattest"] + +[[depends-on]] +libadalang = "^24.0.0" +templates_parser = "^24.0.0" +vss = "^24.0.0" diff --git a/subprojects/libgpr.toml b/subprojects/libgpr.toml new file mode 100644 index 000000000..b5858205c --- /dev/null +++ b/subprojects/libgpr.toml @@ -0,0 +1,34 @@ +name = "libgpr" +version = "24.0.0" +description = "GNAT Project File Library" +authors = ["AdaCore"] +licenses = "GPL-3.0-or-later WITH GCC-exception-3.1" +maintainers = ["chouteau@adacore.com"] +maintainers-logins = ["Fabien-Chouteau"] +project-files = ["gpr/gpr.gpr"] + +[configuration] +disabled = true + +[gpr-externals] +GPR_BUILD = ["debug", "production", "coverage", "profiling"] +LIBRARY_TYPE = ["static", "relocatable", "static-pic"] + +[environment.'case(os)'.macos.DYLD_LIBRARY_PATH] +append = "${CRATE_ROOT}/gpr/lib/production/relocatable" + +[environment.'case(os)'.windows.PATH] +append = "${CRATE_ROOT}/gpr/lib/production/relocatable" + +[[actions]] +type = "post-fetch" +command = [ + "sed", + "-i.bak", + '/type/s/UNIX/unix", "osx/;/when/s/UNIX/unix" | "osx/;s/UNIX/unix/', + "gpr/gpr.gpr" +] + +[[depends-on]] +gnat = "/=2020" # Does not build with GNAT Community 2020 +xmlada = "~24.0.0" diff --git a/subprojects/libgpr2.toml b/subprojects/libgpr2.toml new file mode 100644 index 000000000..98886fea3 --- /dev/null +++ b/subprojects/libgpr2.toml @@ -0,0 +1,35 @@ +name = "libgpr2" +version = "24.0.0" +description = "Parser for GPR Project File" +authors = ["AdaCore"] +licenses = "Apache-2.0 WITH LLVM-exception" +maintainers = ["chouteau@adacore.com"] +maintainers-logins = ["Fabien-Chouteau"] +project-files = ["gpr2.gpr"] + +[configuration] +disabled = true + +[gpr-externals] +GPR2_BUILD = ["debug", "release", "release_checks", "gnatcov"] +LIBRARY_TYPE = ["static", "relocatable", "static-pic"] + +[gpr-set-externals] +GPR2_BUILD = "release" + +[[actions]] +type = "post-fetch" +command = ["bash", "-c", "-x", "[ -d gprconfig_kb ] || git clone https://github.com/AdaCore/gprconfig_kb.git"] + +[[actions]] +type = "post-fetch" +command = ["sed", "-i.bak", "-E", "-e", "s/\\b(X?)BUILD\\b/\\1GPR2_BUILD/g", "Makefile", "gpr2.gpr", "bindings/c/gpr2-c.gpr"] + +[[actions]] +type = "pre-build" +command = ["bash", "-c", "-x", "make setup build-lib-${LIBRARY_TYPE:-static} GPR2KBDIR=./gprconfig_kb/db"] + +[[depends-on]] +gnatcoll = "~24.0.0" +gnatcoll_iconv = "~24.0.0" +gnatcoll_gmp = "~24.0.0" diff --git a/subprojects/markdown.toml b/subprojects/markdown.toml new file mode 100644 index 000000000..dd503336b --- /dev/null +++ b/subprojects/markdown.toml @@ -0,0 +1,29 @@ +name = "markdown" +description = "Markdown parser (draft)" +long-description = "The markdown parser is an early stage of development. Just a few element is implemented and API will change in the future." +version = "24.0.0" +tags = ["markdown", "gfm", "commonmark"] + +authors = ["AdaCore"] +maintainers = ["Max Reznik "] +maintainers-logins = ["reznikmm"] +licenses = "Apache-2.0" + +project-files = ["gnat/markdown.gpr"] + +[[actions]] +type = "post-fetch" +command = [ + "sed", + "-i.bak", + "-e", + '/-g/s/-g"/-g", "-Ofast"/', + "gnat/markdown.gpr" +] + +[configuration] +disabled = true + +[[depends-on]] +vss = "~24.0.0" + diff --git a/subprojects/prettier_ada.toml b/subprojects/prettier_ada.toml new file mode 100644 index 000000000..9109982ea --- /dev/null +++ b/subprojects/prettier_ada.toml @@ -0,0 +1,20 @@ +name = "prettier_ada" +description = "A library to create formatters for any language." +version = "25.0.0-20240625" + +authors = ["AdaCore"] +maintainers = ["João Azevedo "] +maintainers-logins = ["joaopsazevedo"] +licenses = "Apache-2.0" +website = "https://github.com/AdaCore/prettier-ada" +tags = ["format", "prettier"] + +[environment.'case(os)'.macos.DYLD_LIBRARY_PATH] +append = "${CRATE_ROOT}/lib/relocatable/prod" + +[environment.'case(os)'.windows.PATH] +append = "${CRATE_ROOT}/lib/relocatable/prod" + +[[depends-on]] +gnatcoll = "*" +vss = "*" diff --git a/subprojects/spawn.toml b/subprojects/spawn.toml new file mode 100644 index 000000000..740c44d2e --- /dev/null +++ b/subprojects/spawn.toml @@ -0,0 +1,22 @@ +name = "spawn" +description = "A simple library to spawn processes and communicate with them." +long-description = "This is Glib indepentent implementation of a spawn processes interface." +version = "24.0.0" +website = "https://github.com/AdaCore/spawn" +authors = ["AdaCore"] +licenses = "Apache-2.0 WITH LLVM-exception" +maintainers = ["Vadim Godunko ", "Max Reznik "] +maintainers-logins = ["godunko", "reznikmm"] +project-files = ["gnat/spawn.gpr"] +tags = ["process", "launch", "pipe"] + +[configuration] +disabled = true + +[gpr-externals] +OS = ["unix", "osx", "Windows_NT"] + +[gpr-set-externals.'case(os)'] +linux = { OS = "unix" } # Compact table syntax is convenient in this case +windows = { OS = "Windows_NT" } # to see all enumeration values, one per row. +macos = { OS = "osx" } diff --git a/subprojects/vss.toml b/subprojects/vss.toml new file mode 100644 index 000000000..f041d2bc3 --- /dev/null +++ b/subprojects/vss.toml @@ -0,0 +1,24 @@ +name = "vss" +description = "Advanced string and text manipulation with Unicode support" +version = "24.0.0" +tags = ["unicode", "json", "text", "xml", "template"] + +authors = ["AdaCore"] +maintainers = ["Vadim Godunko ", "Maxim Reznik "] +maintainers-logins = ["godunko", "reznikmm"] +licenses = "Apache-2.0 WITH LLVM-exception" +website = "https://github.com/AdaCore/VSS" + +project-files = ["gnat/vss_text.gpr", "gnat/vss_json.gpr", "gnat/vss_regexp.gpr", "gnat/vss_xml.gpr", "gnat/vss_xml_templates.gpr"] + +[environment.'case(os)'.macos.DYLD_LIBRARY_PATH] +append = "${CRATE_ROOT}/.libs/relocatable" + +[environment.'case(os)'.windows.PATH] +append = "${CRATE_ROOT}/.libs/relocatable" + +[[depends-on]] +gnat = ">=11 & <2000" # Uses Ada 2022 syntax + +[configuration] +disabled = true