From 20746539db95356b2bfb898bdde4fa6b8cb033ea Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Fri, 9 Aug 2024 09:15:55 +0000 Subject: [PATCH 1/2] Add gnatformat as a dependency Refs #1387 --- alire.toml | 1 + .../gnatformat-25.0.0-20240625.toml | 29 +++++++++++++++++++ scripts/build_als.sh | 4 ++- subprojects/gnatformat.toml | 24 +++++++++++++++ 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 index/gn/gnatformat/gnatformat-25.0.0-20240625.toml create mode 100644 subprojects/gnatformat.toml diff --git a/alire.toml b/alire.toml index 359aa4e11..fd1aaee8e 100644 --- a/alire.toml +++ b/alire.toml @@ -26,6 +26,7 @@ libgpr2 = "^24.0.0" vss = "^24.0.0" libadalang_tools = "^24.0.0" lal_refactor = "25.0.0-20240625" +gnatformat = "25.0.0-20240625" gnatdoc = "^24.0.0" spawn = "^24.0.0" diff --git a/index/gn/gnatformat/gnatformat-25.0.0-20240625.toml b/index/gn/gnatformat/gnatformat-25.0.0-20240625.toml new file mode 100644 index 000000000..94ec2cd4b --- /dev/null +++ b/index/gn/gnatformat/gnatformat-25.0.0-20240625.toml @@ -0,0 +1,29 @@ +name = "gnatformat" +description = "An opinionated code formatter for the Ada language." +version = "25.0.0-20240625" + +authors = ["AdaCore"] +maintainers = ["João Azevedo "] +maintainers-logins = ["joaopsazevedo"] +licenses = "Apache-2.0 WITH LLVM-exception" +website = "https://github.com/AdaCore/gnatformat" + +project-files = ["gnat/gnatformat.gpr"] + +[environment.'case(os)'.macos.DYLD_LIBRARY_PATH] +append = "${CRATE_ROOT}/.libs/relocatable" + +[environment.'case(os)'.windows.PATH] +append = "${CRATE_ROOT}/.libs/relocatable" + +[configuration] +disabled = true + +[[depends-on]] +libadalang = "^24" +prettier_ada = "25.0.0-20240625" + +[origin] +url = "git+https://github.com/AdaCore/gnatformat" +commit = "b418fcc894877777ecf4102410ba4eeee279e219" + diff --git a/scripts/build_als.sh b/scripts/build_als.sh index 5eb306926..5f21f8f97 100755 --- a/scripts/build_als.sh +++ b/scripts/build_als.sh @@ -17,6 +17,7 @@ PINS=" adasat gnatcoll gnatdoc +gnatformat lal_refactor langkit_support libadalang @@ -45,6 +46,7 @@ repo_vss=VSS branch_gnatdoc=edge branch_lal_refactor=edge +branch_gnatformat=edge branch_libgpr2=next branch_prettier_ada=main @@ -53,7 +55,7 @@ SETENV=$PWD/subprojects/libadalang/setenv.sh # Set `prod` build mode ######################## -# for adasat,lal,langkit,lal_refactor,laltools,markdown,spawn +# for adasat,gnatformat,lal,langkit,lal_refactor,laltools,markdown,spawn export BUILD_MODE=prod # for others export GNATCOLL_BUILD_MODE=PROD diff --git a/subprojects/gnatformat.toml b/subprojects/gnatformat.toml new file mode 100644 index 000000000..469d2964d --- /dev/null +++ b/subprojects/gnatformat.toml @@ -0,0 +1,24 @@ +name = "gnatformat" +description = "An opinionated code formatter for the Ada language." +version = "25.0.0-20240625" + +authors = ["AdaCore"] +maintainers = ["João Azevedo "] +maintainers-logins = ["joaopsazevedo"] +licenses = "Apache-2.0 WITH LLVM-exception" +website = "https://github.com/AdaCore/gnatformat" + +project-files = ["gnat/gnatformat.gpr"] + +[environment.'case(os)'.macos.DYLD_LIBRARY_PATH] +append = "${CRATE_ROOT}/.libs/relocatable" + +[environment.'case(os)'.windows.PATH] +append = "${CRATE_ROOT}/.libs/relocatable" + +[configuration] +disabled = true + +[[depends-on]] +libadalang = "^24" +prettier_ada = "25.0.0-20240625" \ No newline at end of file From 64a6683cecc5c4c84cfab036104733e38e0490ec Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 12 Aug 2024 11:40:16 +0300 Subject: [PATCH 2/2] Drop `alire-project/setup-alire@v3` usage in GH Action and fetch Alire with curl to avoid dependency on `engineerd/configurator@v0.0.10`. Refs #1387 --- .github/workflows/build-binaries.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index b02442ff2..f81c2fdef 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -40,21 +40,24 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Get GNAT toolchain with alire (AArch64) - if: ${{ matrix.os == 'macos-14' }} + - name: Get GNAT toolchain with alire + shell: bash 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 + # Also it depends on `engineerd/configurator@v0.0.10` not approved by IT. + # https://github.com/alire-project/setup-alire/issues/75 + # So we fetch Alire with curl then toolchain with Alire. + if [[ "$RUNNER_ARCH" == ARM64 ]] ; then + ZIP=nightly/alr-nightly-bin-aarch64-macos.zip + else + ZIP=v2.0.1/alr-2.0.1-bin-x86_64-${RUNNER_OS}.zip + fi + curl -L -O https://github.com/alire-project/alire/releases/download/$ZIP + unzip $(basename $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^14 gprbuild - name: Build shell: bash run: |