Skip to content

#15, gpr2.gpr: Missing units in the relocatable Library_Interface attribute definition#16

Open
dsauvage wants to merge 1 commit intoAdaCore:mainfrom
AdaLabs:main-issue-15
Open

#15, gpr2.gpr: Missing units in the relocatable Library_Interface attribute definition#16
dsauvage wants to merge 1 commit intoAdaCore:mainfrom
AdaLabs:main-issue-15

Conversation

@dsauvage
Copy link

@dsauvage dsauvage commented Feb 3, 2026

The missing units below have been added to the relocatable Library_Interface attribute definition

GPR2.Build.Jobserver_Protocol.Pipe
GPR_Parser.Private_Converters
GPR2.Build.View_Tables.Update_Sources_List
GPR2.Tree_Internal.Load_Autoconf

Above fix is for instance required to successfully build libadalang (26.0.0), which depends on gpr2 (26.0..0)

@CLAassistant
Copy link

CLAassistant commented Feb 3, 2026

CLA assistant check
All committers have signed the CLA.

@Jicquel
Copy link
Collaborator

Jicquel commented Feb 3, 2026

Hi, I did not manage to reproduce the libadalang build issue. Could you please provide a reproducer?

@dsauvage
Copy link
Author

dsauvage commented Feb 3, 2026

Apologize i can not send you an automated reproducer
I can reproduce using the steps below;

  1. using the gnat_native 15.2.1 compiler from alire
  2. build gpr2 using its alire crate (libgpr2_26.0.0_99e9d2cd) both in static and relocatable mode
  3. install it
  4. build libadalang using its alire crate (libadalang_26.0.0_75276b8d) both in static and relocatable mode
    the first errors pop up during the call to gprclean before the build, but more errors to follow during the build on other units once you fix them
cd FOLDER/alire/crates/libadalang_26.0.0_75276b8d
gprclean -p -P libadalang.gpr -XLIBRARY_TYPE=static -XBUILD_MODE=prod
gprclean -p -P libadalang.gpr -XLIBRARY_TYPE=relocatable  -XGNATCOLL_ICONV_BUILD=relocatable -XLANGKIT_SUPPORT_BUILD=relocatable -XGNATCOLL_GMP_BUILD=relocatable -XBUILD_MODE=prod
gpr2.gpr:25:1111: "gpr2.build.view_tables.update_sources_list" is not a unit of this project
gpr2.gpr:25:2862: "gpr2.tree_internal.load_autoconf" is not a unit of this project
gprclean: "libadalang.gpr" processing failed

@Jicquel
Copy link
Collaborator

Jicquel commented Feb 5, 2026

Thank you for the reproducer!

First, I tried building libadalang with alire in relocatable mode, using the same versions, and alr build worked correctly from the libadalang crate.

If I understand correctly, you are not using the alr build / alr install commands, but invoking the GPR tools directly instead—correct?

Could you please elaborate a bit on the commands you ran? I tried using the GPR tools directly as in your comment, but I wasn’t able to reproduce the issue.

@dsauvage
Copy link
Author

dsauvage commented Feb 20, 2026

Hi,
I have been able to create a systematic reproducer, it install libgpr2 from alire crate, then get libadalang crate, and make sure libadalang crate uses the libgpr2 installed component.

#
# 1. Init the build env
#

export DEV_PATH=/home/user/dev/reproducers
mkdir -p $DEV_PATH/settings
export ALIRE_SETTINGS_DIR=$DEV_PATH/settings
mkdir $DEV_PATH/crates
cd $DEV_PATH/crates

alr toolchain --select
# select gnat_native and gprbuild, both at index 1

#
# 2. get libgpr2 and install it
#

alr get libgpr2
alr build

alr exec -- make prefix=/tmp/gnat/ ENABLE_SHARED=yes GPR2_BUILD=release setup
alr exec -- make
alr exec -- make install


#
# 2. get libadalang and pin the installed libgpr2 component as its dependency
#

alr get libadalang
cd libadalang_26.0.0_75276b8d/

alr pin libgpr2 --use /tmp/gnat/share/gpr/

#
# 3. run gprclean in relocatable mode, that is a simple way to reproduce the issue 
#

alr exec --  gprclean -p -P libadalang.gpr -XLIBRARY_TYPE=relocatable  -XGNATCOLL_ICONV_BUILD=relocatable -XLANGKIT_SUPPORT_BUILD=relocatable -XGNATCOLL_GMP_BUILD=relocatable -XBUILD_MODE=prod

The gprclean call returns the errors below, which are fixed by our pull request:

gpr2.gpr:23:1111: "gpr2.build.view_tables.update_sources_list" is not a unit of this project
gpr2.gpr:23:2862: "gpr2.tree_internal.load_autoconf" is not a unit of this project
gprclean: "libadalang.gpr" processing failed
error: Command ["gprclean", "-p", "-P", "libadalang.gpr", "-XLIBRARY_TYPE=relocatable", "-XGNATCOLL_ICONV_BUILD=relocatable", "-XLANGKIT_SUPPORT_BUILD=relocatable", "-XGNATCOLL_GMP_BUILD=relocatable", "-XBUILD_MODE=prod"] exited with code 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments