mesonbuild/meson

Unhandled exception / bad error message "is not a target" for subproject as link dependency

Open

#3,787 opened on Jun 24, 2018

View on GitHub
 (8 comments) (1 reaction) (0 assignees)Python (4,978 stars) (1,465 forks)batch import
bugexceptiongood first issueparser/interpreter

Description

foo = subproject('foo')
bar = library('bar', ['bar.cpp'],
    link_with: [foo])

meson build afterwards returns the following error:

mqudsi@ZBook /m/c/U/M/g/blocklevel> ninja -v -C build
ninja: Entering directory `build'
[1/1] /usr/bin/python3.6 /usr/local/bin/meson --internal regenerate /mnt/c/Users/Mahmoud/git/blocklevel /mnt/c/Users/Mahmoud/git/blocklevel/build --backend ninja
The Meson build system
Version: 0.46.0
Source dir: /mnt/c/Users/Mahmoud/git/blocklevel
Build dir: /mnt/c/Users/Mahmoud/git/blocklevel/build
Build type: native build
Project name: Blocklevel
Native C++ compiler: sc++ (clang 7.0.0 "clang version 7.0.0- (trunk)")
Appending CXXFLAGS from environment: '-march=native -msse4a -mfma -D_GLIBCXX_USE_CXX11_ABI'
Appending CPPFLAGS from environment: '-march=native -msse4a -mfma -D_GLIBCXX_USE_CXX11_ABI'
Build machine cpu family: x86_64
Build machine cpu: x86_64

|
|Executing subproject nst-log.
|
|Project name: nst-log
|Native C++ compiler: sc++ (clang 7.0.0 "clang version 7.0.0- (trunk)")
|Appending CXXFLAGS from environment: '-march=native -msse4a -mfma -D_GLIBCXX_USE_CXX11_ABI'
|Appending CPPFLAGS from environment: '-march=native -msse4a -mfma -D_GLIBCXX_USE_CXX11_ABI'
|Build targets in project: 1
|
|Subproject nst-log finished.

|
|Executing subproject rwlock.
|
|Project name: rwlock
|Native C++ compiler: sc++ (clang 7.0.0 "clang version 7.0.0- (trunk)")
|Appending CXXFLAGS from environment: '-march=native -msse4a -mfma -D_GLIBCXX_USE_CXX11_ABI'
|Appending CPPFLAGS from environment: '-march=native -msse4a -mfma -D_GLIBCXX_USE_CXX11_ABI'
|Build targets in project: 2
|
|Subproject rwlock finished.

|
|Executing subproject pevents.
|
|Project name: pevents
|Native C++ compiler: sc++ (clang 7.0.0 "clang version 7.0.0- (trunk)")
|Appending CXXFLAGS from environment: '-march=native -msse4a -mfma -D_GLIBCXX_USE_CXX11_ABI'
|Appending CPPFLAGS from environment: '-march=native -msse4a -mfma -D_GLIBCXX_USE_CXX11_ABI'
|Dependency threads found: YES
|Build targets in project: 9
|
|Subproject pevents finished.

meson.build:10:0: ERROR:  <mesonbuild.interpreter.Interpreter object at 0x7f74eaabad68> is not a target.

EDIT

In case it needs to be said: I know what I did wrong, I'm not complaining that this code doesn't work, etc. etc. I'm reporting that this user error should be handled more gracefully and with an appropriate error message such as Subproject 'foo' cannot be directly used as a link dependency. or whatever.

Contributor guide