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

Weird behavior non-existent variables and the ninja log #729

Open
mathstuf opened this issue Apr 3, 2014 · 3 comments
Open

Weird behavior non-existent variables and the ninja log #729

mathstuf opened this issue Apr 3, 2014 · 3 comments

Comments

@mathstuf
Copy link
Contributor

mathstuf commented Apr 3, 2014

I'm still tracking down the issue because it's a heisenbug, but here's some of the breadcrumbs:

With the following rule:

rule CXX_COMPILER
  depfile = $DEP_FILE
  deps = gcc
  command = /usr/lib64/ccache/c++   $DEFINES $FLAGS -MMD -MT $out -MF $DEP_FILE -o $out -c $in
  description = Building CXX object $out

Usage:

build cmake_order_depends_target_test-dlopen: phony
cmake_flags_target_test-dlopen_lang_CXX = -g -I/home/boeckb/code/sprokit/src/tests -I/home/boeckb/code/sprokit/src/src -Isrc    -fvisibility=hidden -std=c++98 -Wall -Wextra -Wabi -Wctor-dtor-privacy -Winit-self -Woverloaded-virtual -Wpointer-arith -Wstrict-null-sentinel -Wswitch-default -Wswitch-enum -Wformat=2 -Wcast-align -Wcast-qual -Wdouble-promotion -Wfloat-equal -fstrict-overflow -Wstrict-overflow=5 -Wshadow -Wnarrowing -Wnoexcept -Wlogical-op -Wmissing-braces -Wundef -Wunused-macros -O0 -pg -ftest-coverage -fprofile-arcs

build tests/sprokit/test/CMakeFiles/test-dlopen.dir/test_dlopen.cxx.o: CXX_COMPILER /home/boeckb/code/sprokit/src/tests/sprokit/test/test_dlopen.cxx || cmake_order_depends_target_test-dlopen
  DEFINES = $cmake_defines_target_test-dlopen_lang_CXX
  DEP_FILE = tests/sprokit/test/CMakeFiles/test-dlopen.dir/test_dlopen.cxx.o.d
  FLAGS = $cmake_flags_target_test-dlopen_lang_CXX
  OBJECT_DIR = tests/sprokit/test/CMakeFiles/test-dlopen.dir

Output:

% rm .ninja_*
% ninja -v test-dlopen
[0-1->0/1@?] : && /usr/lib64/ccache/c++   -g   tests/sprokit/test/CMakeFiles/test-dlopen.dir/test_dlopen.cxx.o  -o tests/bin/test-dlopen  -rdynamic -lboost_filesystem -lboost_system -ldl && :

If I comment out the DEFINES line (which uses an undefined variable), this happens:

% rm .ninja_*
% ninja -v test-dlopen
[1-1->0/2@?] /usr/lib64/ccache/c++    -g -I/home/boeckb/code/sprokit/src/tests -I/home/boeckb/code/sprokit/src/src -Isrc    -fvisibility=hidden -std=c++98 -Wall -Wextra -Wabi -Wctor-dtor-privacy -Winit-self -Woverloaded-virtual -Wpointer-arith -Wstrict-null-sentinel -Wswitch-default -Wswitch-enum -Wformat=2 -Wcast-align -Wcast-qual -Wdouble-promotion -Wfloat-equal -fstrict-overflow -Wstrict-overflow=5 -Wshadow -Wnarrowing -Wnoexcept -Wlogical-op -Wmissing-braces -Wundef -Wunused-macros -O0 -pg -ftest-coverage -fprofile-arcs -MMD -MT tests/sprokit/test/CMakeFiles/test-dlopen.dir/test_dlopen.cxx.o -MF tests/sprokit/test/CMakeFiles/test-dlopen.dir/test_dlopen.cxx.o.d -o tests/sprokit/test/CMakeFiles/test-dlopen.dir/test_dlopen.cxx.o -c /home/boeckb/code/sprokit/src/tests/sprokit/test/test_dlopen.cxx

However, if I run this multiple times without removing the .ninja_* files, it fluctuates between getting the flags and not getting the flags seemingly randomly.

@jonesmz

This comment was marked as abuse.

@mathstuf
Copy link
Contributor Author

mathstuf commented Feb 5, 2020

Not sure. I haven't seen anything that would fix this, but I haven't tested either.

@jonesmz

This comment was marked as abuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants