Bug 182909 - Ports should sanitize the environment
Summary: Ports should sanitize the environment
Status: Closed DUPLICATE of bug 144533
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-11 19:20 UTC by Julio Merino
Modified: 2015-06-14 03:09 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julio Merino 2013-10-11 19:20:00 UTC
	Yesterday, while building a port that I knew worked, it mysteriously
	failed due to a symbol being missing in a dependent library.
	
	The reason was that I had PKG_CONFIG_PATH set in the environment
	pointing to my home directory, and the build of the package from ports
	picked a different version of the dependency than the one in ports.

	I think ports should sanitize the environment to prevent the build of
	a package from picking dependencies that are not in ${PREFIX} nor in
	the base system.
	
	At the very least, this means clearing PKG_CONFIG_PATH.  I'd imagine
	that removing unexpected -I and -L flags from C*FLAGS and LDFLAGS
	would also be beneficial, but this seems trickier to achieve.

Fix: 

Possibly setting PKG_CONFIG_PATH= in the right place of bsd.port.mk
	is sufficient.  I'm not sure about what exactly that place is though.
How-To-Repeat: 	1) Install lutok 0.3 in ~/local.
	2) Set PKG_CONFIG_PATH=${HOME}/local in your environment.
	3) Attempt to build devel/kyua (version 0.6) and see it fail.
Comment 1 Alex Kozlov freebsd_committer freebsd_triage 2013-10-14 12:57:30 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Over to maintainer.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2014-06-02 01:59:38 UTC
Infrastructure PR.
Comment 3 Mathieu Arnold freebsd_committer freebsd_triage 2015-06-14 03:09:22 UTC

*** This bug has been marked as a duplicate of bug 144533 ***