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

Build failure with waf on Python 3.11 #11

Open
NexAdn opened this issue May 7, 2023 · 1 comment
Open

Build failure with waf on Python 3.11 #11

NexAdn opened this issue May 7, 2023 · 1 comment

Comments

@NexAdn
Copy link

NexAdn commented May 7, 2023

Related issue in audio-overlay: gentoo-audio/audio-overlay#531

During package testing for the Gentoo audio overlay I've experienced a build failure when using Python 3.11 to run waf:

'PYTHONHASHSEED=1' 'CCFLAGS=-march=native -O2 -pipe -Wodr -frecord-gcc-switches' 'LINKFLAGS=-march=native -O2 -pipe -Wodr -frecord-gcc-switches -march=native -O2 -pipe -Wodr -Wl,-O1 -Wl,--defsym=__gentoo_check_ldflags__=0' 'PKGCONFIG=x86_64-pc-linux-gnu-pkg-config' '/var/tmp/portage/media-plugins/bitrot-9999/work/bitrot-9999/waf' '--jobs=1' '--prefix=/usr' 'configure'
Waf: The wscript in '/var/tmp/portage/media-plugins/bitrot-9999/work/bitrot-9999' is unreadable
Traceback (most recent call last):
  File "/var/tmp/portage/media-plugins/bitrot-9999/work/bitrot-9999/.waf3-2.0.12-6cd57ca9068ebdd4dc6caef5723653c7/waflib/Scripting.py", line 102, in waf_entry_point
    set_main_module(wscript)
  File "/var/tmp/portage/media-plugins/bitrot-9999/work/bitrot-9999/.waf3-2.0.12-6cd57ca9068ebdd4dc6caef5723653c7/waflib/Scripting.py", line 142, in set_main_module
    Context.g_module=Context.load_module(file_path)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/media-plugins/bitrot-9999/work/bitrot-9999/.waf3-2.0.12-6cd57ca9068ebdd4dc6caef5723653c7/waflib/Context.py", line 349, in load_module
    code=Utils.readf(path,m='rU',encoding=encoding)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/media-plugins/bitrot-9999/work/bitrot-9999/.waf3-2.0.12-6cd57ca9068ebdd4dc6caef5723653c7/waflib/Utils.py", line 141, in readf
    with open(fname,m)as f:
         ^^^^^^^^^^^^^
ValueError: invalid mode: 'rUb'

I get the same issue when running waf outside of the packaging environment:

[nex@laptop bitrot]$ python3.11 waf configure
Waf: The wscript in '/home/nex/projects/bitrot' is unreadable
Traceback (most recent call last):
  File "/home/nex/projects/bitrot/.waf3-2.0.12-6cd57ca9068ebdd4dc6caef5723653c7/waflib/Scripting.py", line 102, in waf_entry_point
    set_main_module(wscript)
  File "/home/nex/projects/bitrot/.waf3-2.0.12-6cd57ca9068ebdd4dc6caef5723653c7/waflib/Scripting.py", line 142, in set_main_module
    Context.g_module=Context.load_module(file_path)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nex/projects/bitrot/.waf3-2.0.12-6cd57ca9068ebdd4dc6caef5723653c7/waflib/Context.py", line 349, in load_module
    code=Utils.readf(path,m='rU',encoding=encoding)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nex/projects/bitrot/.waf3-2.0.12-6cd57ca9068ebdd4dc6caef5723653c7/waflib/Utils.py", line 141, in readf
    with open(fname,m)as f:
         ^^^^^^^^^^^^^
ValueError: invalid mode: 'rUb'

I assume this might require either a waf update or adjustments in the wscript.

@grejppi
Copy link
Owner

grejppi commented May 8, 2023

Probably needs a waf update since Python 3.11 dropped the U mode. Feel free to open a PR!

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

No branches or pull requests

2 participants