Skip to content

Error with join_path() and a single argument #12843

Closed

Description

@mbridon

Describe the bug
A clear and concise description of what the bug is.

I wrote this in my meson.build:

icondir = join_paths('icons', '16x16')
install_data(join_paths(icondir, 'cangjie.png'),
    install_dir: join_paths(icondir),
    rename: 'cangjie.png')

That was a mistake, because I didn't even realize I was trying to join a path with nothing, yet the name join kind of indicates it should work on several things... 🤦

To Reproduce

The file is here: https://gitlab.freedesktop.org/cangjie/ibus-cangjie/-/blob/bochecha/meson-attempt/data/meson.build?ref_type=heads

Expected behavior
A clear and concise description of what you expected to happen.

I sort of expected meson to error out because I didn't respect its expectations (the function needing multiple arguments and my passing only one), what I did not expect was this:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/mesonbuild/mesonmain.py", line 194, in run
    return options.run_func(options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/mesonbuild/msetup.py", line 358, in run
    app.generate()
  File "/usr/lib/python3.12/site-packages/mesonbuild/msetup.py", line 181, in generate
    return self._generate(env, capture, vslite_ctx)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/mesonbuild/msetup.py", line 243, in _generate
    self.finalize_postconf_hooks(b, intr)
  File "/usr/lib/python3.12/site-packages/mesonbuild/msetup.py", line 311, in finalize_postconf_hooks
    mod.postconf_hook(b)
  File "/usr/lib/python3.12/site-packages/mesonbuild/modules/python.py", line 433, in postconf_hook
    b.install_scripts.extend(self._get_install_scripts())
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/mesonbuild/modules/python.py", line 389, in _get_install_scripts
    installdata = backend.create_install_data()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/mesonbuild/backend/backends.py", line 1659, in create_install_data
    self.generate_target_install(d)
  File "/usr/lib/python3.12/site-packages/mesonbuild/backend/backends.py", line 1821, in generate_target_install
    i = TargetInstallData(f, outdir, outdir_name,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 14, in __init__
  File "/usr/lib/python3.12/site-packages/mesonbuild/backend/backends.py", line 156, in __post_init__
    outdir_name = os.path.join('{prefix}', self.outdir)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 90, in join
  File "<frozen genericpath>", line 164, in _check_arg_types
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'NoneType'

ERROR: Unhandled python exception

    This is a Meson bug and should be reported!

system parameters
This the unmodified meson Fedora package:
meson-1.3.1-1.fc39.noarch

  • Is this a cross build or just a plain native build (for the same computer)?
    This is not a cross build
  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
    Fedora 39
  • what Python version are you using e.g. 3.8.0
    python3-3.12.1-2.fc39.x86_64
  • what meson --version
    1.3.1
  • what ninja --version if it's a Ninja build
    1.11.1

Activity

  1. added 3 commits that reference this issue on Feb 15, 2024
    aa5c205
    0de3b64
    2e842bd
  2. mbridon commented on Feb 22, 2024

    @mbridon
    Author

    I see you committed your code @dcbaker, should we now close the issue? 🤔

  3. dcbaker commented on Feb 22, 2024

    @dcbaker
    Member

    I went ahead and merged the fix, thanks for reminding me

  4. added a commit that references this issue on Feb 23, 2024
    bc46ea2
  5. added a commit that references this issue on Jun 4, 2024
    dc56b2f
  6. added a commit that references this issue on May 1, 2025
    73f69dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions