Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 886981 - Emerge emits noisy messages with some package env files
Summary: Emerge emits noisy messages with some package env files
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-18 12:55 UTC by Jocelyn Mayer
Modified: 2022-12-18 14:10 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Mayer 2022-12-18 12:55:04 UTC
For more safety, I disable link with undefined symbols globally in LDFLAGS,
using '-Wl,--no-undefined -Wl,--no-allow-shlib-undefined'.
However, some packages have missing libraries on link command line; it usually is not an issue if loaded from a frontend, for example for most perl packages which miss the perl library reference.
I did a quick fix using a file in /etc/portage/env/ldflags_allow_undefined.conf:
# Allow undefined symbols, mostly for plugins
LDFLAGS="${LDFLAGS/-Wl,--no-undefined/}";
LDFLAGS="${LDFLAGS/-Wl,--no-allow-shlib-undefined/}";
LDFLAGS="${LDFLAGS} -Wl,--allow-shlib-undefined"

Of course the proper fix would be to fix each package individually.

This works, meaning I can merge package using this file. However, I get spurious messages during (I guess) pretend and setup phases for each package using this file:
"/etc/portage/env/ldflags_allow_undefined.conf", line 3: unexpected EOF while looking for matching `}'
"/etc/portage/env/ldflags_allow_undefined.conf", line 4: unexpected EOF while looking for matching `}'


Reproducible: Always

Steps to Reproduce:
1. Use a per package environment file using a bash shell variable in the way:
VAR="${VAR/xxx/yyy}"
2. Merge the package
Actual Results:  
I get the described spurious messages twice for each package using this file, once during pretend phase (before I get the merging package list) and during the setup phase, when actual merge starts.

Expected Results:  
No spurious messages...

This is not critical as the merge succeeds but it's quite annoying especially during the pretend phase when there's a lot of packages to be merged.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-18 12:58:43 UTC
Most Portage config files are parsed by Python's shlex module, not Bash, so we can't do much about this unfortunately.
Comment 2 Jocelyn Mayer 2022-12-18 13:12:09 UTC
OK, I will do with it until I fix each package individually, adding the proper libraries to the link command line...
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-12-18 14:03:19 UTC
I suppose you could use /etc/portage/bashrc to apply the changes you want but the package matching would need to be done manually there.
Comment 4 Jocelyn Mayer 2022-12-18 14:10:03 UTC
Thanks for the suggestion, I could use a specific file for the concerned package list...
But, as I said previously, what I did is a quick hack to make package build without fixing properly the actual issue(s).