Skip to content

Filter RPATH relevant environment variables in snemo-shell #9

@drbenmorgan

Description

@drbenmorgan
  • ran a brew command and reproduced the problem with multiple formulae?
  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew config and brew doctor and included their output with your issue?
  • have a problem with brew install (or upgrade, reinstall) a single, supernemo-dbd-core formula?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

What you were trying to do (and why)

Use brew snemo-shell as a development environment for a package (Falaise) already installed through a Formula

What happened (include command output)

Command output
$ brew snemo-shell
snemo-shell> git clone https://github.com/SuperNEMO-DBD/Falaise.git
snemo-shell> mkdir build && cd build
snemo-shell> cmake ../Falaise.git
snemo-shell> make
...
snemo-shell> ldd BuildProducts/bin/flsimulate
snemo-shell> ldd BuildProducts/bin/flsimulate | grep Falaise
	libFalaise.so.3 => /opt/supernemo/lib/libFalaise.so.3 (0x00007ff5100a4000)
  

What you expected to happen

The link should be to the local version of the library, not the brewed version.

Step-by-step reproduction instructions (by running brew commands)

$ brew snemo-shell
snemo-shell> brew install falaise
snemo-shell> git clone https://github.com/SuperNEMO-DBD/Falaise.git
snemo-shell> mkdir build && cd build
snemo-shell> cmake ../Falaise.git
snemo-shell> make
...
snemo-shell> ldd BuildProducts/bin/flsimulate
snemo-shell> ldd BuildProducts/bin/flsimulate | grep Falaise
	libFalaise.so.3 => /opt/supernemo/lib/libFalaise.so.3 (0x00007ff5100a4000)

It's traced to a couple of issues. First, snemo-shell sets the following env vars which influence the rpath setting:

$ brew snemo-shell
snemo-shell> env | sort
...
LDFLAGS=-Wl,--dynamic-linker=/opt/supernemo/lib/ld.so -Wl,-rpath=/opt/supernemo/lib -L/opt/supernemo/lib
LD_RUN_PATH=/opt/supernemo/lib
LIBRARY_PATH=/opt/supernemo/lib
...

These should probably be unset for both runtime and development use cases, as already installed Formulae should have RPaths set correctly already. Unsetting those vars doesn't seem to affect the main applications.

There may also a separate issue with the GCC specs file generated by the gcc-7 formulae, but this will be reported separately after further tests.

Note that these issues only affect the case of developing a package that already exists in a brew install. Building anything not installed as a Formulae is fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions