LD_LIBRARY_PATH in child processes (gprbuild & run program)
Nobody has claimed this yet.
- Dominant language
- Ada
- Stars
- 531
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I'm trying to use GPS (launched with ~/opt/GNAT/2018/bin/gps without modifying $PATH) that is installed as part of GNAT community 2018 with system GNAT-6.4.0. This does not work as GPS is running both the program being developed and gprbuild in an environment populated with pointers to the community 2018 install. Replacing system gprbuild with unset LD_LIBRARY_PATH; gprbuild.real "$@" makes the program build, but it still fails to run when linking with system libraries, e.g. GNATCOLL:
symbol lookup error: /usr/lib/gnatcoll/gnatcoll.relocatable/libgnatcoll.so.2017: undefined symbol: gpr__sinput__source_file__last_val
@pmderodat suggested me to run gps as follows: LD_LIBRARY_PATH=doesnotexist ~/opt/GNAT/2018/bin/gps which makes GPS forward LD_LIBRARY_PATH as-is and the program successfully builds and runs. By default LD_LIBRARY_PATH is unset in all shells.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with GPS launched from ~/opt/GNAT/2018/bin/gps, then compare child-process environments for gprbuild and the program with LD_LIBRARY_PATH unset versus set to doesnotexist. Trace how GPS launches gprbuild and the program; done means both build and run successfully with the system GNAT and GNATCOLL libraries without requiring the workaround.
Written by the indexing model from the issue text.
Assessment
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100