AdaCore / AdaCore/gnatstudio

LD_LIBRARY_PATH in child processes (gprbuild & run program)

Open
#37 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.