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

Dependency name method producing unexpected results #12967

Open
lijenicol opened this issue Mar 13, 2024 · 1 comment · Fixed by #12972 · May be fixed by #13671
Open

Dependency name method producing unexpected results #12967

lijenicol opened this issue Mar 13, 2024 · 1 comment · Fixed by #12972 · May be fixed by #13671

Comments

@lijenicol
Copy link

Describe the bug
When using the dep.name() method, I get different results depending on whether the dependency was resolved via pkg-config, or through using the fallback subproject wrap.

For example: Running atk_dep.name() results in dep124727815663152 when atk_dep is coming from a subproject wrap file. Running the same method results in atk when atk_dep is resolved from pkg-config. In this case, I would expect atk_dep.name() to always return atk - is that a correct assumption to make? I don't think this is just an atk issue, so I thought it best to post it here.

To reproduce

This is a basic case using the atk lib:

  • Add meson.build:
project('depNameError', 'c')
atk_dep = dependency('atk', fallback : ['atk', 'libatk_dep'])
message(atk_dep.name())
  • Build/install atk, and put it on the PKG_CONFIG_PATH
  • Run meson setup build, and you'll see the message "atk"
  • Remove atk from the PKG_CONFIG_PATH
  • Add subprojects/atk.wrap:
[wrap-git]
directory=atk
url=https://gitlab.gnome.org/GNOME/atk.git
push-url=git@gitlab.gnome.org:GNOME/atk.git
revision=master
  • Run meson setup build, and you'll see a message like "dep124727815663152"

System parameters

  • python --version: 3.10.12
  • meson --version: 1.3.2
dcbaker added a commit to dcbaker/meson that referenced this issue Mar 13, 2024
Otherwise internal dependencies have auto-generated names that are not
human readable. Instead, use the name that the dependency overrides. For
example:

```meson
meson.override_dependency('zlib', declare_dependency())
dep_zlib = dependency('zlib')
assert(dep_zlib.name() == 'zlib')
```

Fixes: mesonbuild#12967
dcbaker added a commit to dcbaker/meson that referenced this issue Mar 13, 2024
Otherwise internal dependencies have auto-generated names that are not
human readable. Instead, use the name that the dependency overrides. For
example:

```meson
meson.override_dependency('zlib', declare_dependency())
dep_zlib = dependency('zlib')
assert(dep_zlib.name() == 'zlib')
```

Fixes: mesonbuild#12967
dcbaker added a commit to dcbaker/meson that referenced this issue Mar 13, 2024
Otherwise internal dependencies have auto-generated names that are not
human readable. Instead, use the name that the dependency overrides. For
example:

```meson
meson.override_dependency('zlib', declare_dependency())
dep_zlib = dependency('zlib')
assert(dep_zlib.name() == 'zlib')
```

Fixes: mesonbuild#12967
dcbaker added a commit that referenced this issue Mar 15, 2024
Otherwise internal dependencies have auto-generated names that are not
human readable. Instead, use the name that the dependency overrides. For
example:

```meson
meson.override_dependency('zlib', declare_dependency())
dep_zlib = dependency('zlib')
assert(dep_zlib.name() == 'zlib')
```

Fixes: #12967
soumyaDghosh pushed a commit to soumyaDghosh/meson that referenced this issue Jun 4, 2024
Otherwise internal dependencies have auto-generated names that are not
human readable. Instead, use the name that the dependency overrides. For
example:

```meson
meson.override_dependency('zlib', declare_dependency())
dep_zlib = dependency('zlib')
assert(dep_zlib.name() == 'zlib')
```

Fixes: mesonbuild#12967
dcbaker added a commit to dcbaker/meson that referenced this issue Sep 12, 2024
Otherwise internal dependencies have auto-generated names that are not
human readable. Instead, use the name that the dependency overrides. For
example:

```meson
meson.override_dependency('zlib', declare_dependency())
dep_zlib = dependency('zlib')
assert(dep_zlib.name() == 'zlib')
```

Fixes: mesonbuild#12967
@eli-schwartz
Copy link
Member

Reopened by #13387

@eli-schwartz eli-schwartz reopened this Sep 12, 2024
dcbaker added a commit to dcbaker/meson that referenced this issue Sep 12, 2024
Otherwise internal dependencies have auto-generated names that are not
human readable. Instead, use the name that the dependency overrides. For
example:

```meson
meson.override_dependency('zlib', declare_dependency())
dep_zlib = dependency('zlib')
assert(dep_zlib.name() == 'zlib')
```

Fixes: mesonbuild#12967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants