public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] profiles: workaround sandbox bug with getcwd() configure test (gl_cv_func_getcwd_path_max)
@ 2024-01-22 16:14 Sam James
  2024-01-22 16:35 ` David Seifert
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Sam James @ 2024-01-22 16:14 UTC (permalink / raw)
  To: gentoo-dev; +Cc: toolchain, sandbox, musl, Sam James

Workaround for sandbox bug which causes this gnulib configure test to take
many real hours on slower machines, and certainly a huge amount of CPU hours
on others.

Spoof the same result as configure gets on a modern glibc & musl system for now.

Bug: https://bugs.gentoo.org/447970
Closes: https://bugs.gentoo.org/922652
Signed-off-by: Sam James <sam@gentoo.org>
---
 profiles/default/linux/make.defaults | 9 ++++++++-
 profiles/features/musl/make.defaults | 7 +++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/profiles/default/linux/make.defaults b/profiles/default/linux/make.defaults
index 74dd59d5d8179..4e21cd58fdf22 100644
--- a/profiles/default/linux/make.defaults
+++ b/profiles/default/linux/make.defaults
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 #
 # System-wide defaults for the Portage system
@@ -54,3 +54,10 @@ LDFLAGS="-Wl,-O1 -Wl,--as-needed"
 # Prevent automagic use of 64-bit time_t.
 # https://bugs.gentoo.org/828001
 enable_year2038="no"
+
+# Sam James <sam@gentoo.org> (2024-01-22)
+# Workaround for sandbox bug which causes this gnulib configure test to take
+# many real hours on slower machines, and certainly a huge amount of CPU hours
+# on others. Spoof the same result as configure gets on a modern glibc system
+# for now. See bug #447970 and bug #922652.
+gl_cv_func_getcwd_path_max="yes"
diff --git a/profiles/features/musl/make.defaults b/profiles/features/musl/make.defaults
index 3078bdd61b09c..ca792276e3945 100644
--- a/profiles/features/musl/make.defaults
+++ b/profiles/features/musl/make.defaults
@@ -17,3 +17,10 @@ FEATURES="-multilib-strict"
 # that use a charset, it causes package collisons.
 # Note: we use a full path for locale.alias for bug #799437
 INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
+
+# Sam James <sam@gentoo.org> (2024-01-22)
+# Workaround for sandbox bug which causes this gnulib configure test to take
+# many real hours on slower machines, and certainly a huge amount of CPU hours
+# on others. Spoof the same result as configure gets on a modern musl system
+# for now. See bug #447970 and bug #922652.
+gl_cv_func_getcwd_path_max="no, but it is partly working"
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] profiles: workaround sandbox bug with getcwd() configure test (gl_cv_func_getcwd_path_max)
  2024-01-22 16:14 [gentoo-dev] [PATCH] profiles: workaround sandbox bug with getcwd() configure test (gl_cv_func_getcwd_path_max) Sam James
@ 2024-01-22 16:35 ` David Seifert
  2024-01-22 16:45 ` [gentoo-dev] " Arsen Arsenović
  2024-01-23  3:32 ` [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR orbea
  2 siblings, 0 replies; 11+ messages in thread
From: David Seifert @ 2024-01-22 16:35 UTC (permalink / raw)
  To: gentoo-dev; +Cc: toolchain, sandbox, musl, Sam James

On Mon, 2024-01-22 at 16:14 +0000, Sam James wrote:
> Workaround for sandbox bug which causes this gnulib configure test to
> take
> many real hours on slower machines, and certainly a huge amount of CPU
> hours
> on others.
> 
> Spoof the same result as configure gets on a modern glibc & musl
> system for now.
> 
> Bug: https://bugs.gentoo.org/447970
> Closes: https://bugs.gentoo.org/922652
> Signed-off-by: Sam James <sam@gentoo.org>
> ---
>  profiles/default/linux/make.defaults | 9 ++++++++-
>  profiles/features/musl/make.defaults | 7 +++++++
>  2 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/profiles/default/linux/make.defaults
> b/profiles/default/linux/make.defaults
> index 74dd59d5d8179..4e21cd58fdf22 100644
> --- a/profiles/default/linux/make.defaults
> +++ b/profiles/default/linux/make.defaults
> @@ -1,4 +1,4 @@
> -# Copyright 1999-2023 Gentoo Authors
> +# Copyright 1999-2024 Gentoo Authors
>  # Distributed under the terms of the GNU General Public License v2
>  #
>  # System-wide defaults for the Portage system
> @@ -54,3 +54,10 @@ LDFLAGS="-Wl,-O1 -Wl,--as-needed"
>  # Prevent automagic use of 64-bit time_t.
>  # https://bugs.gentoo.org/828001
>  enable_year2038="no"
> +
> +# Sam James <sam@gentoo.org> (2024-01-22)
> +# Workaround for sandbox bug which causes this gnulib configure test
> to take
> +# many real hours on slower machines, and certainly a huge amount of
> CPU hours
> +# on others. Spoof the same result as configure gets on a modern
> glibc system
> +# for now. See bug #447970 and bug #922652.
> +gl_cv_func_getcwd_path_max="yes"
> diff --git a/profiles/features/musl/make.defaults
> b/profiles/features/musl/make.defaults
> index 3078bdd61b09c..ca792276e3945 100644
> --- a/profiles/features/musl/make.defaults
> +++ b/profiles/features/musl/make.defaults
> @@ -17,3 +17,10 @@ FEATURES="-multilib-strict"
>  # that use a charset, it causes package collisons.
>  # Note: we use a full path for locale.alias for bug #799437
>  INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
> +
> +# Sam James <sam@gentoo.org> (2024-01-22)
> +# Workaround for sandbox bug which causes this gnulib configure test
> to take
> +# many real hours on slower machines, and certainly a huge amount of
> CPU hours
> +# on others. Spoof the same result as configure gets on a modern musl
> system
> +# for now. See bug #447970 and bug #922652.
> +gl_cv_func_getcwd_path_max="no, but it is partly working"

LGTM


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-dev] Re: [PATCH] profiles: workaround sandbox bug with getcwd() configure test (gl_cv_func_getcwd_path_max)
  2024-01-22 16:14 [gentoo-dev] [PATCH] profiles: workaround sandbox bug with getcwd() configure test (gl_cv_func_getcwd_path_max) Sam James
  2024-01-22 16:35 ` David Seifert
@ 2024-01-22 16:45 ` Arsen Arsenović
  2024-01-23  3:32 ` [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR orbea
  2 siblings, 0 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-01-22 16:45 UTC (permalink / raw)
  To: Sam James; +Cc: gentoo-dev, toolchain, sandbox, musl

[-- Attachment #1: Type: text/plain, Size: 2516 bytes --]

Hi,

Sam James <sam@gentoo.org> writes:

> Workaround for sandbox bug which causes this gnulib configure test to take
> many real hours on slower machines, and certainly a huge amount of CPU hours
> on others.
>
> Spoof the same result as configure gets on a modern glibc & musl system for now.
>
> Bug: https://bugs.gentoo.org/447970
> Closes: https://bugs.gentoo.org/922652
> Signed-off-by: Sam James <sam@gentoo.org>
> ---

Seems OK.

>  profiles/default/linux/make.defaults | 9 ++++++++-
>  profiles/features/musl/make.defaults | 7 +++++++
>  2 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/profiles/default/linux/make.defaults b/profiles/default/linux/make.defaults
> index 74dd59d5d8179..4e21cd58fdf22 100644
> --- a/profiles/default/linux/make.defaults
> +++ b/profiles/default/linux/make.defaults
> @@ -1,4 +1,4 @@
> -# Copyright 1999-2023 Gentoo Authors
> +# Copyright 1999-2024 Gentoo Authors
>  # Distributed under the terms of the GNU General Public License v2
>  #
>  # System-wide defaults for the Portage system
> @@ -54,3 +54,10 @@ LDFLAGS="-Wl,-O1 -Wl,--as-needed"
>  # Prevent automagic use of 64-bit time_t.
>  # https://bugs.gentoo.org/828001
>  enable_year2038="no"
> +
> +# Sam James <sam@gentoo.org> (2024-01-22)
> +# Workaround for sandbox bug which causes this gnulib configure test to take
> +# many real hours on slower machines, and certainly a huge amount of CPU hours
> +# on others. Spoof the same result as configure gets on a modern glibc system
> +# for now. See bug #447970 and bug #922652.
> +gl_cv_func_getcwd_path_max="yes"
> diff --git a/profiles/features/musl/make.defaults b/profiles/features/musl/make.defaults
> index 3078bdd61b09c..ca792276e3945 100644
> --- a/profiles/features/musl/make.defaults
> +++ b/profiles/features/musl/make.defaults
> @@ -17,3 +17,10 @@ FEATURES="-multilib-strict"
>  # that use a charset, it causes package collisons.
>  # Note: we use a full path for locale.alias for bug #799437
>  INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
> +
> +# Sam James <sam@gentoo.org> (2024-01-22)
> +# Workaround for sandbox bug which causes this gnulib configure test to take
> +# many real hours on slower machines, and certainly a huge amount of CPU hours
> +# on others. Spoof the same result as configure gets on a modern musl system
> +# for now. See bug #447970 and bug #922652.
> +gl_cv_func_getcwd_path_max="no, but it is partly working"


--
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR
  2024-01-22 16:14 [gentoo-dev] [PATCH] profiles: workaround sandbox bug with getcwd() configure test (gl_cv_func_getcwd_path_max) Sam James
  2024-01-22 16:35 ` David Seifert
  2024-01-22 16:45 ` [gentoo-dev] " Arsen Arsenović
@ 2024-01-23  3:32 ` orbea
  2024-01-23  3:48   ` Michał Górny
  2024-01-23  4:06   ` Eli Schwartz
  2 siblings, 2 replies; 11+ messages in thread
From: orbea @ 2024-01-23  3:32 UTC (permalink / raw)
  To: gentoo-dev

This is required when cargo_live_src_unpack needs to be find a
Cargo.toml file in a directory other than ${S}

Signed-off-by: orbea <orbea@riseup.net>
---
 eclass/cargo.eclass | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 3bdbb5e3ec64..692623382c56 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -116,6 +116,15 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
 # other src_functions of this eclass.
 # Note that cargo_gen_config is automatically called by cargo_src_unpack.
 
+# @ECLASS_VARIABLE: CARGO_TOML_DIR
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Optional variable containing the directory path to the Cargo.toml file.
+# Should be defined before calling cargo_live_src_unpack.
+#
+# This is required for live ebuilds when Cargo.toml in a directory other
+# than ${S}.
+
 # @ECLASS_VARIABLE: myfeatures
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -403,7 +412,7 @@ cargo_live_src_unpack() {
 		umask "${EVCS_UMASK}" || die "Bad options to umask: ${EVCS_UMASK}"
 	fi
 
-	pushd "${S}" > /dev/null || die
+	pushd "${CARGO_TOML_DIR:-$S}" > /dev/null || die
 
 	# Respect user settings before cargo_gen_config is called.
 	if [[ ! ${CARGO_TERM_COLOR} ]]; then
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR
  2024-01-23  3:32 ` [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR orbea
@ 2024-01-23  3:48   ` Michał Górny
  2024-01-23 14:13     ` orbea
  2024-01-23  4:06   ` Eli Schwartz
  1 sibling, 1 reply; 11+ messages in thread
From: Michał Górny @ 2024-01-23  3:48 UTC (permalink / raw)
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1488 bytes --]

On Mon, 2024-01-22 at 19:32 -0800, orbea wrote:
> This is required when cargo_live_src_unpack needs to be find a
> Cargo.toml file in a directory other than ${S}
> 
> Signed-off-by: orbea <orbea@riseup.net>
> ---
>  eclass/cargo.eclass | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
> index 3bdbb5e3ec64..692623382c56 100644
> --- a/eclass/cargo.eclass
> +++ b/eclass/cargo.eclass
> @@ -116,6 +116,15 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
>  # other src_functions of this eclass.
>  # Note that cargo_gen_config is automatically called by cargo_src_unpack.
>  
> +# @ECLASS_VARIABLE: CARGO_TOML_DIR
> +# @DEFAULT_UNSET
> +# @DESCRIPTION:
> +# Optional variable containing the directory path to the Cargo.toml file.
> +# Should be defined before calling cargo_live_src_unpack.
> +#
> +# This is required for live ebuilds when Cargo.toml in a directory other
> +# than ${S}.
> +
>  # @ECLASS_VARIABLE: myfeatures
>  # @DEFAULT_UNSET
>  # @DESCRIPTION:
> @@ -403,7 +412,7 @@ cargo_live_src_unpack() {
>  		umask "${EVCS_UMASK}" || die "Bad options to umask: ${EVCS_UMASK}"
>  	fi
>  
> -	pushd "${S}" > /dev/null || die
> +	pushd "${CARGO_TOML_DIR:-$S}" > /dev/null || die

Please respect the current variable style.

>  
>  	# Respect user settings before cargo_gen_config is called.
>  	if [[ ! ${CARGO_TERM_COLOR} ]]; then

-- 
Best regards,
Michał Górny


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR
  2024-01-23  3:32 ` [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR orbea
  2024-01-23  3:48   ` Michał Górny
@ 2024-01-23  4:06   ` Eli Schwartz
  2024-01-23 14:11     ` orbea
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Schwartz @ 2024-01-23  4:06 UTC (permalink / raw)
  To: gentoo-dev


[-- Attachment #1.1.1: Type: text/plain, Size: 580 bytes --]

On 1/22/24 10:32 PM, orbea wrote:
> This is required when cargo_live_src_unpack needs to be find a
> Cargo.toml file in a directory other than ${S}
> 
> Signed-off-by: orbea <orbea@riseup.net>
> ---


Fairly confused why this email was posted to an existing thread instead
of a new one?

Anyway, I'm sure the change is very reasonable but it is difficult to
tell from an outside perspective just by reading the commit message --
which doesn't detail why your Cargo.toml would be in a directory other
than the one src_compile() starts off in.


-- 
Eli Schwartz

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 18399 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR
  2024-01-23  4:06   ` Eli Schwartz
@ 2024-01-23 14:11     ` orbea
  0 siblings, 0 replies; 11+ messages in thread
From: orbea @ 2024-01-23 14:11 UTC (permalink / raw)
  To: gentoo-dev

On Mon, 22 Jan 2024 23:06:35 -0500
Eli Schwartz <eschwartz93@gmail.com> wrote:

> On 1/22/24 10:32 PM, orbea wrote:
> > This is required when cargo_live_src_unpack needs to be find a
> > Cargo.toml file in a directory other than ${S}
> > 
> > Signed-off-by: orbea <orbea@riseup.net>
> > ---  
> 
> 
> Fairly confused why this email was posted to an existing thread
> instead of a new one?
> 
> Anyway, I'm sure the change is very reasonable but it is difficult to
> tell from an outside perspective just by reading the commit message --
> which doesn't detail why your Cargo.toml would be in a directory other
> than the one src_compile() starts off in.
> 
> 

My mistake in composing the e-mail in why it was posted to an existing
thread.

The program in question is:

https://github.com/Rosalie241/RMG

Which has an optional rust plugin.

https://github.com/Rosalie241/RMG/tree/master/Source/3rdParty/mupen64plus-input-gca

It seems impossible to support a live ebuild unless
cargo_live_src_unpack knows where to look.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR
  2024-01-23  3:48   ` Michał Górny
@ 2024-01-23 14:13     ` orbea
  2024-01-23 16:48       ` Michał Górny
  0 siblings, 1 reply; 11+ messages in thread
From: orbea @ 2024-01-23 14:13 UTC (permalink / raw)
  To: gentoo-dev

On Tue, 23 Jan 2024 04:48:02 +0100
Michał Górny <mgorny@gentoo.org> wrote:

> On Mon, 2024-01-22 at 19:32 -0800, orbea wrote:
> > This is required when cargo_live_src_unpack needs to be find a
> > Cargo.toml file in a directory other than ${S}
> > 
> > Signed-off-by: orbea <orbea@riseup.net>
> > ---
> >  eclass/cargo.eclass | 11 ++++++++++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> > 
> > diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
> > index 3bdbb5e3ec64..692623382c56 100644
> > --- a/eclass/cargo.eclass
> > +++ b/eclass/cargo.eclass
> > @@ -116,6 +116,15 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
> >  # other src_functions of this eclass.
> >  # Note that cargo_gen_config is automatically called by
> > cargo_src_unpack. 
> > +# @ECLASS_VARIABLE: CARGO_TOML_DIR
> > +# @DEFAULT_UNSET
> > +# @DESCRIPTION:
> > +# Optional variable containing the directory path to the
> > Cargo.toml file. +# Should be defined before calling
> > cargo_live_src_unpack. +#
> > +# This is required for live ebuilds when Cargo.toml in a directory
> > other +# than ${S}.
> > +
> >  # @ECLASS_VARIABLE: myfeatures
> >  # @DEFAULT_UNSET
> >  # @DESCRIPTION:
> > @@ -403,7 +412,7 @@ cargo_live_src_unpack() {
> >  		umask "${EVCS_UMASK}" || die "Bad options to
> > umask: ${EVCS_UMASK}" fi
> >  
> > -	pushd "${S}" > /dev/null || die
> > +	pushd "${CARGO_TOML_DIR:-$S}" > /dev/null || die  
> 
> Please respect the current variable style.

Sorry for being dense, but could you elaborate what you mean?

> 
> >  
> >  	# Respect user settings before cargo_gen_config is called.
> >  	if [[ ! ${CARGO_TERM_COLOR} ]]; then  
> 



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR
  2024-01-23 14:13     ` orbea
@ 2024-01-23 16:48       ` Michał Górny
  2024-01-23 19:43         ` orbea
  0 siblings, 1 reply; 11+ messages in thread
From: Michał Górny @ 2024-01-23 16:48 UTC (permalink / raw)
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1803 bytes --]

On Tue, 2024-01-23 at 06:13 -0800, orbea wrote:
> On Tue, 23 Jan 2024 04:48:02 +0100
> Michał Górny <mgorny@gentoo.org> wrote:
> 
> > On Mon, 2024-01-22 at 19:32 -0800, orbea wrote:
> > > This is required when cargo_live_src_unpack needs to be find a
> > > Cargo.toml file in a directory other than ${S}
> > > 
> > > Signed-off-by: orbea <orbea@riseup.net>
> > > ---
> > >  eclass/cargo.eclass | 11 ++++++++++-
> > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
> > > index 3bdbb5e3ec64..692623382c56 100644
> > > --- a/eclass/cargo.eclass
> > > +++ b/eclass/cargo.eclass
> > > @@ -116,6 +116,15 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
> > >  # other src_functions of this eclass.
> > >  # Note that cargo_gen_config is automatically called by
> > > cargo_src_unpack. 
> > > +# @ECLASS_VARIABLE: CARGO_TOML_DIR
> > > +# @DEFAULT_UNSET
> > > +# @DESCRIPTION:
> > > +# Optional variable containing the directory path to the
> > > Cargo.toml file. +# Should be defined before calling
> > > cargo_live_src_unpack. +#
> > > +# This is required for live ebuilds when Cargo.toml in a directory
> > > other +# than ${S}.
> > > +
> > >  # @ECLASS_VARIABLE: myfeatures
> > >  # @DEFAULT_UNSET
> > >  # @DESCRIPTION:
> > > @@ -403,7 +412,7 @@ cargo_live_src_unpack() {
> > >  		umask "${EVCS_UMASK}" || die "Bad options to
> > > umask: ${EVCS_UMASK}" fi
> > >  
> > > -	pushd "${S}" > /dev/null || die
> > > +	pushd "${CARGO_TOML_DIR:-$S}" > /dev/null || die  
> > 
> > Please respect the current variable style.
> 
> Sorry for being dense, but could you elaborate what you mean?
> 

You changed '${S}' to '$S' which goes against the established style.

-- 
Best regards,
Michał Górny


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR
  2024-01-23 16:48       ` Michał Górny
@ 2024-01-23 19:43         ` orbea
  2024-01-24 18:59           ` orbea
  0 siblings, 1 reply; 11+ messages in thread
From: orbea @ 2024-01-23 19:43 UTC (permalink / raw)
  To: gentoo-dev

On Tue, 23 Jan 2024 17:48:25 +0100
Michał Górny <mgorny@gentoo.org> wrote:

> On Tue, 2024-01-23 at 06:13 -0800, orbea wrote:
> > On Tue, 23 Jan 2024 04:48:02 +0100
> > Michał Górny <mgorny@gentoo.org> wrote:
> >   
> > > On Mon, 2024-01-22 at 19:32 -0800, orbea wrote:  
> > > > This is required when cargo_live_src_unpack needs to be find a
> > > > Cargo.toml file in a directory other than ${S}
> > > > 
> > > > Signed-off-by: orbea <orbea@riseup.net>
> > > > ---
> > > >  eclass/cargo.eclass | 11 ++++++++++-
> > > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
> > > > index 3bdbb5e3ec64..692623382c56 100644
> > > > --- a/eclass/cargo.eclass
> > > > +++ b/eclass/cargo.eclass
> > > > @@ -116,6 +116,15 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
> > > >  # other src_functions of this eclass.
> > > >  # Note that cargo_gen_config is automatically called by
> > > > cargo_src_unpack. 
> > > > +# @ECLASS_VARIABLE: CARGO_TOML_DIR
> > > > +# @DEFAULT_UNSET
> > > > +# @DESCRIPTION:
> > > > +# Optional variable containing the directory path to the
> > > > Cargo.toml file. +# Should be defined before calling
> > > > cargo_live_src_unpack. +#
> > > > +# This is required for live ebuilds when Cargo.toml in a
> > > > directory other +# than ${S}.
> > > > +
> > > >  # @ECLASS_VARIABLE: myfeatures
> > > >  # @DEFAULT_UNSET
> > > >  # @DESCRIPTION:
> > > > @@ -403,7 +412,7 @@ cargo_live_src_unpack() {
> > > >  		umask "${EVCS_UMASK}" || die "Bad options to
> > > > umask: ${EVCS_UMASK}" fi
> > > >  
> > > > -	pushd "${S}" > /dev/null || die
> > > > +	pushd "${CARGO_TOML_DIR:-$S}" > /dev/null || die    
> > > 
> > > Please respect the current variable style.  
> > 
> > Sorry for being dense, but could you elaborate what you mean?
> >   
> 
> You changed '${S}' to '$S' which goes against the established style.
> 

Thanks for spelling that out, I corrected the patch.

-------------

This is required when cargo_live_src_unpack needs to be find a
Cargo.toml file in a directory other than ${S}. This may happen in
cases where the package has a rust component within a subdirectory
where the program otherwise use another language.

Signed-off-by: orbea <orbea@riseup.net>
---
 eclass/cargo.eclass | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 3bdbb5e3ec64..f88b3b82d8ed 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -116,6 +116,15 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
 # other src_functions of this eclass.
 # Note that cargo_gen_config is automatically called by cargo_src_unpack.
 
+# @ECLASS_VARIABLE: CARGO_TOML_DIR
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Optional variable containing the directory path to the Cargo.toml file.
+# Should be defined before calling cargo_live_src_unpack.
+#
+# This is required for live ebuilds when Cargo.toml in a directory other
+# than ${S}.
+
 # @ECLASS_VARIABLE: myfeatures
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -403,7 +412,7 @@ cargo_live_src_unpack() {
 		umask "${EVCS_UMASK}" || die "Bad options to umask: ${EVCS_UMASK}"
 	fi
 
-	pushd "${S}" > /dev/null || die
+	pushd "${CARGO_TOML_DIR:-${S}}" > /dev/null || die
 
 	# Respect user settings before cargo_gen_config is called.
 	if [[ ! ${CARGO_TERM_COLOR} ]]; then
-- 
2.41.0




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR
  2024-01-23 19:43         ` orbea
@ 2024-01-24 18:59           ` orbea
  0 siblings, 0 replies; 11+ messages in thread
From: orbea @ 2024-01-24 18:59 UTC (permalink / raw)
  To: gentoo-dev

On Tue, 23 Jan 2024 11:43:13 -0800
orbea <orbea@riseup.net> wrote:

> On Tue, 23 Jan 2024 17:48:25 +0100
> Michał Górny <mgorny@gentoo.org> wrote:
> 
> > On Tue, 2024-01-23 at 06:13 -0800, orbea wrote:  
> > > On Tue, 23 Jan 2024 04:48:02 +0100
> > > Michał Górny <mgorny@gentoo.org> wrote:
> > >     
> > > > On Mon, 2024-01-22 at 19:32 -0800, orbea wrote:    
> > > > > This is required when cargo_live_src_unpack needs to be find a
> > > > > Cargo.toml file in a directory other than ${S}
> > > > > 
> > > > > Signed-off-by: orbea <orbea@riseup.net>
> > > > > ---
> > > > >  eclass/cargo.eclass | 11 ++++++++++-
> > > > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
> > > > > index 3bdbb5e3ec64..692623382c56 100644
> > > > > --- a/eclass/cargo.eclass
> > > > > +++ b/eclass/cargo.eclass
> > > > > @@ -116,6 +116,15 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
> > > > >  # other src_functions of this eclass.
> > > > >  # Note that cargo_gen_config is automatically called by
> > > > > cargo_src_unpack. 
> > > > > +# @ECLASS_VARIABLE: CARGO_TOML_DIR
> > > > > +# @DEFAULT_UNSET
> > > > > +# @DESCRIPTION:
> > > > > +# Optional variable containing the directory path to the
> > > > > Cargo.toml file. +# Should be defined before calling
> > > > > cargo_live_src_unpack. +#
> > > > > +# This is required for live ebuilds when Cargo.toml in a
> > > > > directory other +# than ${S}.
> > > > > +
> > > > >  # @ECLASS_VARIABLE: myfeatures
> > > > >  # @DEFAULT_UNSET
> > > > >  # @DESCRIPTION:
> > > > > @@ -403,7 +412,7 @@ cargo_live_src_unpack() {
> > > > >  		umask "${EVCS_UMASK}" || die "Bad options to
> > > > > umask: ${EVCS_UMASK}" fi
> > > > >  
> > > > > -	pushd "${S}" > /dev/null || die
> > > > > +	pushd "${CARGO_TOML_DIR:-$S}" > /dev/null || die
> > > > >  
> > > > 
> > > > Please respect the current variable style.    
> > > 
> > > Sorry for being dense, but could you elaborate what you mean?
> > >     
> > 
> > You changed '${S}' to '$S' which goes against the established style.
> >   
> 
> Thanks for spelling that out, I corrected the patch.
> 
> -------------
> 
> This is required when cargo_live_src_unpack needs to be find a
> Cargo.toml file in a directory other than ${S}. This may happen in
> cases where the package has a rust component within a subdirectory
> where the program otherwise use another language.
> 
> Signed-off-by: orbea <orbea@riseup.net>
> ---
>  eclass/cargo.eclass | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
> index 3bdbb5e3ec64..f88b3b82d8ed 100644
> --- a/eclass/cargo.eclass
> +++ b/eclass/cargo.eclass
> @@ -116,6 +116,15 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
>  # other src_functions of this eclass.
>  # Note that cargo_gen_config is automatically called by
> cargo_src_unpack. 
> +# @ECLASS_VARIABLE: CARGO_TOML_DIR
> +# @DEFAULT_UNSET
> +# @DESCRIPTION:
> +# Optional variable containing the directory path to the Cargo.toml
> file. +# Should be defined before calling cargo_live_src_unpack.
> +#
> +# This is required for live ebuilds when Cargo.toml in a directory
> other +# than ${S}.
> +
>  # @ECLASS_VARIABLE: myfeatures
>  # @DEFAULT_UNSET
>  # @DESCRIPTION:
> @@ -403,7 +412,7 @@ cargo_live_src_unpack() {
>  		umask "${EVCS_UMASK}" || die "Bad options to umask:
> ${EVCS_UMASK}" fi
>  
> -	pushd "${S}" > /dev/null || die
> +	pushd "${CARGO_TOML_DIR:-${S}}" > /dev/null || die
>  
>  	# Respect user settings before cargo_gen_config is called.
>  	if [[ ! ${CARGO_TERM_COLOR} ]]; then

On second thought maybe this patch is not necessary? A trivial
workaround is to just set ${S} for cargo_live_src_unpack, for example...

  S="${S}"/path/to/rust/dir \
  cargo_live_src_unpack

Would this be something that is future proof or is it better to have a
dedicated variable to handle it?



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-01-24 18:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 16:14 [gentoo-dev] [PATCH] profiles: workaround sandbox bug with getcwd() configure test (gl_cv_func_getcwd_path_max) Sam James
2024-01-22 16:35 ` David Seifert
2024-01-22 16:45 ` [gentoo-dev] " Arsen Arsenović
2024-01-23  3:32 ` [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR orbea
2024-01-23  3:48   ` Michał Górny
2024-01-23 14:13     ` orbea
2024-01-23 16:48       ` Michał Górny
2024-01-23 19:43         ` orbea
2024-01-24 18:59           ` orbea
2024-01-23  4:06   ` Eli Schwartz
2024-01-23 14:11     ` orbea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox