Portage seems to reset SHELL for each ebuild phase to its default value, even if another value was exported in an earlier phase. While AFAICS PMS doesn't specify anything about SHELL, it requires PM to *preserve* all the exported variables in exported state. Reproducible: Always Steps to Reproduce: src_configure() { export SHELL=/bin/foo } src_compile() { declare -p SHELL } Actual Results: declare -- SHELL="/bin/bash" Expected Results: declare -x SHELL="/bin/foo" As a note, the major issue hit here was that the ebuild in question did: export SHELL=/bin/bash yet portage unexported the variable in next phases, making the build system fail.
Created attachment 346328 [details] example test-case The following ebuild can be used as a test case. As-is, everything will work properly since its using "BUBBA" as the variable. sed -i -e 's/BUBBA/SHELL/' test-1.ebuild , and try again ; then you will get failures unless you set USE="compile" to force the export within the src_compile() phase.
This is fixed in git: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=29a1ac5ae9b36722269e3a72326680656a918040
This is fixed in 2.1.11.63 and 2.2.0_alpha174.