Using GtkAda with alire

I installed GtkAda using alire and created a project/crate that uses it. This works so far but each time I issue ‘alr edit’ the post fetch actions are executed which involves a complete build of GtkAda.

If I run GNAT studio from the command line gtkada.gpr is not found.

I wonder if there is to keep alire from doing a compete build of GtkAda?

I’m using alire 1.2.1 as unfortunately my Linux system is too old for alire 2.0.

Update: I now figured out how to set GPR_PROJECT_PATH so that gnatstudio finds gtkada.gpr. But that doesn’t keep alr edit from rebuilding GtkAda.

Look for alr edit.It is probably a solution for your case.

Well, as I wrote, alr edit works, but before launching Gnat studio it performs a complete build of GtkAda (even if the build already happened before), which is somewhat annoying.

Oh, sorry, it’s clear I didn’t pay enough attention.

I tried to reproduce it myself with Alire 2.0, which is the version I’m using, and wasn’t able to do it, so it is either solved with these versions (gtkada or Alire), or something in your setup triggers it.

My steps were:

  alr init test_gtkada
  cd test_gtkada/
  alr with gtkada
  alr build
  alr edit

The selected gtkada version is “24.0.0”.

You could try using your alr 1.2.1 to build the alire v2.0.1 sources?

That worked. The problem disappeared with Alire 2.0.1. Thanks.

I just tried ti build Gtkada using “alire”.

Using the following commands to get it in the my standard directory C:\GNAT\gtkada.

Starting with C:\GNAT I used:

alr init --bin gtkada

cd gtkada

alr with gtkada

alr build

I now got the following error message:

ERROR: ******************* BEGIN Alire bug detected *******************
ERROR: Location : 0x7ff68b6fe441 Semantic_Versioning.Basic.Restrictions.First_Index at alire-builds-hashes.adb:87
ERROR: Extra info: Conflicting build hashes for release gtkada=0.1.0-dev
ERROR: Report at : Sign in to GitHub · GitHub
ERROR: Re-run with global switches -vv -d for a full log and stack trace.
ERROR: ******************** END Alire bug detected ********************

What did I wrong

Try `alr init` with another name than `gtkada`

For what reason? I just want a neat structure as GNAT directory with directories as gnatstudio, gprbuild and now also gtkada

There is already a package called gtkada, this may create a naming conflict between your code and the dependencies and index :slight_smile:

Best regards,
Fer

I have reported the problem

Warn about using existing crate name? · Issue #2109 · alire-project/alire · GitHub

I don’t have an existing I just have deleted all files and directories of thelast version(s) that delivered fault message. I never found another way of deleting (or disabling) possible old and faulty versions.

If I understood correctly, you want a Gtkada installation in a specific directory, to be used by simply “with-ing” it in your .gpr file. What I did was

Create a temporary download directory
cd into that dir; then do
alr get gtkada
cd into the dir created by alr (gtkada_<…>); do
alr build
alr install -–prefix=/dir/where/you/want/gtkada/installed

NOTE: in my experience alr install doesn’t install in the requested dir. (I think because in the alr build step ./configure isn’t called with —prefix and it is not possible to give the flag to alr build). After some fiddling and twiddling I was able to install in the preferred dir with gprinstall -Pgtkada —prefix=<…>
NOTE: following the steps as previously posted by @dmitry-kazakov does install in the preferred dir
NOTE: when installed in this way do NOT do “alr with gtkada”; just add the grkada installation to your gpr search path and simply add “with gtkada” to your gpr file

I then got :

PS C:\WINDOWS\system32> cd C:\Temp_gtkada
PS C:\Temp_gtkada> alr get gtkada
. Updating index... hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
remote: Enumerating objects: 129, done.
remote: Counting objects: 100% (40/40), done.
remote: Compressing objects: 100% (30/30), done.
Receiving objectsremote: Total 129 (delta 24), reused 15 (delta 9), pack-reused 89 (from 2)
Receiving objects: 100% (129/129), 53.43 KiB | 828.00 KiB/s, done.
Resolving deltas: 100% (52/52), completed with 3 local objects.
From https://github.com/alire-project/alire-index
   f02e58e..e5dade1  stable-1.4.0 -> origin/stable-1.4.0
Updating f02e58e..e5dade1
Fast-forward
 index/ai/aion/aion-1.0.0.toml                          |  27 ++++
 index/cz/czmq_ada/czmq_ada-0.5.0.toml                  |  19 +++
 .../em/embedded_nrf52832/embedded_nrf52832-15.4.0.toml |  59 +++++++++
 .../em/embedded_nrf52833/embedded_nrf52833-15.4.0.toml |  59 +++++++++
 .../em/embedded_nrf52840/embedded_nrf52840-15.4.0.toml |  59 +++++++++
 .../embedded_nrf54l_app-15.4.0.toml                    |  73 +++++++++++
 index/em/embedded_rp2040/embedded_rp2040-15.4.0.toml   |  92 ++++++++++++++
 index/em/embedded_rp2350/embedded_rp2350-15.4.0.toml   |  96 ++++++++++++++
 .../embedded_stm32f0xx/embedded_stm32f0xx-15.4.0.toml  | 115 +++++++++++++++++
 .../embedded_stm32g0xx/embedded_stm32g0xx-15.4.0.toml  | 145 ++++++++++++++++++++++
 .../embedded_stm32g4xx/embedded_stm32g4xx-15.4.0.toml  | 144 +++++++++++++++++++++
 index/gn/gnatdoc_bin/gnatdoc_bin-26.0.0.toml           |   6 +-
 index/gn/gnatformat_bin/gnatformat_bin-26.0.0.toml     |  45 +++++++
 index/gn/gnattest_bin/gnattest_bin-26.2.0.toml         |  48 +++++++
 index/gp/gprbuild/gprbuild-26.0.1.toml                 |  46 +++++++
 index/li/libzmq/libzmq-external.toml                   |   1 +
 index/li/light_nrf52832/light_nrf52832-15.4.0.toml     |  59 +++++++++
 index/li/light_nrf52833/light_nrf52833-15.4.0.toml     |  59 +++++++++
 index/li/light_nrf52840/light_nrf52840-15.4.0.toml     |  59 +++++++++
 index/li/light_nrf54l_app/light_nrf54l_app-15.4.0.toml |  72 +++++++++++
 index/li/light_rp2040/light_rp2040-15.4.0.toml         |  91 ++++++++++++++
 index/li/light_rp2350/light_rp2350-15.4.0.toml         |  95 ++++++++++++++
 index/li/light_stm32f0xx/light_stm32f0xx-15.4.0.toml   | 114 +++++++++++++++++
 index/li/light_stm32g0xx/light_stm32g0xx-15.4.0.toml   | 144 +++++++++++++++++++++
 index/li/light_stm32g4xx/light_stm32g4xx-15.4.0.toml   | 143 +++++++++++++++++++++
 .../light_tasking_nrf52832-15.4.0.toml                 |  59 +++++++++
 .../light_tasking_nrf52833-15.4.0.toml                 |  59 +++++++++
 .../light_tasking_nrf52840-15.4.0.toml                 |  59 +++++++++
 .../light_tasking_nrf54l_app-15.4.0.toml               |  73 +++++++++++
 .../light_tasking_rp2040-15.4.0.toml                   |  92 ++++++++++++++
 .../light_tasking_rp2350-15.4.0.toml                   |  96 ++++++++++++++
 .../light_tasking_stm32f0xx-15.4.0.toml                | 115 +++++++++++++++++
 .../light_tasking_stm32g0xx-15.4.0.toml                | 145 ++++++++++++++++++++++
 .../light_tasking_stm32g4xx-15.4.0.toml                | 144 +++++++++++++++++++++
 index/ra/raylib/raylib-2.0.0.toml                      |  67 ++++++++++
 index/te/termicap/termicap-1.0.0.toml                  |  81 ++++++++++++
 index/zb/zbinfo/zbinfo-1.4.0.toml                      |   5 +-
 index/zb/zbinfo/zbinfo-1.4.1.toml                      |  23 ++++
 index/zb/zblib/zblib-1.5.0.toml                        |  20 +++
 index/zb/zbmcompile/zbmcompile-1.4.0.toml              |   5 +-
 index/zb/zbmcompile/zbmcompile-1.4.1.toml              |  23 ++++
 41 files changed, 2931 insertions(+), 5 deletions(-)
 create mode 100644 index/ai/aion/aion-1.0.0.toml
 create mode 100644 index/cz/czmq_ada/czmq_ada-0.5.0.toml
 create mode 100644 index/em/embedded_nrf52832/embedded_nrf52832-15.4.0.toml
 create mode 100644 index/em/embedded_nrf52833/embedded_nrf52833-15.4.0.toml
 create mode 100644 index/em/embedded_nrf52840/embedded_nrf52840-15.4.0.toml
 create mode 100644 index/em/embedded_nrf54l_app/embedded_nrf54l_app-15.4.0.toml
 create mode 100644 index/em/embedded_rp2040/embedded_rp2040-15.4.0.toml
 create mode 100644 index/em/embedded_rp2350/embedded_rp2350-15.4.0.toml
 create mode 100644 index/em/embedded_stm32f0xx/embedded_stm32f0xx-15.4.0.toml
 create mode 100644 index/em/embedded_stm32g0xx/embedded_stm32g0xx-15.4.0.toml
 create mode 100644 index/em/embedded_stm32g4xx/embedded_stm32g4xx-15.4.0.toml
 create mode 100644 index/gn/gnatformat_bin/gnatformat_bin-26.0.0.toml
 create mode 100644 index/gn/gnattest_bin/gnattest_bin-26.2.0.toml
 create mode 100644 index/gp/gprbuild/gprbuild-26.0.1.toml
 create mode 100644 index/li/light_nrf52832/light_nrf52832-15.4.0.toml
 create mode 100644 index/li/light_nrf52833/light_nrf52833-15.4.0.toml
 create mode 100644 index/li/light_nrf52840/light_nrf52840-15.4.0.toml
 create mode 100644 index/li/light_nrf54l_app/light_nrf54l_app-15.4.0.toml
 create mode 100644 index/li/light_rp2040/light_rp2040-15.4.0.toml
 create mode 100644 index/li/light_rp2350/light_rp2350-15.4.0.toml
 create mode 100644 index/li/light_stm32f0xx/light_stm32f0xx-15.4.0.toml
 create mode 100644 index/li/light_stm32g0xx/light_stm32g0xx-15.4.0.toml
 create mode 100644 index/li/light_stm32g4xx/light_stm32g4xx-15.4.0.toml
 create mode 100644 index/li/light_tasking_nrf52832/light_tasking_nrf52832-15.4.0.toml
 create mode 100644 index/li/light_tasking_nrf52833/light_tasking_nrf52833-15.4.0.toml
 create mode 100644 index/li/light_tasking_nrf52840/light_tasking_nrf52840-15.4.0.toml
 create mode 100644 index/li/light_tasking_nrf54l_app/light_tasking_nrf54l_app-15.4.0.toml
 create mode 100644 index/li/light_tasking_rp2040/light_tasking_rp2040-15.4.0.toml
 create mode 100644 index/li/light_tasking_rp2350/light_tasking_rp2350-15.4.0.toml
 create mode 100644 index/li/light_tasking_stm32f0xx/light_tasking_stm32f0xx-15.4.0.toml
 create mode 100644 index/li/light_tasking_stm32g0xx/light_tasking_stm32g0xx-15.4.0.toml
 create mode 100644 index/li/light_tasking_stm32g4xx/light_tasking_stm32g4xx-15.4.0.toml
 create mode 100644 index/ra/raylib/raylib-2.0.0.toml
 create mode 100644 index/te/termicap/termicap-1.0.0.toml
 create mode 100644 index/zb/zbinfo/zbinfo-1.4.1.toml
 create mode 100644 index/zb/zblib/zblib-1.5.0.toml
 create mode 100644 index/zb/zbmcompile/zbmcompile-1.4.1.toml
/c/git-sdk-64/usr/lib/git-core/git-sh-setup: line 46: /usr/lib/git-core/git-sh-i18n: No such file or directory
Warning: Index auto-refresh failed, will try again in 24h
Warning: Error information: Command ["git", "pull", "--recurse-submodules"] exited with code 1
Note: Deploying gtkada=26.0.0...
                                   -=O=-                              #    #  # #

gtkada=26.0.0 successfully retrieved.
Dependencies were solved as follows:

   +b libgtk3    3.24.52 (new,system package)
   +b make       4.4.1   (new,system package)
   +b pkg_config 2.5.1   (new,executable in path)
PS C:\Temp_gtkada> ls


    Directory: C:\Temp_gtkada


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         13-5-2026      8:38                gtkada_26.0.0_489d17d3

PS C:\Temp_gtkada> cd gtkada_26.0.0_489d17d3
PS C:\Temp_gtkada\gtkada_26.0.0_489d17d3> alr build
Note: Running post-fetch actions for gtkada=26.0.0...
configure: loading site script /usr/local/etc/config.site
checking build system type... x86_64-pc-msys
checking host system type... x86_64-pc-msys
checking target system type... x86_64-pc-msys
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/c/Temp_gtkada/gtkada_26.0.0_489d17d3':
configure: error: C compiler cannot create executables
See `config.log' for more details
Warning: Execution failed for action: Post_Fetch run: bash -c PATH=${DISTRIB_ROOT}/mingw64/bin:${PATH} ./configure (from ${CRATE_ROOT}/.)
Warning: Exit code: 77
Warning: Action output not captured, check it above.
ERROR: Compilation failed.
PS C:\Temp_gtkada\gtkada_26.0.0_489d17d3>

FWIW, when using alr get I never ever have seen messages about updates to a git repo. Could it be that you have a git repo in the root of C:\ ? I hope not …

Wrt the failing of the ./configure script (as executed by alr), Is gcc on your search path? Or is there an AntiVirus active that blocks gcc or gcc generated code. I have F-Secure as AV, and it frequently quarantines gcc generated code.

Or is the PowerShell that causes some problems? I don’t use PS, hate it, I think it is a monstrosity. When I need to use alr and that is rarely, I only use MSYS2 tty.