question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Latest Meson + tags raises exception when used with dir created by prev. Meson version

See original GitHub issue

Describe the bug

Creating a build dir with previous version of Meson, and then using on that dir meson install --tags foo with newer Meson results in exception:

Traceback (most recent call last):
  File "/home/constantine/Projects/meson/mesonbuild/mesonmain.py", line 228, in run
    return options.run_func(options)
  File "/home/constantine/Projects/meson/mesonbuild/minstall.py", line 747, in run
    installer.do_install(datafilename)
  File "/home/constantine/Projects/meson/mesonbuild/minstall.py", line 538, in do_install
    self.install_targets(d, dm, destdir, fullprefix)
  File "/home/constantine/Projects/meson/mesonbuild/minstall.py", line 634, in install_targets
    if not self.should_install(t):
  File "/home/constantine/Projects/meson/mesonbuild/minstall.py", line 381, in should_install
    if self.tags and d.tag not in self.tags:
AttributeError: 'TargetInstallData' object has no attribute 'tag'

To Reproduce

In steps, I use meson of latest released version 0.59.1 and ~/Projects/meson/meson.py which is the latest in-development Meson at commit 87e13af1c85c03

 λ cat meson.build
project(
  'test',
  ['c'],
)

subdir('bar/')
 λ cat bar/meson.build
executable(
  'bar',
  ['test.c'],
  install: true
)
 λ cat bar/test.c
int main() {}
 λ meson build
The Meson build system
Version: 0.59.1
Source dir: /tmp/foo
Build dir: /tmp/foo/build
Build type: native build
Project name: test
Project version: undefined
C compiler for the host machine: ccache cc (gcc 11.1.0 "cc (GCC) 11.1.0")
C linker for the host machine: cc ld.bfd 2.36.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Build targets in project: 1

Found ninja-1.10.2 at /usr/bin/ninja
 λ cd build
 λ ~/Projects/meson/meson.py install --tags foo
ninja: Entering directory `/tmp/foo/build'
[2/2] Linking target bar/bar
Traceback (most recent call last):
  File "/home/constantine/Projects/meson/mesonbuild/mesonmain.py", line 228, in run
    return options.run_func(options)
  File "/home/constantine/Projects/meson/mesonbuild/minstall.py", line 747, in run
    installer.do_install(datafilename)
  File "/home/constantine/Projects/meson/mesonbuild/minstall.py", line 538, in do_install
    self.install_targets(d, dm, destdir, fullprefix)
  File "/home/constantine/Projects/meson/mesonbuild/minstall.py", line 634, in install_targets
    if not self.should_install(t):
  File "/home/constantine/Projects/meson/mesonbuild/minstall.py", line 381, in should_install
    if self.tags and d.tag not in self.tags:
AttributeError: 'TargetInstallData' object has no attribute 'tag'

Expected behavior

No exception

system parameters

  • Is this a cross build or just a plain native build ? Native
  • OS: Archlinux
  • Python version: 3.9.6
  • meson --version: 0.59.1 and Meson at commit 87e13af1c85c03
  • ninja --version: 1.10.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
xclaessecommented, Sep 15, 2021

@Hi-Angel It’s always appreciated when people test dev version of course! When using meson from git, you could often have to use meson --wipe builddir to reconfigure from scratch, it will preserve the option you have set when configuring your project but delete everything from your build directory.

We cannot track incompatible changes for each commit in meson master, but I made a PR to at least consider the dev version to be a major break, which should cover this specific niche case.

0reactions
eli-schwartzcommented, Sep 15, 2021

Detecting when people mix release and dev versions does indeed seem like an improvement on the status quo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

meson/msetup.py at master · mesonbuild/meson - GitHub
raise MesonException (. 'Cannot find cmd_line.txt. This is probably because this '. 'build directory was configured with a meson version < 0.49.0.').
Read more >
Release 0.60.0 - The Meson Build system
unset_variable() can be used to unset a variable. Reading a variable after calling unset_variable() will raise an exception unless the variable is set...
Read more >
problem building gst-python, pygobject on Windows using ...
I'm trying to build gstreamer with gst-python and pygobject. When I do the meson build, I get the following for gst-python and pygobject:...
Read more >
Packaging Guide — Spack 0.20.0.dev0 documentation
This section describes how packages need to be named, and where they live in Spack's directory structure. In general, Creating new packages handles...
Read more >
picolibc - keithp.com
I decided to see how hard it would be to run some of the tests provided in the GNU C Library (glibc). Parallel...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found