public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] New bootstrap-prefix global USE-flag and patch to llvm.eclass
@ 2023-09-12 19:32 Alexey Sokolov
  2023-09-13  6:15 ` Fabian Groffen
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Sokolov @ 2023-09-12 19:32 UTC (permalink / raw)
  To: gentoo-dev, Michał Górny

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

Bug: https://bugs.gentoo.org/758167
Full PR is at https://github.com/gentoo/gentoo/pull/32730

Several LLVM packages require this early return, otherwise they fail to 
build on Darwin. I'll also need this USE-flag for 
sys-devel/clang-common, to distinguish between stage2 and stage3 of 
bootstrap-prefix.sh to configure clang differently.

-- 
Best regards,
Alexey "DarthGandalf" Sokolov

[-- Attachment #2: de2bd1abc3e5c7607413633d132c604c6a801802.patch --]
[-- Type: text/x-patch, Size: 3057 bytes --]

From de2bd1abc3e5c7607413633d132c604c6a801802 Mon Sep 17 00:00:00 2001
From: Alexey Sokolov <alexey+gentoo@asokolov.org>
Date: Mon, 11 Sep 2023 23:26:49 +0100
Subject: [PATCH] llvm.eclass: add global USE flag bootstrap-prefix

Mask it everywhere except for prefix profiles

Without this, stage2's LLVM packages fail to build.

Bug: https://bugs.gentoo.org/758167
Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org>
---
 eclass/llvm.eclass                | 7 +++++++
 profiles/base/use.mask            | 4 ++++
 profiles/features/prefix/use.mask | 4 ++++
 profiles/use.desc                 | 1 +
 4 files changed, 16 insertions(+)

diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass
index 8198650aad9a7..87c2cedb3a376 100644
--- a/eclass/llvm.eclass
+++ b/eclass/llvm.eclass
@@ -64,6 +64,8 @@ esac
 if [[ ! ${_LLVM_ECLASS} ]]; then
 _LLVM_ECLASS=1
 
+IUSE="bootstrap-prefix"
+
 # make sure that the versions installing straight into /usr/bin
 # are uninstalled
 DEPEND="!!sys-devel/llvm:0"
@@ -242,6 +244,11 @@ llvm_fix_tool_path() {
 llvm_pkg_setup() {
 	debug-print-function ${FUNCNAME} "${@}"
 
+	if use bootstrap-prefix; then
+		# AppleClang has unparseable version numbers, but it's irrelevant anyway
+		return
+	fi
+
 	if [[ ${MERGE_TYPE} != binary ]]; then
 		LLVM_SLOT=$(get_llvm_slot "${LLVM_MAX_SLOT}")
 
diff --git a/profiles/base/use.mask b/profiles/base/use.mask
index 1d4f5b92865df..cc86fde21097a 100644
--- a/profiles/base/use.mask
+++ b/profiles/base/use.mask
@@ -8,6 +8,10 @@
 # eudev is masked for removal
 eudev
 
+# Alexey Sokolov <alexey+gentoo@asokolov.org> (2023-09-11)
+# Only needed during bootstrap of prefix
+bootstrap-prefix
+
 # David Seifert <soap@gentoo.org> (2023-09-09)
 # EOL upstream in 2 months, causes major headaches for OpenSSL 1.1
 # masking. Removal on 2023-10-09.
diff --git a/profiles/features/prefix/use.mask b/profiles/features/prefix/use.mask
index 482ce57f04485..1f43ca23fd101 100644
--- a/profiles/features/prefix/use.mask
+++ b/profiles/features/prefix/use.mask
@@ -4,6 +4,10 @@
 # prefix USE flag should always be unmasked in prefix profiles
 -prefix
 
+# Alexey Sokolov <alexey+gentoo@asokolov.org> (2023-09-11)
+# Allow bootstrapping the prefix
+-bootstrap-prefix
+
 # USE flags inherited by the base/use.defaults file that shouldn't be in Prefix
 gpm
 
diff --git a/profiles/use.desc b/profiles/use.desc
index 6034f3bf6fc31..37c64f43759da 100644
--- a/profiles/use.desc
+++ b/profiles/use.desc
@@ -29,6 +29,7 @@ big-endian - Big-endian toolchain support
 bindist - Flag to enable or disable options for prebuilt (GRP) packages (eg. due to licensing issues)
 blas - Add support for the virtual/blas numerical library
 bluetooth - Enable Bluetooth Support
+bootstrap-prefix - !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for bootstrapping Gentoo Prefix
 branding - Enable Gentoo specific branding
 build - !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping [make stage1]
 bzip2 - Use the bzlib compression library

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

* Re: [gentoo-dev] New bootstrap-prefix global USE-flag and patch to llvm.eclass
  2023-09-12 19:32 [gentoo-dev] New bootstrap-prefix global USE-flag and patch to llvm.eclass Alexey Sokolov
@ 2023-09-13  6:15 ` Fabian Groffen
  2023-09-13  6:22   ` Sam James
  0 siblings, 1 reply; 4+ messages in thread
From: Fabian Groffen @ 2023-09-13  6:15 UTC (permalink / raw)
  To: gentoo-dev

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

On 12-09-2023 20:32:19 +0100, Alexey Sokolov wrote:
> Bug: https://bugs.gentoo.org/758167
> Full PR is at https://github.com/gentoo/gentoo/pull/32730
> 
> Several LLVM packages require this early return, otherwise they fail to 
> build on Darwin. I'll also need this USE-flag for 
> sys-devel/clang-common, to distinguish between stage2 and stage3 of 
> bootstrap-prefix.sh to configure clang differently.
> 
> -- 
> Best regards,
> Alexey "DarthGandalf" Sokolov

> From de2bd1abc3e5c7607413633d132c604c6a801802 Mon Sep 17 00:00:00 2001
> From: Alexey Sokolov <alexey+gentoo@asokolov.org>
> Date: Mon, 11 Sep 2023 23:26:49 +0100
> Subject: [PATCH] llvm.eclass: add global USE flag bootstrap-prefix
> 
> Mask it everywhere except for prefix profiles
> 
> Without this, stage2's LLVM packages fail to build.
> 
> Bug: https://bugs.gentoo.org/758167
> Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org>
> ---
>  eclass/llvm.eclass                | 7 +++++++
>  profiles/base/use.mask            | 4 ++++
>  profiles/features/prefix/use.mask | 4 ++++
>  profiles/use.desc                 | 1 +
>  4 files changed, 16 insertions(+)
> 
> diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass
> index 8198650aad9a7..87c2cedb3a376 100644
> --- a/eclass/llvm.eclass
> +++ b/eclass/llvm.eclass
> @@ -64,6 +64,8 @@ esac
>  if [[ ! ${_LLVM_ECLASS} ]]; then
>  _LLVM_ECLASS=1
>  
> +IUSE="bootstrap-prefix"
> +
>  # make sure that the versions installing straight into /usr/bin
>  # are uninstalled
>  DEPEND="!!sys-devel/llvm:0"
> @@ -242,6 +244,11 @@ llvm_fix_tool_path() {
>  llvm_pkg_setup() {
>  	debug-print-function ${FUNCNAME} "${@}"
>  
> +	if use bootstrap-prefix; then
> +		# AppleClang has unparseable version numbers, but it's irrelevant anyway
> +		return
> +	fi
> +

I might misunderstand this, but is this USE-flag supposed to be set only
during bootstrap, e.g. when host-provided Clang is used?  If so, would
it be possible to use has_version or something instead?

Thanks,
Fabian

>  	if [[ ${MERGE_TYPE} != binary ]]; then
>  		LLVM_SLOT=$(get_llvm_slot "${LLVM_MAX_SLOT}")
>  
> diff --git a/profiles/base/use.mask b/profiles/base/use.mask
> index 1d4f5b92865df..cc86fde21097a 100644
> --- a/profiles/base/use.mask
> +++ b/profiles/base/use.mask
> @@ -8,6 +8,10 @@
>  # eudev is masked for removal
>  eudev
>  
> +# Alexey Sokolov <alexey+gentoo@asokolov.org> (2023-09-11)
> +# Only needed during bootstrap of prefix
> +bootstrap-prefix
> +
>  # David Seifert <soap@gentoo.org> (2023-09-09)
>  # EOL upstream in 2 months, causes major headaches for OpenSSL 1.1
>  # masking. Removal on 2023-10-09.
> diff --git a/profiles/features/prefix/use.mask b/profiles/features/prefix/use.mask
> index 482ce57f04485..1f43ca23fd101 100644
> --- a/profiles/features/prefix/use.mask
> +++ b/profiles/features/prefix/use.mask
> @@ -4,6 +4,10 @@
>  # prefix USE flag should always be unmasked in prefix profiles
>  -prefix
>  
> +# Alexey Sokolov <alexey+gentoo@asokolov.org> (2023-09-11)
> +# Allow bootstrapping the prefix
> +-bootstrap-prefix
> +
>  # USE flags inherited by the base/use.defaults file that shouldn't be in Prefix
>  gpm
>  
> diff --git a/profiles/use.desc b/profiles/use.desc
> index 6034f3bf6fc31..37c64f43759da 100644
> --- a/profiles/use.desc
> +++ b/profiles/use.desc
> @@ -29,6 +29,7 @@ big-endian - Big-endian toolchain support
>  bindist - Flag to enable or disable options for prebuilt (GRP) packages (eg. due to licensing issues)
>  blas - Add support for the virtual/blas numerical library
>  bluetooth - Enable Bluetooth Support
> +bootstrap-prefix - !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for bootstrapping Gentoo Prefix
>  branding - Enable Gentoo specific branding
>  build - !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping [make stage1]
>  bzip2 - Use the bzlib compression library


-- 
Fabian Groffen
Gentoo on a different level

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

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

* Re: [gentoo-dev] New bootstrap-prefix global USE-flag and patch to llvm.eclass
  2023-09-13  6:15 ` Fabian Groffen
@ 2023-09-13  6:22   ` Sam James
  2023-09-13  7:41     ` Alexey Sokolov
  0 siblings, 1 reply; 4+ messages in thread
From: Sam James @ 2023-09-13  6:22 UTC (permalink / raw)
  To: gentoo-dev


Fabian Groffen <grobian@gentoo.org> writes:

> [[PGP Signed Part:Undecided]]
> On 12-09-2023 20:32:19 +0100, Alexey Sokolov wrote:
>> Bug: https://bugs.gentoo.org/758167
>> Full PR is at https://github.com/gentoo/gentoo/pull/32730
>> 
>> Several LLVM packages require this early return, otherwise they fail to 
>> build on Darwin. I'll also need this USE-flag for 
>> sys-devel/clang-common, to distinguish between stage2 and stage3 of 
>> bootstrap-prefix.sh to configure clang differently.
>> 
>> -- 
>> Best regards,
>> Alexey "DarthGandalf" Sokolov
>
>> From de2bd1abc3e5c7607413633d132c604c6a801802 Mon Sep 17 00:00:00 2001
>> From: Alexey Sokolov <alexey+gentoo@asokolov.org>
>> Date: Mon, 11 Sep 2023 23:26:49 +0100
>> Subject: [PATCH] llvm.eclass: add global USE flag bootstrap-prefix
>> 
>> Mask it everywhere except for prefix profiles
>> 
>> Without this, stage2's LLVM packages fail to build.
>> 
>> Bug: https://bugs.gentoo.org/758167
>> Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org>
>> ---
>>  eclass/llvm.eclass                | 7 +++++++
>>  profiles/base/use.mask            | 4 ++++
>>  profiles/features/prefix/use.mask | 4 ++++
>>  profiles/use.desc                 | 1 +
>>  4 files changed, 16 insertions(+)
>> 
>> diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass
>> index 8198650aad9a7..87c2cedb3a376 100644
>> --- a/eclass/llvm.eclass
>> +++ b/eclass/llvm.eclass
>> @@ -64,6 +64,8 @@ esac
>>  if [[ ! ${_LLVM_ECLASS} ]]; then
>>  _LLVM_ECLASS=1
>>  
>> +IUSE="bootstrap-prefix"
>> +
>>  # make sure that the versions installing straight into /usr/bin
>>  # are uninstalled
>>  DEPEND="!!sys-devel/llvm:0"
>> @@ -242,6 +244,11 @@ llvm_fix_tool_path() {
>>  llvm_pkg_setup() {
>>  	debug-print-function ${FUNCNAME} "${@}"
>>  
>> +	if use bootstrap-prefix; then
>> +		# AppleClang has unparseable version numbers, but it's irrelevant anyway
>> +		return
>> +	fi
>> +
>
> I might misunderstand this, but is this USE-flag supposed to be set only
> during bootstrap, e.g. when host-provided Clang is used?  If so, would
> it be possible to use has_version or something instead?

Another option is something I think we've done in the past - check
for use prefix and then some extra env var we set in the bootstrap
script.

I think I'd prefer either your idea or the one I just mention
to a USE, but I don't think I feel very strongly between any of it.

(but given mgorny isn't keen on the USE in the PR at
https://github.com/gentoo/gentoo/pull/32730,
that's a vote against it)

>
> Thanks,
> Fabian
>


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

* Re: [gentoo-dev] New bootstrap-prefix global USE-flag and patch to llvm.eclass
  2023-09-13  6:22   ` Sam James
@ 2023-09-13  7:41     ` Alexey Sokolov
  0 siblings, 0 replies; 4+ messages in thread
From: Alexey Sokolov @ 2023-09-13  7:41 UTC (permalink / raw)
  To: gentoo-dev

13.09.2023 07:22, Sam James пишет:
> 
> Fabian Groffen <grobian@gentoo.org> writes:
> 
>> [[PGP Signed Part:Undecided]]
>> On 12-09-2023 20:32:19 +0100, Alexey Sokolov wrote:
>>> Bug: https://bugs.gentoo.org/758167
>>> Full PR is at https://github.com/gentoo/gentoo/pull/32730
>>>
>>> Several LLVM packages require this early return, otherwise they fail to
>>> build on Darwin. I'll also need this USE-flag for
>>> sys-devel/clang-common, to distinguish between stage2 and stage3 of
>>> bootstrap-prefix.sh to configure clang differently.
>>>
>>> -- 
>>> Best regards,
>>> Alexey "DarthGandalf" Sokolov
>>
>>>  From de2bd1abc3e5c7607413633d132c604c6a801802 Mon Sep 17 00:00:00 2001
>>> From: Alexey Sokolov <alexey+gentoo@asokolov.org>
>>> Date: Mon, 11 Sep 2023 23:26:49 +0100
>>> Subject: [PATCH] llvm.eclass: add global USE flag bootstrap-prefix
>>>
>>> Mask it everywhere except for prefix profiles
>>>
>>> Without this, stage2's LLVM packages fail to build.
>>>
>>> Bug: https://bugs.gentoo.org/758167
>>> Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org>
>>> ---
>>>   eclass/llvm.eclass                | 7 +++++++
>>>   profiles/base/use.mask            | 4 ++++
>>>   profiles/features/prefix/use.mask | 4 ++++
>>>   profiles/use.desc                 | 1 +
>>>   4 files changed, 16 insertions(+)
>>>
>>> diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass
>>> index 8198650aad9a7..87c2cedb3a376 100644
>>> --- a/eclass/llvm.eclass
>>> +++ b/eclass/llvm.eclass
>>> @@ -64,6 +64,8 @@ esac
>>>   if [[ ! ${_LLVM_ECLASS} ]]; then
>>>   _LLVM_ECLASS=1
>>>   
>>> +IUSE="bootstrap-prefix"
>>> +
>>>   # make sure that the versions installing straight into /usr/bin
>>>   # are uninstalled
>>>   DEPEND="!!sys-devel/llvm:0"
>>> @@ -242,6 +244,11 @@ llvm_fix_tool_path() {
>>>   llvm_pkg_setup() {
>>>   	debug-print-function ${FUNCNAME} "${@}"
>>>   
>>> +	if use bootstrap-prefix; then
>>> +		# AppleClang has unparseable version numbers, but it's irrelevant anyway
>>> +		return
>>> +	fi
>>> +
>>
>> I might misunderstand this, but is this USE-flag supposed to be set only
>> during bootstrap, e.g. when host-provided Clang is used?  If so, would
>> it be possible to use has_version or something instead?
> 
> Another option is something I think we've done in the past - check
> for use prefix and then some extra env var we set in the bootstrap
> script.

Somehow I haven't thought about using extra env var, will try that, thanks.

We'll still need the USE-flag for sys-devel/clang-common because it will 
install different content with and without it, but that can be limited 
to a single package.

> 
> I think I'd prefer either your idea or the one I just mention
> to a USE, but I don't think I feel very strongly between any of it.
> 
> (but given mgorny isn't keen on the USE in the PR at
> https://github.com/gentoo/gentoo/pull/32730,
> that's a vote against it)
> 
>>
>> Thanks,
>> Fabian
>>
> 

-- 
Best regards,
Alexey "DarthGandalf" Sokolov



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

end of thread, other threads:[~2023-09-13  7:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-12 19:32 [gentoo-dev] New bootstrap-prefix global USE-flag and patch to llvm.eclass Alexey Sokolov
2023-09-13  6:15 ` Fabian Groffen
2023-09-13  6:22   ` Sam James
2023-09-13  7:41     ` Alexey Sokolov

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