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

gpsd: build fails as of missing python distutils.sysconfig #10993

Closed
SvenRoederer opened this issue Jan 12, 2020 · 7 comments · Fixed by #11040
Closed

gpsd: build fails as of missing python distutils.sysconfig #10993

SvenRoederer opened this issue Jan 12, 2020 · 7 comments · Fixed by #11040

Comments

@SvenRoederer
Copy link
Contributor

Maintainer: @psidhu @p-wassi
Environment: OpenWrt master (around 1.1.2020); mvebu-cortexa9

Description: building gpsd fails with a missing dependency to python module distutils.sysconfig

scons: Reading SConscript files ...
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.7/distutils/__init__.py):
  File "/mnt/local/btrfs/build/freifunk/ffberlin/firmware/openwrt/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/gpsd-3.19/SConstruct", line 46:
    from distutils import sysconfig
make[3]: *** [Makefile:148: /mnt/local/btrfs/build/freifunk/ffberlin/firmware/openwrt/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/gpsd-3.19/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 2
make[3]: Leaving directory '/mnt/local/btrfs/build/freifunk/ffberlin/firmware/packages/packages/utils/gpsd'
time: package/feeds/packages/gpsd/compile#0.42#0.10#0.51
make[2]: *** [package/Makefile:113: package/feeds/packages/gpsd/compile] Error 2

Installing the python-module via the hosts apt-get fixes the build, but this seems not the way to go.

@SvenRoederer SvenRoederer changed the title gpsd: build fails as of missing python distutils.setuptools gpsd: build fails as of missing python distutils.sysconfig Jan 12, 2020
@neheb
Copy link
Contributor

neheb commented Jan 14, 2020

ping @commodo , @RussellSenior

@jefferyto
Copy link
Member

The error came from the SConstruct file, which means it was run by scons.

AFAIK the scons package depends on buildhost Python, not host Python provided by the python package.

Your buildhost, it has distutils installed (in /usr/lib/python3.7/distutils) but not the sysconfig.py file (/usr/lib/python3.7/distutils/sysconfig.py)? What distro / OS version are you using?

@SvenRoederer
Copy link
Contributor Author

I'm running Debian 10.2 with small packageset installed, so "python3-distutils" wasn't installed at all.

@jefferyto
Copy link
Member

I've set up a minimal Debian 10.2 VM and it has python3.7-minimal, which only has __init__.py and version.py inside /usr/lib/python3.7/distutils.

I've tried compiling the gpsd package (using a snapshot sdk), but before it can get to it, the host scons package throws an error:

./files/pywrap.sh /home/jeff/ath79/build_dir/hostpkg/scons-3.1.1/setup.py install --prefix=/home/jeff/ath79/staging_dir/host
Traceback (most recent call last):
  File "/home/jeff/ath79/build_dir/hostpkg/scons-3.1.1/setup.py", line 26, in <module>
    import distutils.command.build_scripts
ModuleNotFoundError: No module named 'distutils.command'

How did you manage to install host scons without full distutils?

@SvenRoederer
Copy link
Contributor Author

Probably scons was built once I had "python3-distutils" installed when tracing down the build-error. Not sure if I build all from scratch then ...

@SvenRoederer
Copy link
Contributor Author

@jefferyto You are right. I started the build from scratch and have now scons failing to build.

make[3]: Entering directory '/mnt/local/btrfs/build/freifunk/ffberlin/firmware/packages/packages/devel/scons'
./files/pywrap.sh /mnt/local/btrfs/build/freifunk/ffberlin/firmware/openwrt/build_dir/hostpkg/scons-3.1.1/setup.py install --prefix=/mnt/local/btrfs/build/freifunk/ffberlin/firmware/openwrt/staging_dir/host
Traceback (most recent call last):
  File "/mnt/local/btrfs/build/freifunk/ffberlin/firmware/openwrt/build_dir/hostpkg/scons-3.1.1/setup.py", line 26, in <module>
    import distutils.command.build_scripts
ModuleNotFoundError: No module named 'distutils.command'
make[3]: *** [Makefile:56: /mnt/local/btrfs/build/freifunk/ffberlin/firmware/openwrt/staging_dir/hostpkg/stamp/.scons_installed] Error 1
make[3]: Leaving directory '/mnt/local/btrfs/build/freifunk/ffberlin/firmware/packages/packages/devel/scons'
time: package/feeds/packages/scons/host-compile#0.25#0.13#0.36
make[2]: *** [package/Makefile:111: package/feeds/packages/scons/host/compile] Error 2

jefferyto added a commit to jefferyto/openwrt-packages that referenced this issue Jan 16, 2020
New patches (both for SConstruct):

* Do not import from distutils. Since Python support/modules are not
  built, there is no need to import from distutils. (Importing from
  distutils may prevent the package from being built on systems without
  a full distutils module, e.g. Debian with python3-minimal.)

  I have added back the import in places where it may be helpful to
  have, if scons is run manually.

  Fixes openwrt#10993.

* Do not check the size of time_t. The way this is done is to compile
  and run a test program; this fails when cross-compiling[1].

  This doesn't appear to affect any functionality (other than missing a
  compile-time warning that things will fail in 2038 if time_t is too
  small).

[1]: https://gitlab.com/gpsd/gpsd/issues/48

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
@SvenRoederer
Copy link
Contributor Author

@jefferyto thanks for taking care.

jow- pushed a commit to openwrt/openwrt that referenced this issue Aug 21, 2021
Debian and Ubuntu ship a python3-minimal package which does not include
the distutils module. This is not supported by upstream and can be
considered a broken python distribution.

In practice, many scripts depend on said module, and this is a reoccuring
pain point for building various OpenWrt packages.

Require and check for said module, enough time has been wasted on this.

A list of just the most recent issues:
openwrt/packages#16304
openwrt/packages#16027
openwrt/packages#15443
openwrt/packages#14394
openwrt/packages#12909
openwrt/packages#12443
openwrt/packages#11035
openwrt/packages#10993

Signed-off-by: Andre Heider <a.heider@gmail.com>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this issue Aug 21, 2021
Debian and Ubuntu ship a python3-minimal package which does not include
the distutils module. This is not supported by upstream and can be
considered a broken python distribution.

In practice, many scripts depend on said module, and this is a reoccuring
pain point for building various OpenWrt packages.

Require and check for said module, enough time has been wasted on this.

A list of just the most recent issues:
openwrt/packages#16304
openwrt/packages#16027
openwrt/packages#15443
openwrt/packages#14394
openwrt/packages#12909
openwrt/packages#12443
openwrt/packages#11035
openwrt/packages#10993

Signed-off-by: Andre Heider <a.heider@gmail.com>
Boos4721 pushed a commit to Boos4721/openwrt that referenced this issue Aug 22, 2021
Debian and Ubuntu ship a python3-minimal package which does not include
the distutils module. This is not supported by upstream and can be
considered a broken python distribution.

In practice, many scripts depend on said module, and this is a reoccuring
pain point for building various OpenWrt packages.

Require and check for said module, enough time has been wasted on this.

A list of just the most recent issues:
openwrt/packages#16304
openwrt/packages#16027
openwrt/packages#15443
openwrt/packages#14394
openwrt/packages#12909
openwrt/packages#12443
openwrt/packages#11035
openwrt/packages#10993

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: boos4721 <3.1415926535boos@gmail.com>
jow- pushed a commit to openwrt/openwrt that referenced this issue Aug 29, 2021
Debian and Ubuntu ship a python3-minimal package which does not include
the distutils module. This is not supported by upstream and can be
considered a broken python distribution.

In practice, many scripts depend on said module, and this is a reoccuring
pain point for building various OpenWrt packages.

Require and check for said module, enough time has been wasted on this.

A list of just the most recent issues:
openwrt/packages#16304
openwrt/packages#16027
openwrt/packages#15443
openwrt/packages#14394
openwrt/packages#12909
openwrt/packages#12443
openwrt/packages#11035
openwrt/packages#10993

Signed-off-by: Andre Heider <a.heider@gmail.com>
(cherry picked from commit 60af8d7)
maurerr pushed a commit to maurerr/openwrt that referenced this issue Sep 1, 2021
Debian and Ubuntu ship a python3-minimal package which does not include
the distutils module. This is not supported by upstream and can be
considered a broken python distribution.

In practice, many scripts depend on said module, and this is a reoccuring
pain point for building various OpenWrt packages.

Require and check for said module, enough time has been wasted on this.

A list of just the most recent issues:
openwrt/packages#16304
openwrt/packages#16027
openwrt/packages#15443
openwrt/packages#14394
openwrt/packages#12909
openwrt/packages#12443
openwrt/packages#11035
openwrt/packages#10993

Signed-off-by: Andre Heider <a.heider@gmail.com>
Boos4721 pushed a commit to Boos4721/openwrt that referenced this issue Jan 30, 2022
Debian and Ubuntu ship a python3-minimal package which does not include
the distutils module. This is not supported by upstream and can be
considered a broken python distribution.

In practice, many scripts depend on said module, and this is a reoccuring
pain point for building various OpenWrt packages.

Require and check for said module, enough time has been wasted on this.

A list of just the most recent issues:
openwrt/packages#16304
openwrt/packages#16027
openwrt/packages#15443
openwrt/packages#14394
openwrt/packages#12909
openwrt/packages#12443
openwrt/packages#11035
openwrt/packages#10993

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: boos4721 <3.1415926535boos@gmail.com>
Boos4721 pushed a commit to Boos4721/openwrt that referenced this issue Jan 30, 2022
Debian and Ubuntu ship a python3-minimal package which does not include
the distutils module. This is not supported by upstream and can be
considered a broken python distribution.

In practice, many scripts depend on said module, and this is a reoccuring
pain point for building various OpenWrt packages.

Require and check for said module, enough time has been wasted on this.

A list of just the most recent issues:
openwrt/packages#16304
openwrt/packages#16027
openwrt/packages#15443
openwrt/packages#14394
openwrt/packages#12909
openwrt/packages#12443
openwrt/packages#11035
openwrt/packages#10993

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: boos4721 <3.1415926535boos@gmail.com>
ArtelMike pushed a commit to ArtelMike/openwrt-1 that referenced this issue Jan 31, 2023
Debian and Ubuntu ship a python3-minimal package which does not include
the distutils module. This is not supported by upstream and can be
considered a broken python distribution.

In practice, many scripts depend on said module, and this is a reoccuring
pain point for building various OpenWrt packages.

Require and check for said module, enough time has been wasted on this.

A list of just the most recent issues:
openwrt/packages#16304
openwrt/packages#16027
openwrt/packages#15443
openwrt/packages#14394
openwrt/packages#12909
openwrt/packages#12443
openwrt/packages#11035
openwrt/packages#10993

Signed-off-by: Andre Heider <a.heider@gmail.com>
(cherry picked from commit af77e67)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants