Open denizzzka opened 4 years ago
https://github.com/Rogni/MesonDBug
(apps) mak@mak-HP-ProBook-450-G5 ~/Desktop/Dlang/RaceBug $ meson build && ninja -C build -j2
The Meson build system
Version: 0.53.0
Source dir: /home/mak/Рабочий стол/Dlang/RaceBug
Build dir: /home/mak/Рабочий стол/Dlang/RaceBug/build
Build type: native build
Project name: RaceBugTest
Project version: undefined
Host machine cpu family: x86_64
Host machine cpu: x86_64
D compiler for the host machine: ldc2 (llvm 1.8.0 "LDC - the LLVM D compiler (1.8.0):")
D linker for the host machine: ldc2 GNU ld.bfd 2.30
Program python3 found: YES (/home/mak/projects/venvs/apps/bin/python3)
Build targets in project: 1
Found ninja-1.9.0.git.kitware.dyndep-1.jobserver-1 at /home/mak/projects/venvs/apps/bin/ninja
ninja: Entering directory `build'
[1/4] Compiling D object 'program@exe/d_main.d.o'.
FAILED: program@exe/d_main.d.o
ldc2 -I=program@exe -I=. -I=.. -enable-color -wi -g -d-debug -of='program@exe/d_main.d.o' -c ../d/main.d
../d/main.d(1): Error: module test_struct is in file 'test_struct.d' which cannot be read
import path[0] = /usr/include/d
import path[1] = /usr/lib/ldc/x86_64-linux-gnu/include/d/ldc
import path[2] = /usr/lib/ldc/x86_64-linux-gnu/include/d
import path[3] = program@exe
import path[4] = .
import path[5] = ..
[2/4] Generating 'program@exe/test_struct.d'.
ninja: build stopped: subcommand failed.
(apps) mak@mak-HP-ProBook-450-G5 ~/Desktop/Dlang/RaceBug $ ninja -C build -j2
ninja: Entering directory `build'
[3/3] Linking target program.
reproduced for D lang. in cpp it's ok
meson --version
0.53.0ninja --version
1.9.0.git.kitware.dyndep-1.jobserver-1tried use generated sources as dependency - same problem. how to use generated sources?
generated/meson.build
python = import('python').find_installation('python3')
gen = generator(python,
output : '@BASENAME@.d',
arguments : [
meson.source_root()/'gen.py',
'@INPUT@',
'@OUTPUT@',
'd'
])
gen_src = gen.process(meson.source_root()/'test_struct.json')
generated_lib_dep = declare_dependency(
sources: gen_src
)
meson.build
add_languages('d')
subdir('generated')
executable('program_d',
['main.d'],
dependencies: [generated_lib_dep]
)
log
(apps) mak@mak-HP-ProBook-450-G5 ~/Desktop/Dlang/RaceBug $ rm build -rf && meson build && ninja -C build -j8
The Meson build system
Version: 0.53.1
Source dir: /home/mak/Рабочий стол/Dlang/RaceBug
Build dir: /home/mak/Рабочий стол/Dlang/RaceBug/build
Build type: native build
Project name: RaceBugTest
Project version: undefined
Host machine cpu family: x86_64
Host machine cpu: x86_64
D compiler for the host machine: ldc2 (llvm 1.8.0 "LDC - the LLVM D compiler (1.8.0):")
D linker for the host machine: ldc2 GNU ld.bfd 2.30
Program python3 found: YES (/home/mak/projects/venvs/apps/bin/python3)
Build targets in project: 1
Found ninja-1.9.0.git.kitware.dyndep-1.jobserver-1 at /home/mak/projects/venvs/apps/bin/ninja
ninja: Entering directory `build'
[1/4] Compiling D object 'd/18ac3e7@@program_d@exe/main.d.o'.
FAILED: d/18ac3e7@@program_d@exe/main.d.o
ldc2 -I=d/18ac3e7@@program_d@exe -I=d -I=../d -enable-color -wi -g -d-debug -of='d/18ac3e7@@program_d@exe/main.d.o' -c ../d/main.d
../d/main.d(3): Error: module test_struct is in file 'test_struct.d' which cannot be read
import path[0] = /usr/include/d
import path[1] = /usr/lib/ldc/x86_64-linux-gnu/include/d/ldc
import path[2] = /usr/lib/ldc/x86_64-linux-gnu/include/d
import path[3] = d/18ac3e7@@program_d@exe
import path[4] = d
import path[5] = ../d
[2/4] Generating 'd/18ac3e7@@program_d@exe/test_struct.d'.
ninja: build stopped: subcommand failed.
(apps) mak@mak-HP-ProBook-450-G5 ~/Desktop/Dlang/RaceBug $ ninja -C build -j8
ninja: Entering directory `build'
[3/3] Linking target d/program_d.
This problem is still here, catched it again.
This problem is still here
upd: problem still here on ~master ee46c0242f97501672c0bd6312498c464370cbeb at 4 Jul 2021
Or you just can run single-process ninja -j 1 and build always will be sucessfull.
No, and in case of "-j1" there may be same error. There is no way to get rid of this issue - only a few launches with different -j parameters can help to override it.
Please add "bug" label
Project with ~1000 source files (https://github.com/denizzzka/d_c_arm_test) It contains some generator and uses it for parsing
.dpp
files into.d
(D language).Usually
ninja
run fails - compiler complains what generated filegpio.d
used byapp.d
isn't found (library() function what usesapp.d
also usesprocess()
result what createsgpio.d
). But then afterninja
exit this filegpio.d
can be found at appropriate place. And if I runninja
again build always sucessfull.Or you just can run single-process
ninja -j 1
and build always will be sucessfull.Here is piece of generated
ninja.build
related to filegpio.d
what becomes not found sometimes. I only yesterday began to learn ninja syntax but it looks like here is no any dependency what should inform compiler about fact what generator is done its job andapp.d
compilation (what assumesgpio.d
inclusion through-I
) can be started:Generator:
Parser and its result usage:
system parameters
Is this a cross build or just a plain native build (for the same computer)? Cross, but I think this is not related to build type
what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) Debian
what Python version are you using e.g. 3.8.0 Python 3.7.3
what
meson --version
0.53.1what
ninja --version
if it's a Ninja build 1.10.0