Skip to content

Bogus error if git dependencies has a slash in a branch name #15780

Description

@valpackett

Describe the bug

When git-to-git [patch."https://some.git.url"] sections are used in Cargo.toml, Meson's import of Cargo files explodes.

To Reproduce

project('testtest', 'rust', version: '0.1.0')
# the rest doesn't matter

Change Cargo.toml deps from

[dependencies]
adw = { version = "0.9", features = ["v1_8"], package = "libadwaita" }
gtk = { version = "0.11", features = ["gnome_49"], package = "gtk4" }

to e.g.

[dependencies]
adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", features = ["v1_8"], package = "libadwaita" }
gtk = { git = "https://github.com/valpackett/gtk4-rs", branch = "val/xsqkvtwpkqkz", features = ["gnome_49"], package = "gtk4" }

[patch."https://github.com/gtk-rs/gtk4-rs"]
gtk4 = { git = "https://github.com/valpackett/gtk4-rs", branch = "val/xsqkvtwpkqkz" }
gtk4-sys = { git = "https://github.com/valpackett/gtk4-rs", branch = "val/xsqkvtwpkqkz" }

run cargo update, and ninja -Cbuild (meson does a reconfigure due to detected Cargo changes)

ninja: entering directory 'build'
[1/1] Regenerating build files
The Meson build system
Version: 1.11.1
Source dir: /home/val/src/val/testtest
Build dir: /home/val/src/val/testtest/build
Build type: native build

../meson.build:1:0: ERROR: Directory key must be a name and not a path

I've only seen that error message mentioned in #9929 before.

Expected behavior

Well I didn't expect that to error.

I guess the patch support just didn't expect Git URLs at all…

system parameters

  • Is this a cross build or just a plain native build (for the same computer)? plain
  • what operating system Alpine/postmarketOS edge
  • what Python version are you using 3.13.12
  • what meson --version 1.11.1
  • what ninja --version 1.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions