Re: [gentoo-portage-dev] [PATCH] phase-functions: make ED, EROOT read-only

2022-07-26 Thread Fabian Groffen
On 25-07-2022 19:43:21 -0400, Mike Gilbert wrote:
> On Mon, Jul 25, 2022 at 1:03 PM Fabian Groffen  wrote:
> >
> > bin/phase-functions.sh: make ED and EROOT read-only too
> >
> > Like D, make ED and EROOT read-only vars.
> 
> Makes sense.

https://github.com/gentoo/portage/pull/870

Thanks,
Fabian

-- 
Fabian Groffen
Gentoo on a different level


signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] misc-functions: Prefix fixes

2022-07-26 Thread Fabian Groffen
On 25-07-2022 19:42:51 -0400, Mike Gilbert wrote:
> On Mon, Jul 25, 2022 at 12:47 PM Fabian Groffen  wrote:
> >
> > bin/misc-functions.sh: some Prefix fixes
> >
> > - ED needs not to exist, whereas D does, so ensure we check for that,
> >   and create ED if absent, necessary for further checks to succeed
> > - use EPREFIX in INSTALL_MASK
> 
> Seems good to me.

https://github.com/gentoo/portage/pull/870 

-- 
Fabian Groffen
Gentoo on a different level


signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] world-writable: tune for Prefix

2022-07-26 Thread Fabian Groffen
On 25-07-2022 19:39:38 -0400, Mike Gilbert wrote:
> On Mon, Jul 25, 2022 at 12:41 PM Fabian Groffen  wrote:
> >
> > bin/install-qa-check.d/90world-writable: include EPREFIX in reports
> >
> > It is much less confusing and consistent to report full paths including
> > the leading EPREFIX.
> 
> Makes sense to me.

https://github.com/gentoo/portage/pull/869

thanks

-- 
Fabian Groffen
Gentoo on a different level


signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] multilib-strict: fix for Prefix

2022-07-26 Thread Fabian Groffen
On 25-07-2022 19:38:57 -0400, Mike Gilbert wrote:
> On Mon, Jul 25, 2022 at 12:26 PM Fabian Groffen  wrote:
> >
> > bin/install-qa-check.d/80multilib-strict: use file/find from Prefix
> >
> > diff --git a/bin/install-qa-check.d/80multilib-strict 
> > b/bin/install-qa-check.d/80multilib-strict
> > index afd223250..3db4ecce3 100644
> > --- a/bin/install-qa-check.d/80multilib-strict
> > +++ b/bin/install-qa-check.d/80multilib-strict
> > @@ -1,7 +1,7 @@
> >  # Strict multilib directory checks
> >  multilib_strict_check() {
> > if has multilib-strict ${FEATURES} && \
> > -  [[ -x /usr/bin/file && -x /usr/bin/find ]] && \
> > +  [[ -x ${EPREFIX}/usr/bin/file && -x ${EPREFIX}/usr/bin/find ]] 
> > && \
> >[[ -n ${MULTILIB_STRICT_DIRS} && -n ${MULTILIB_STRICT_DENY} ]]
> > then
> > rm -f "${T}/multilib-strict.log"
> 
> Seems good to me.

https://github.com/gentoo/portage/pull/868

Thanks

-- 
Fabian Groffen
Gentoo on a different level


signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] 80libraries: add support for Darwin targets

2022-07-26 Thread Fabian Groffen
On 26-07-2022 04:01:37 +0100, Sam James wrote:
> 
> 
> > On 26 Jul 2022, at 00:33, Mike Gilbert  wrote:
> > 
> > On Mon, Jul 25, 2022 at 11:38 AM Fabian Groffen  wrote:
> >> 
> >> bin/install-qa-check.d/80libraries: support Darwin/Mach-O objects
> >> 
> >> Check for dylib on Darwin, so on everything else.
> >> 
> >> Signed-off-by: Fabian Groffen 
> >> 
> >> diff --git a/bin/install-qa-check.d/80libraries 
> >> b/bin/install-qa-check.d/80libraries
> >> index 8dc35bb87..a477ec9cb 100644
> >> --- a/bin/install-qa-check.d/80libraries
> >> +++ b/bin/install-qa-check.d/80libraries
> >> @@ -140,7 +140,9 @@ lib_check() {
> >>local abort="no"
> >>local a s
> >>for a in "${ED%/}"/usr/lib*/*.a ; do
> >> -   s=${a%.a}.so
> >> +   [[ ${CHOST} == *-darwin* ]] \
> >> +   && s=${a%.a}.dylib \
> >> +   || s=${a%.a}.so
> > 
> > I would find this much easier to read if you converted it to an
> > if/else statement instead of chaining && and ||.
> 
> Yes, please.

https://github.com/gentoo/portage/pull/867

Thanks


-- 
Fabian Groffen
Gentoo on a different level


signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] doins: fix D check, add EPREFIX check

2022-07-26 Thread Fabian Groffen
On 25-07-2022 19:29:35 -0400, Mike Gilbert wrote:
> Could you please create a PR at https://github.com/gentoo/portage so
> that the CI system can test the changes for this patch series?

https://github.com/gentoo/portage/pull/866

Thanks,
Fabian

-- 
Fabian Groffen
Gentoo on a different level


signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] doins: fix D check, add EPREFIX check

2022-07-26 Thread Fabian Groffen
On 25-07-2022 19:50:41 +0200, Ulrich Mueller wrote:
> > On Mon, 25 Jul 2022, Fabian Groffen wrote:
> 
> > @@ -50,6 +51,16 @@ if [[ ${_E_INSDESTTREE_#${ED}} != "${_E_INSDESTTREE_}" 
> > ]]; then
> > __helpers_die "${helper} used with \${D} or \${ED}"
> > exit 1
> >  fi
> > +if [[ -n ${EPREFIX} && \
> > +   ${_E_INSDESTTREE_#${EPREFIX}} != "${_E_INSDESTTREE_}" ]];
> 
> The semicolon is redundant.

removed, thanks


-- 
Fabian Groffen
Gentoo on a different level


signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] emake: explicitly set SHELL

2022-07-26 Thread Fabian Groffen
On 26-07-2022 09:03:18 +0200, Florian Schmaus wrote:
> On 26.07.22 05:00, Sam James wrote:
> >> On 25 Jul 2022, at 16:28, Fabian Groffen  wrote:
> >>
> >> bin/ebuild-helpers/emake: force SHELL to be set
> >>
[snip]
> >>
> >> diff --git a/bin/ebuild-helpers/emake b/bin/ebuild-helpers/emake
> >> index 60718a2e4..21da85845 100755
> >> --- a/bin/ebuild-helpers/emake
> >> +++ b/bin/ebuild-helpers/emake
> >> @@ -12,7 +12,7 @@
> >> source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
> >>
> >> cmd=(
> >> -  ${MAKE:-make} ${MAKEOPTS} "$@" ${EXTRA_EMAKE}
> >> +  ${MAKE:-make} SHELL="${BASH:-/bin/bash}" ${MAKEOPTS} "$@" ${EXTRA_EMAKE}
> >> )
> >>
> >> if [[ ${PORTAGE_QUIET} != 1 ]] ; then
> >>
> > 
> > I don't think I agree with this as it is. Why not just ${EPREFIX}/bin/sh to 
> > avoid using
> > an ancient host sh?
> 
> I was about to write the same (also using EPREFIX, but EBROOT seems what 
> you want, as you figured).
> 
> But then I wondered if "make SHELL=$BROOT/bin/sh" wouldn't override 
> explicitly set SHELL values in Makefiles. Assume a package has
> 
> SHELL = /bin/zsh
> 
> in one of its Makefiles. Then emake would reset this to 'sh'. Which 
> appears like it could cause build issues.
> 
> If this is the case, then I am not sure what we can do about it. It 
> appears fragile, if not impossible, to ask 'make' which value for SHELL 
> it would assume, so that emake could adjust the path. Another option 
> could be that affected packages define a variable in their ebuild, e.g. 
> EMAKE_SHELL="zsh", which emake could extend with BROOT before passing 
> the resulting value as SHELL to make.

So, I can also envision we drop this patch, and I see if I can patch
make(1) to use $EPREFIX/bin/sh instead of /bin/sh by default.  Not sure,
but this would retain the behaviour Portage is doing now for non-Prefix,
and would get the behaviour we want in Prefix.

On an alternative note, there is CONFIG_SHELL (used for setting which shell
to use with configure), which I think in many cases bleeds through to
make, but should there be a MAKE_SHELL perhaps as well?  Then the
default would be pretty much ok.

(We never ran into any problems forcing SHELL to bash in Prefix, but
perhaps that's not a representative test for the whole of Gentoo.)

Thanks,
Fabian

-- 
Fabian Groffen
Gentoo on a different level


signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] emake: explicitly set SHELL

2022-07-26 Thread Florian Schmaus

On 26.07.22 05:00, Sam James wrote:




On 25 Jul 2022, at 16:28, Fabian Groffen  wrote:

bin/ebuild-helpers/emake: force SHELL to be set

On Prefix systems /bin/sh can be anything, including very ancient.  So
ensure we're running with bash, since that's what Gentoo Linux is
expecting /bin/sh to be (by default, at least).

Provide a fallback for the (near impossible) case that we use a bash
that doesn't set BASH, or when we don't use bash at all.  This is not
expected, though, as we explicitly require bash throughout all Portage,
so we don't really care about using a non-Prefixed one, for this really
shouldn't happen.

Signed-off-by: Fabian Groffen 

diff --git a/bin/ebuild-helpers/emake b/bin/ebuild-helpers/emake
index 60718a2e4..21da85845 100755
--- a/bin/ebuild-helpers/emake
+++ b/bin/ebuild-helpers/emake
@@ -12,7 +12,7 @@
source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1

cmd=(
-   ${MAKE:-make} ${MAKEOPTS} "$@" ${EXTRA_EMAKE}
+   ${MAKE:-make} SHELL="${BASH:-/bin/bash}" ${MAKEOPTS} "$@" ${EXTRA_EMAKE}
)

if [[ ${PORTAGE_QUIET} != 1 ]] ; then



I don't think I agree with this as it is. Why not just ${EPREFIX}/bin/sh to 
avoid using
an ancient host sh?


I was about to write the same (also using EPREFIX, but EBROOT seems what 
you want, as you figured).


But then I wondered if "make SHELL=$BROOT/bin/sh" wouldn't override 
explicitly set SHELL values in Makefiles. Assume a package has


SHELL = /bin/zsh

in one of its Makefiles. Then emake would reset this to 'sh'. Which 
appears like it could cause build issues.


If this is the case, then I am not sure what we can do about it. It 
appears fragile, if not impossible, to ask 'make' which value for SHELL 
it would assume, so that emake could adjust the path. Another option 
could be that affected packages define a variable in their ebuild, e.g. 
EMAKE_SHELL="zsh", which emake could extend with BROOT before passing 
the resulting value as SHELL to make.


- Flow