Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow unknown operation system build #7398

Closed

Conversation

gportay
Copy link
Contributor

@gportay gportay commented May 28, 2024

Dear Maintainers,

I faces an issue if I cross-compile the project for OpenEmbedded from a Debian build system, with python.

I get the following:

error: option --install-layout not recognized

The configure script guesses the target system from the host if no --with-os= is set. It is untrue if cross-compiling.

Setting an operation system that is unsupported (i.e. not fedora, not redhat not suse, not debian or not gentoo) raises an error:

configure: error: Illegal value -unknown- for option --with-os

In some circumstances, it is preferable to ignore an unsupported operation system and just do nothing.

This (second) patch adds the operation system unknown to avoid the configure script to guess for which operating system the project is build for; this also improve the incomplete output:

configure: Detected operating system type:
configure: Build with  config

Regards,
Gaël

Copy link
Member

@pbrezina pbrezina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thank you for your contribution. CI failures are not related and they should disappear with rebase. Ack.

Copy link
Contributor

@thalman thalman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks

@alexey-tikhonov
Copy link
Member

@gportay, hi.

Could you please rebase?

The commit e6ae55d has added the debian
operating system, but the help string does not reflect it yet.

This adds the missing debian entry in the help string.

See:

	gportay@archlinux ~/src/sssd $ ./configure --help | grep -A1 with-os
	  --with-os=OS_TYPE       Type of your operation system
	                          (fedora|redhat|suse|debian|gentoo)

Signed-off-by: Gaël PORTAY <[email protected]>
There are various operating systems in the world, and there are even
more if considering the embedded world.

Trying to detect all of them is hardwork and unnecessary.

If the host operating system is uncaught, the configure succeeds with
the following incomplete output:

	./configure
	(...)
	configure: Detected operating system type:
	configure: Build with  config
	---------------------^^

This enables the operating system "unknown" to remove the error raised
and to allow setting a system that is the short list.

It allows the use for options --with-os=unknown or --with-os=arch that
are a often more representative if the operating system is not in the
short list.

It turns:

	./configure --with-os=unknown
	(...)
	configure: error: Illegal value -unknown- for option --with-os

Into:

	./configure --with-os=unknown
	configure: Detected operating system type: unknown
	configure: Build with unknown config

Also, it avoids the assumption the target operating system is the same
as host if cross-compiling, and leads to errors.

For example, the commit e6ae55d passes
the downstream debian option --install-layout=deb to setup.py and raises
an error if targetting a non-debian world (such as openembedded).

Fixes:

	error: option --install-layout not recognized

Signed-off-by: Gaël PORTAY <[email protected]>
@gportay gportay force-pushed the allow-unknown-operation-system-build branch from 81cfeb7 to 56b3200 Compare June 3, 2024 13:03
@gportay
Copy link
Contributor Author

gportay commented Jun 3, 2024

@gportay, hi.

Could you please rebase?

done.

@thalman
Copy link
Contributor

thalman commented Jun 3, 2024

looks good (the same) after rebase 👍

@alexey-tikhonov alexey-tikhonov added the Ready to push Ready to push label Jun 3, 2024
@alexey-tikhonov
Copy link
Member

Pushed PR: #7398

  • master
    • 7b32dc0 - Allow unknown operation system build
    • 46fbc49 - Add missing debian operation system in help string

gportay added a commit to gportay/meta-security that referenced this pull request Oct 21, 2024
The configure script guesses the target system from the host if no
--with-os= is set[1]. It is untrue if cross-compiling.

The guessed host operating system is used then to do specific things
fort target build.

The commit[2] passes the downstream debian option --install-layout=deb
to setup.py[3] if the host system is debian based, and thus, it raises
the error attached below as that debian-specific option[4] is not part
of the openembedded[5] world.

This sets the Fedora operating system thanks to the existing configure
option --with-os=fedora, that is relatively sain operating system for
the needs of openembedded.

Fixes:

	| (...)/build/tmp/work/aarch64-poky-linux/sssd/2.5.2-r0/build/src/config/setup.py:25: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
	|   from distutils.core import setup
	| usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
	|    or: setup.py --help [cmd1 cmd2 ...]
	|    or: setup.py --help-commands
	|    or: setup.py cmd --help
	|
	| error: option --install-layout not recognized

	| Traceback (most recent call last):
	|   File "/home/gportay/src/openembedded-tests/build/tmp/work/core2-64-poky-linux/sssd/2.9.2/build/src/config/setup.py", line 25, in <module>
	|     from distutils.core import setup
	| ModuleNotFoundError: No module named 'distutils'

Note: Upstream has introduced the "unknown" operating systemd with the
upcoming version 2.10.0[6][7]. The change can be backported.

[1]: https://github.com/SSSD/sssd/blob/2.5.2/src/external/platform.m4#L1-L31
[2]: SSSD/sssd@e6ae55d
[3]: https://github.com/SSSD/sssd/blob/2.5.2/Makefile.am#L32-L35
[4]: https://sources.debian.org/patches/setuptools/68.1.2-2/install-layout.diff/#L7
[5]: https://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3-setuptools_59.5.0.bb?h=kirkstone
[6]: SSSD/sssd@7b32dc0
[7]: SSSD/sssd#7398

Signed-off-by: Gaël PORTAY <[email protected]>
doanac pushed a commit to lmp-mirrors/meta-security that referenced this pull request Nov 4, 2024
The configure script guesses the target system from the host if no
--with-os= is set[1]. It is untrue if cross-compiling.

The guessed host operating system is used then to do specific things
fort target build.

The commit[2] passes the downstream debian option --install-layout=deb
to setup.py[3] if the host system is debian based, and thus, it raises
the error attached below as that debian-specific option[4] is not part
of the openembedded[5] world.

This sets the Fedora operating system thanks to the existing configure
option --with-os=fedora, that is relatively sain operating system for
the needs of openembedded.

Fixes:

	| (...)/build/tmp/work/aarch64-poky-linux/sssd/2.5.2-r0/build/src/config/setup.py:25: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
	|   from distutils.core import setup
	| usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
	|    or: setup.py --help [cmd1 cmd2 ...]
	|    or: setup.py --help-commands
	|    or: setup.py cmd --help
	|
	| error: option --install-layout not recognized

	| Traceback (most recent call last):
	|   File "/home/gportay/src/openembedded-tests/build/tmp/work/core2-64-poky-linux/sssd/2.9.2/build/src/config/setup.py", line 25, in <module>
	|     from distutils.core import setup
	| ModuleNotFoundError: No module named 'distutils'

Note: Upstream has introduced the "unknown" operating systemd with the
upcoming version 2.10.0[6][7]. The change can be backported.

[1]: https://github.com/SSSD/sssd/blob/2.5.2/src/external/platform.m4#L1-L31
[2]: SSSD/sssd@e6ae55d
[3]: https://github.com/SSSD/sssd/blob/2.5.2/Makefile.am#L32-L35
[4]: https://sources.debian.org/patches/setuptools/68.1.2-2/install-layout.diff/#L7
[5]: https://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3-setuptools_59.5.0.bb?h=kirkstone
[6]: SSSD/sssd@7b32dc0
[7]: SSSD/sssd#7398

Signed-off-by: Gaël PORTAY <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
offa pushed a commit to jhnc-oss/meta-security that referenced this pull request Nov 25, 2024
The configure script guesses the target system from the host if no
--with-os= is set[1]. It is untrue if cross-compiling.

The guessed host operating system is used then to do specific things
fort target build.

The commit[2] passes the downstream debian option --install-layout=deb
to setup.py[3] if the host system is debian based, and thus, it raises
the error attached below as that debian-specific option[4] is not part
of the openembedded[5] world.

This sets the Fedora operating system thanks to the existing configure
option --with-os=fedora, that is relatively sain operating system for
the needs of openembedded.

Fixes:

	| (...)/build/tmp/work/aarch64-poky-linux/sssd/2.5.2-r0/build/src/config/setup.py:25: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
	|   from distutils.core import setup
	| usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
	|    or: setup.py --help [cmd1 cmd2 ...]
	|    or: setup.py --help-commands
	|    or: setup.py cmd --help
	|
	| error: option --install-layout not recognized

	| Traceback (most recent call last):
	|   File "/home/gportay/src/openembedded-tests/build/tmp/work/core2-64-poky-linux/sssd/2.9.2/build/src/config/setup.py", line 25, in <module>
	|     from distutils.core import setup
	| ModuleNotFoundError: No module named 'distutils'

Note: Upstream has introduced the "unknown" operating systemd with the
upcoming version 2.10.0[6][7]. The change can be backported.

[1]: https://github.com/SSSD/sssd/blob/2.5.2/src/external/platform.m4#L1-L31
[2]: SSSD/sssd@e6ae55d
[3]: https://github.com/SSSD/sssd/blob/2.5.2/Makefile.am#L32-L35
[4]: https://sources.debian.org/patches/setuptools/68.1.2-2/install-layout.diff/#L7
[5]: https://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3-setuptools_59.5.0.bb?h=kirkstone
[6]: SSSD/sssd@7b32dc0
[7]: SSSD/sssd#7398

Signed-off-by: Gaël PORTAY <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
daregit pushed a commit to daregit/yocto-combined that referenced this pull request Nov 25, 2024
The configure script guesses the target system from the host if no
--with-os= is set[1]. It is untrue if cross-compiling.

The guessed host operating system is used then to do specific things
fort target build.

The commit[2] passes the downstream debian option --install-layout=deb
to setup.py[3] if the host system is debian based, and thus, it raises
the error attached below as that debian-specific option[4] is not part
of the openembedded[5] world.

This sets the Fedora operating system thanks to the existing configure
option --with-os=fedora, that is relatively sain operating system for
the needs of openembedded.

Fixes:

	| (...)/build/tmp/work/aarch64-poky-linux/sssd/2.5.2-r0/build/src/config/setup.py:25: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
	|   from distutils.core import setup
	| usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
	|    or: setup.py --help [cmd1 cmd2 ...]
	|    or: setup.py --help-commands
	|    or: setup.py cmd --help
	|
	| error: option --install-layout not recognized

	| Traceback (most recent call last):
	|   File "/home/gportay/src/openembedded-tests/build/tmp/work/core2-64-poky-linux/sssd/2.9.2/build/src/config/setup.py", line 25, in <module>
	|     from distutils.core import setup
	| ModuleNotFoundError: No module named 'distutils'

Note: Upstream has introduced the "unknown" operating systemd with the
upcoming version 2.10.0[6][7]. The change can be backported.

[1]: https://github.com/SSSD/sssd/blob/2.5.2/src/external/platform.m4#L1-L31
[2]: SSSD/sssd@e6ae55d
[3]: https://github.com/SSSD/sssd/blob/2.5.2/Makefile.am#L32-L35
[4]: https://sources.debian.org/patches/setuptools/68.1.2-2/install-layout.diff/#L7
[5]: https://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3-setuptools_59.5.0.bb?h=kirkstone
[6]: SSSD/sssd@7b32dc0
[7]: SSSD/sssd#7398

Signed-off-by: Gaël PORTAY <gael.portay+rtonegmail.com>
Signed-off-by: Armin Kuster <akuster808gmail.com>
daregit pushed a commit to daregit/yocto-combined that referenced this pull request Nov 25, 2024
The configure script guesses the target system from the host if no
--with-os= is set[1]. It is untrue if cross-compiling.

The guessed host operating system is used then to do specific things
fort target build.

The commit[2] passes the downstream debian option --install-layout=deb
to setup.py[3] if the host system is debian based, and thus, it raises
the error attached below as that debian-specific option[4] is not part
of the openembedded[5] world.

This sets the Fedora operating system thanks to the existing configure
option --with-os=fedora, that is relatively sain operating system for
the needs of openembedded.

Fixes:

	| (...)/build/tmp/work/aarch64-poky-linux/sssd/2.5.2-r0/build/src/config/setup.py:25: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
	|   from distutils.core import setup
	| usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
	|    or: setup.py --help [cmd1 cmd2 ...]
	|    or: setup.py --help-commands
	|    or: setup.py cmd --help
	|
	| error: option --install-layout not recognized

	| Traceback (most recent call last):
	|   File "/home/gportay/src/openembedded-tests/build/tmp/work/core2-64-poky-linux/sssd/2.9.2/build/src/config/setup.py", line 25, in <module>
	|     from distutils.core import setup
	| ModuleNotFoundError: No module named 'distutils'

Note: Upstream has introduced the "unknown" operating systemd with the
upcoming version 2.10.0[6][7]. The change can be backported.

[1]: https://github.com/SSSD/sssd/blob/2.5.2/src/external/platform.m4#L1-L31
[2]: SSSD/sssd@e6ae55d
[3]: https://github.com/SSSD/sssd/blob/2.5.2/Makefile.am#L32-L35
[4]: https://sources.debian.org/patches/setuptools/68.1.2-2/install-layout.diff/#L7
[5]: https://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3-setuptools_59.5.0.bb?h=kirkstone
[6]: SSSD/sssd@7b32dc0
[7]: SSSD/sssd#7398

Signed-off-by: Gaël PORTAY <gael.portay+rtonegmail.com>
Signed-off-by: Armin Kuster <akuster808gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport This should go to target branch only. Pushed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants