alire
alire copied to clipboard
Several extractions of same pins results in problems
Checklist
- [x] I've included the output of
alr version
. - [x] I've included complete steps to reproduce my issue.
Describe the bug
Have a project with at least two crates: a child one that depends on a root one (example of such project: https://github.com/stcarrez/gollum). On the root Alire crate, use a pins
of some repository. In that configuration:
The root crate is defined with:
[[depends-on]]
utilada = "^2.6.0"
[[pins]]
utilada = { url="https://github.com/stcarrez/ada-util.git" }
and the child crate is defined with:
[[depends-on]]
gollum = "*"
[[pins]]
gollum = { path='..' }
- the root project extracts the pinned project in
alire/cache/pins/utilada
- the child project extract the pinned project in
smeagol/alire/cache/pins/utilada
Due to this double extraction, files from the root project are sometimes re-compiled because the GPR_PROJECT_PATH
changes between when we build the two GNAT projects, even if share the build object files between the two projects. For large project, this means long and annoying multiple compilations (a bigger project where I'm having the issue is https://gitlab.com/stcarrez/spdx-tool where there are 2 crates that depend on a root one).
In root project, we get:
export GPR_PROJECT_PATH="/src/vacs/gollum:/src/vacs/gollum/alire/cache/pins/utilada:/src/vacs/gollum/alire/cache/pins/utilada/.alire"
export UTILADA_ALIRE_PREFIX="/src/vacs/gollum/alire/cache/pins/utilada"
and in the child project we get:
export GPR_PROJECT_PATH="/src/vacs/gollum:/src/vacs/gollum/smeagol:/src/vacs/gollum/smeagol/alire/cache/pins/utilada:/src/vacs/gollum/smeagol/alire/cache/pins/utilada/.alire"
export UTILADA_ALIRE_PREFIX="/src/vacs/gollum/smeagol/alire/cache/pins/utilada"
To Reproduce Steps to reproduce the behavior:
- git clone https://github.com/stcarrez/gollum
- cd gollum
- alr build
- cd smeagol
- alr build
Expected Behavior We should only have one extraction of the pinned projects and the child crate should use the parent's crate pinned dependencies
alr
version
APPLICATION
alr version: 2.1.0-dev
libalire version: 2.1.0-dev
compilation date: 2024-03-17 09:42:40
compiled with version: 12.1.0