* [PATCH v2] meta: Enable cross-compilation by default
@ 2024-11-29 11:21 Anton Mikanovich
2024-11-29 11:30 ` 'Jan Kiszka' via isar-users
0 siblings, 1 reply; 3+ messages in thread
From: Anton Mikanovich @ 2024-11-29 11:21 UTC (permalink / raw)
To: isar-users; +Cc: Anton Mikanovich
Make cross-compilation to be default mode if no ISAR_CROSS_COMPILE
value was set or local.conf.sample from meta-isar was used.
This will speedup the build with default settings.
Also fix CI and kas logic to address those changes.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
Changes since v1:
- Fix testsuite cross compile setting logic.
- Fix kas cross compile setting logic.
- Update source headers.
RECIPE-API-CHANGELOG.md | 9 +++++++++
kas/opt/Kconfig | 10 +++++++++-
kas/opt/nocrosscompile.yaml | 11 +++++++++++
meta-isar/conf/local.conf.sample | 4 ++--
meta/classes/crossvars.bbclass | 2 +-
testsuite/cibuilder.py | 10 +++++++++-
6 files changed, 41 insertions(+), 5 deletions(-)
create mode 100644 kas/opt/nocrosscompile.yaml
diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index deb1c4e1..f310553a 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -693,3 +693,12 @@ Previous implementation still can be selected by setting in local.conf:
PREFERRED_PROVIDER_bootstrap-host ?= "isar-bootstrap-host"
PREFERRED_PROVIDER_bootstrap-target ?= "isar-bootstrap-target"
+
+### Cross-compilation is enabled by default
+
+Default ISAR_CROSS_COMPILE value was changed to "1".
+There is no more need to set global ISAR_CROSS_COMPILE = "1" in local.conf to
+enable cross-compilation. Otherwize ISAR_CROSS_COMPILE = "0" now should be set
+in local.conf to disable cross-compilation for all the recipes.
+Sample local.conf from meta-isar used by isar-init-build-env is also changed
+to enable cross-compilation by default.
diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index b1b1ff16..3ae921bd 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -1,8 +1,11 @@
# This software is a part of ISAR.
-# Copyright (C) 2023 ilbers GmbH
+# Copyright (C) 2023-2024 ilbers GmbH
+# Copyright (C) 2024 Siemens AG
#
# Authors:
# Uladzimir Bely <ubely@ilbers.de>
+#
+# SPDX-License-Identifier: MIT
menu "Mirror selection"
depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || DEBIAN_TRIXIE || DEBIAN_SID || UBUNTU_FOCAL || UBUNTU_JAMMY
@@ -154,6 +157,11 @@ config KAS_INCLUDE_ISAR_CROSS_COMPILE
default "kas/opt/crosscompile.yaml"
depends on ISAR_CROSS_COMPILE
+config KAS_INCLUDE_NO_ISAR_CROSS_COMPILE
+ string
+ default "kas/opt/nocrosscompile.yaml"
+ depends on !ISAR_CROSS_COMPILE
+
config USE_CCACHE
bool "Use ccache during build"
diff --git a/kas/opt/nocrosscompile.yaml b/kas/opt/nocrosscompile.yaml
new file mode 100644
index 00000000..99713e1e
--- /dev/null
+++ b/kas/opt/nocrosscompile.yaml
@@ -0,0 +1,11 @@
+# This software is a part of ISAR.
+# Copyright (C) 2024 ilbers GmbH
+#
+# SPDX-License-Identifier: MIT
+
+header:
+ version: 14
+
+local_conf_header:
+ nocrosscompile: |
+ ISAR_CROSS_COMPILE = "0"
diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index 14cac313..fffe5e6a 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -157,8 +157,8 @@ IMAGE_INSTALL:remove:qemuamd64-sb = "example-module-${KERNEL_NAME}"
IMAGE_INSTALL:append:qemuamd64-sb = " example-module-signed-${KERNEL_NAME}"
#
-# Enable cross-compilation support
-ISAR_CROSS_COMPILE ?= "0"
+# Uncomment this to disable cross-compilation support
+#ISAR_CROSS_COMPILE ?= "0"
#
# Uncomment to enable 32-bit compat architecture support
diff --git a/meta/classes/crossvars.bbclass b/meta/classes/crossvars.bbclass
index 00326c9a..7bd7ab94 100644
--- a/meta/classes/crossvars.bbclass
+++ b/meta/classes/crossvars.bbclass
@@ -1,7 +1,7 @@
# This software is a part of ISAR.
# Copyright (C) 2022 ilbers GmbH
-ISAR_CROSS_COMPILE ??= "0"
+ISAR_CROSS_COMPILE ??= "1"
inherit compat
diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index 9fa3d86c..b5b6a093 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -1,4 +1,10 @@
#!/usr/bin/env python3
+#
+# This software is a part of ISAR.
+# Copyright (C) 2022-2024 ilbers GmbH
+# Copyright (C) 2022-2024 Siemens AG
+#
+# SPDX-License-Identifier: MIT
import logging
import os
@@ -168,7 +174,9 @@ class CIBuilder(Test):
f.write('ISAR_ENABLE_COMPAT_ARCH:arm64 = "1"\n')
f.write('IMAGE_INSTALL:remove:arm64 = "hello-isar"\n')
f.write('IMAGE_INSTALL:append:arm64 = " hello-isar-compat"\n')
- if cross:
+ if not cross:
+ f.write('ISAR_CROSS_COMPILE = "0"\n')
+ else:
f.write('ISAR_CROSS_COMPILE = "1"\n')
f.write(
'IMAGE_INSTALL:append:hikey = '
--
2.34.1
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20241129112112.2108215-1-amikan%40ilbers.de.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] meta: Enable cross-compilation by default
2024-11-29 11:21 [PATCH v2] meta: Enable cross-compilation by default Anton Mikanovich
@ 2024-11-29 11:30 ` 'Jan Kiszka' via isar-users
2024-11-29 11:56 ` Anton Mikanovich
0 siblings, 1 reply; 3+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2024-11-29 11:30 UTC (permalink / raw)
To: Anton Mikanovich, isar-users
On 29.11.24 19:21, Anton Mikanovich wrote:
> Make cross-compilation to be default mode if no ISAR_CROSS_COMPILE
> value was set or local.conf.sample from meta-isar was used.
> This will speedup the build with default settings.
>
The reason to cross-compile is clear, and I suspect - but have no hard
data - that most downstream users are actually setting
ISAR_CROSS_COMPILE to 1 today. Still, those that don't will see this
change, probably more likely as broken builds than faster compilation.
The original motivation to keep this default-off is that this is also in
line with upstream Debian (except that upstream will not build via qemu
then). I'm not sure yet what is the best option, I'm only wondering what
your deeper thoughts were.
Jan
> Also fix CI and kas logic to address those changes.
>
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
> Changes since v1:
> - Fix testsuite cross compile setting logic.
> - Fix kas cross compile setting logic.
> - Update source headers.
>
> RECIPE-API-CHANGELOG.md | 9 +++++++++
> kas/opt/Kconfig | 10 +++++++++-
> kas/opt/nocrosscompile.yaml | 11 +++++++++++
> meta-isar/conf/local.conf.sample | 4 ++--
> meta/classes/crossvars.bbclass | 2 +-
> testsuite/cibuilder.py | 10 +++++++++-
> 6 files changed, 41 insertions(+), 5 deletions(-)
> create mode 100644 kas/opt/nocrosscompile.yaml
>
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index deb1c4e1..f310553a 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -693,3 +693,12 @@ Previous implementation still can be selected by setting in local.conf:
>
> PREFERRED_PROVIDER_bootstrap-host ?= "isar-bootstrap-host"
> PREFERRED_PROVIDER_bootstrap-target ?= "isar-bootstrap-target"
> +
> +### Cross-compilation is enabled by default
> +
> +Default ISAR_CROSS_COMPILE value was changed to "1".
> +There is no more need to set global ISAR_CROSS_COMPILE = "1" in local.conf to
> +enable cross-compilation. Otherwize ISAR_CROSS_COMPILE = "0" now should be set
> +in local.conf to disable cross-compilation for all the recipes.
> +Sample local.conf from meta-isar used by isar-init-build-env is also changed
> +to enable cross-compilation by default.
> diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
> index b1b1ff16..3ae921bd 100644
> --- a/kas/opt/Kconfig
> +++ b/kas/opt/Kconfig
> @@ -1,8 +1,11 @@
> # This software is a part of ISAR.
> -# Copyright (C) 2023 ilbers GmbH
> +# Copyright (C) 2023-2024 ilbers GmbH
> +# Copyright (C) 2024 Siemens AG
> #
> # Authors:
> # Uladzimir Bely <ubely@ilbers.de>
> +#
> +# SPDX-License-Identifier: MIT
>
> menu "Mirror selection"
> depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || DEBIAN_TRIXIE || DEBIAN_SID || UBUNTU_FOCAL || UBUNTU_JAMMY
> @@ -154,6 +157,11 @@ config KAS_INCLUDE_ISAR_CROSS_COMPILE
> default "kas/opt/crosscompile.yaml"
> depends on ISAR_CROSS_COMPILE
>
> +config KAS_INCLUDE_NO_ISAR_CROSS_COMPILE
> + string
> + default "kas/opt/nocrosscompile.yaml"
> + depends on !ISAR_CROSS_COMPILE
> +
>
> config USE_CCACHE
> bool "Use ccache during build"
> diff --git a/kas/opt/nocrosscompile.yaml b/kas/opt/nocrosscompile.yaml
> new file mode 100644
> index 00000000..99713e1e
> --- /dev/null
> +++ b/kas/opt/nocrosscompile.yaml
> @@ -0,0 +1,11 @@
> +# This software is a part of ISAR.
> +# Copyright (C) 2024 ilbers GmbH
> +#
> +# SPDX-License-Identifier: MIT
> +
> +header:
> + version: 14
> +
> +local_conf_header:
> + nocrosscompile: |
> + ISAR_CROSS_COMPILE = "0"
> diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
> index 14cac313..fffe5e6a 100644
> --- a/meta-isar/conf/local.conf.sample
> +++ b/meta-isar/conf/local.conf.sample
> @@ -157,8 +157,8 @@ IMAGE_INSTALL:remove:qemuamd64-sb = "example-module-${KERNEL_NAME}"
> IMAGE_INSTALL:append:qemuamd64-sb = " example-module-signed-${KERNEL_NAME}"
>
> #
> -# Enable cross-compilation support
> -ISAR_CROSS_COMPILE ?= "0"
> +# Uncomment this to disable cross-compilation support
> +#ISAR_CROSS_COMPILE ?= "0"
>
> #
> # Uncomment to enable 32-bit compat architecture support
> diff --git a/meta/classes/crossvars.bbclass b/meta/classes/crossvars.bbclass
> index 00326c9a..7bd7ab94 100644
> --- a/meta/classes/crossvars.bbclass
> +++ b/meta/classes/crossvars.bbclass
> @@ -1,7 +1,7 @@
> # This software is a part of ISAR.
> # Copyright (C) 2022 ilbers GmbH
>
> -ISAR_CROSS_COMPILE ??= "0"
> +ISAR_CROSS_COMPILE ??= "1"
>
> inherit compat
>
> diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
> index 9fa3d86c..b5b6a093 100755
> --- a/testsuite/cibuilder.py
> +++ b/testsuite/cibuilder.py
> @@ -1,4 +1,10 @@
> #!/usr/bin/env python3
> +#
> +# This software is a part of ISAR.
> +# Copyright (C) 2022-2024 ilbers GmbH
> +# Copyright (C) 2022-2024 Siemens AG
> +#
> +# SPDX-License-Identifier: MIT
>
> import logging
> import os
> @@ -168,7 +174,9 @@ class CIBuilder(Test):
> f.write('ISAR_ENABLE_COMPAT_ARCH:arm64 = "1"\n')
> f.write('IMAGE_INSTALL:remove:arm64 = "hello-isar"\n')
> f.write('IMAGE_INSTALL:append:arm64 = " hello-isar-compat"\n')
> - if cross:
> + if not cross:
> + f.write('ISAR_CROSS_COMPILE = "0"\n')
> + else:
> f.write('ISAR_CROSS_COMPILE = "1"\n')
> f.write(
> 'IMAGE_INSTALL:append:hikey = '
--
Siemens AG, Technology
Linux Expert Center
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/dbae243d-a6d7-47f3-82f9-a948cd3363f6%40siemens.com.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] meta: Enable cross-compilation by default
2024-11-29 11:30 ` 'Jan Kiszka' via isar-users
@ 2024-11-29 11:56 ` Anton Mikanovich
0 siblings, 0 replies; 3+ messages in thread
From: Anton Mikanovich @ 2024-11-29 11:56 UTC (permalink / raw)
To: Jan Kiszka, isar-users
29/11/2024 13:30, Jan Kiszka wrote:
> On 29.11.24 19:21, Anton Mikanovich wrote:
>> Make cross-compilation to be default mode if no ISAR_CROSS_COMPILE
>> value was set or local.conf.sample from meta-isar was used.
>> This will speedup the build with default settings.
>>
> The reason to cross-compile is clear, and I suspect - but have no hard
> data - that most downstream users are actually setting
> ISAR_CROSS_COMPILE to 1 today. Still, those that don't will see this
> change, probably more likely as broken builds than faster compilation.
Just like any other change mentioned in RECIPE-API-CHANGELOG.md this should
be taking into account when updating to the newer Isar version.
> The original motivation to keep this default-off is that this is also in
> line with upstream Debian (except that upstream will not build via qemu
> then). I'm not sure yet what is the best option, I'm only wondering what
> your deeper thoughts were.
My motivation was to improve user experience with default settings when Isar
is using manually with source->bitbake running scheme. I think anyone
who used
it like that experienced slow builds forgetting to set cross compile one
day.
> Jan
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/ad24f71a-0cb6-4259-8a90-4ece75806b0e%40ilbers.de.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-29 11:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-29 11:21 [PATCH v2] meta: Enable cross-compilation by default Anton Mikanovich
2024-11-29 11:30 ` 'Jan Kiszka' via isar-users
2024-11-29 11:56 ` Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox