Skip to content

pkgconf module when imported but unused breaks devenv #12032

Closed

Description

@dcbaker
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/mesonbuild/[mesonmain.py](http://mesonmain.py/)", line 194, in run
    return [options.run](http://options.run/)_func(options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/[mdevenv.py](http://mdevenv.py/)", line 166, in run
    devenv, varnames = get_env(b, dump_fmt)
                       ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/[mdevenv.py](http://mdevenv.py/)", line 70, in get_env
    env = i.get_env(env, default_fmt)
          ^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_env'
ERROR: Unhandled python exception
    This is a Meson bug and should be reported!

This happens because the pkg-config module will insert a None into a list that should not have None in it. I'm not sure why mypy/pyright don't complain about this.

Activity

  1. added this to the 1.2.1 milestone on Jul 25, 2023
  2. self-assigned this
    on Jul 25, 2023
  3. added 2 commits that reference this issue on Jul 25, 2023
    e4a5bea
    696e266
  4. eli-schwartz commented on Jul 25, 2023

    @eli-schwartz
    Member

    I'm not sure why mypy/pyright don't complain about this.

    None is the black hole of anything goes. Getting the entire codebase strict-optional compliant is a tough problem.

  5. added a commit that references this issue on Jul 25, 2023
    020610c
  6. added a commit that references this issue on Aug 7, 2023
    5a37895
  7. added a commit that references this issue on Aug 25, 2023
    a5081fe
  8. added a commit that references this issue on May 1, 2025
    a7f6cd8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions