Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 875377 - bootstrap-prefix.sh exits in stage2 for gcc-config-2.6 with invalid shebang ($EPREFIX/tmp/usr/bin/env)
Summary: bootstrap-prefix.sh exits in stage2 for gcc-config-2.6 with invalid shebang (...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Prefix
URL: https://gitweb.gentoo.org/proj/gcc-co...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-10-05 14:25 UTC by Bart Oldeman
Modified: 2022-10-08 22:16 UTC (History)
1 user (show)

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


Attachments
Solution: fix via wrapper script calling system env (bootstrap-add-env1.patch,1.00 KB, patch)
2022-10-07 13:11 UTC, Bart Oldeman
Details | Diff
Solution 2: fix via installing coreutils in stage2 and stage3 (bootstrap-add-env2.patch,1005 bytes, patch)
2022-10-07 13:15 UTC, Bart Oldeman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Oldeman 2022-10-05 14:25:26 UTC
running bootstrap-prefix.sh with "no" answered for
Do you want to use stable Prefix? [Yn]
crashes when installing gcc-config-2.6

Reproducible: Always

Steps to Reproduce:
1. ./bootstrap-prefix.sh
2. enter "n" for Do you want to use stable Prefix?
Actual Results:  
 * QA Notice: the following files use invalid (possible non-prefixed) shebangs:
 *   home/oldeman/eessigentoo/tmp/usr/bin/gcc-config:/home/oldeman/eessigentoo/tmp/usr/bin/env (explicit EPREFIX but target not found)
 * ERROR: sys-devel/gcc-config-2.6::gentoo failed:
 *   Aborting due to QA concerns: invalid shebangs found


Expected Results:  
Successful bootstrap

This is due to
https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=ba452333dca237866e793ec40d0f387aefa917a3

The
#!/usr/bin/env bash
gets transformed to
#!/home/oldeman/eessigentoo/tmp/usr/bin/env bash
but env doesn't exists there since coreutils isn't compiled in stage1.

I can think of several solutions, one is to unconditionally compile coreutils in stage1, but not sure what is the best one.
Comment 1 Bart Oldeman 2022-10-07 13:11:27 UTC
Created attachment 822736 [details, diff]
Solution: fix via wrapper script calling system env
Comment 2 Bart Oldeman 2022-10-07 13:15:07 UTC
Created attachment 822739 [details, diff]
Solution 2: fix via installing coreutils in stage2 and stage3

In that case masking split-usr in stage2 is necessary, since the tmp structure used in stage1 and stage2 is without split-usr, it just wasn't relevant so far without coreutils being installed.

(stage3+ uses split-usr for RAP, but masks split-usr for non RAP)
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-07 20:08:15 UTC
(In reply to Bart Oldeman from comment #1)
> Created attachment 822736 [details, diff] [details, diff]
> Solution: fix via wrapper script calling system env

I think I like this one best.
Comment 4 Fabian Groffen gentoo-dev 2022-10-08 06:29:03 UTC
hmmm, the point of /usr/bin/env is that it doesn't need prefixing.
Comment 5 Fabian Groffen gentoo-dev 2022-10-08 06:37:21 UTC
right, in

https://gitweb.gentoo.org/repo/proj/prefix.git/tree/sys-devel/gcc-config/files/gcc-config-1.9-usrbinenv-bash.patch

we also removed the sed-rule that "prefixes" the shebang, in the upstream git commit this doesn't happen.

@sam: since you made that upstream commit, could we also have the shebang be left untouched as in the patch used for non-RAP prefix installs?
Comment 6 Larry the Git Cow gentoo-dev 2022-10-08 22:02:44 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=11c3a59b2395f25ac869573a361ac937a0144427

commit 11c3a59b2395f25ac869573a361ac937a0144427
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-08 22:01:38 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-08 22:01:38 +0000

    Makefile: drop excessive EPREFIXing
    
    Bug: https://bugs.gentoo.org/875377
    Signed-off-by: Sam James <sam@gentoo.org>

 Makefile | 1 -
 1 file changed, 1 deletion(-)
Comment 7 Larry the Git Cow gentoo-dev 2022-10-08 22:08:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6b625695cad967782ae5a9c52eb755f87d1aa10

commit b6b625695cad967782ae5a9c52eb755f87d1aa10
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-08 22:05:55 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-08 22:08:13 +0000

    sys-devel/gcc-config: add 2.7
    
    Bug: https://bugs.gentoo.org/875377
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc-config/Manifest              |  1 +
 sys-devel/gcc-config/gcc-config-2.7.ebuild | 60 ++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-08 22:08:36 UTC
(In reply to Fabian Groffen from comment #5)
> right, in
> 
> https://gitweb.gentoo.org/repo/proj/prefix.git/tree/sys-devel/gcc-config/
> files/gcc-config-1.9-usrbinenv-bash.patch
> 
> we also removed the sed-rule that "prefixes" the shebang, in the upstream
> git commit this doesn't happen.
> 
> @sam: since you made that upstream commit, could we also have the shebang be
> left untouched as in the patch used for non-RAP prefix installs?

Thank you!
Comment 9 Larry the Git Cow gentoo-dev 2022-10-08 22:16:47 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=67d6c543a652d4c6444bf82a1469c5c68b6f2510

commit 67d6c543a652d4c6444bf82a1469c5c68b6f2510
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-08 22:06:36 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-08 22:16:42 +0000

    sys-devel/gcc-config: add 2.7, drop 2.6
    
    Closes: https://bugs.gentoo.org/875377
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc-config/Manifest                                         | 2 +-
 sys-devel/gcc-config/{gcc-config-2.6.ebuild => gcc-config-2.7.ebuild} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)