build fails when cmake is called with -DCMAKE_BUILD_TYPE=Release
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c, cmake
- Domain
- build-system
Research direction
Start with src/test/accept.c and the CMake configuration that supplies its Release compiler flags; reproduce the failure by configuring rr with -DCMAKE_BUILD_TYPE=Release and building with verbose output. Done means the Release build completes without the unused-variable warnings being treated as errors.
Written by the indexing model from the issue text.
Description
While packaging rr, the problem is that in Release mode the -DNDEBUG is omitted, and the warning-as-error compilation flag is catching debug-only variable declarations.
A work-around is to give the additional argument -DCMAKE_C_FLAGS_RELEASE:STRING= to cmake.
(spew obtained with make VERBOSE=1)
When building with the Release mode:
building CMakeFiles/accept.dir/src/test/accept.c.o
/nix/store/vv90ccz0p6kyfasyhh1caxdjbrqdzqc1-cmake-2.8.11.2/bin/cmake -E cmake_progress_report /tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/CMakeFiles 2
[ 2%] Building C object CMakeFiles/accept.dir/src/test/accept.c.o
/nix/store/xnb0w1i2jdjv178j1y28q4bfn79b8xia-gcc-wrapper-4.8.2/bin/cc -pthread -O0 -g3 -Wall -Werror -m32 -Wstrict-prototypes -O3 -DNDEBUG -I/tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/include -o CMakeFiles/accept.dir/src/test/accept.c.o -c /tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/src/test/accept.c
/tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/src/test/accept.c: In function ‘client’:
/tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/src/test/accept.c:6:6: erreur: variable ‘clientfd’ set but not used [-Werror=unused-but-set-variable]
int clientfd;
^
/tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/src/test/accept.c: In function ‘server’:
/tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/src/test/accept.c:34:6: erreur: unused variable ‘status’ [-Werror=unused-variable]
int status;
^
/tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/src/test/accept.c:33:12: erreur: unused variable ‘len’ [-Werror=unused-variable]
socklen_t len = sizeof(peer_addr);
^
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/accept.dir/src/test/accept.c.o] Erreur 1
When building without the Release mode:
building CMakeFiles/accept.dir/src/test/accept.c.o
/nix/store/vv90ccz0p6kyfasyhh1caxdjbrqdzqc1-cmake-2.8.11.2/bin/cmake -E cmake_progress_report /tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/CMakeFiles 2
[ 2%] Building C object CMakeFiles/accept.dir/src/test/accept.c.o
/nix/store/xnb0w1i2jdjv178j1y28q4bfn79b8xia-gcc-wrapper-4.8.2/bin/cc -pthread -O0 -g3 -Wall -Werror -m32 -Wstrict-prototypes -I/tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/include -o CMakeFiles/accept.dir/src/test/accept.c.o -c /tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0/src/test/accept.c
building bin/accept
Linking C executable bin/accept
/nix/store/vv90ccz0p6kyfasyhh1caxdjbrqdzqc1-cmake-2.8.11.2/bin/cmake -E cmake_link_script CMakeFiles/accept.dir/link.txt --verbose=1
/nix/store/xnb0w1i2jdjv178j1y28q4bfn79b8xia-gcc-wrapper-4.8.2/bin/cc -pthread -O0 -g3 -Wall -Werror -m32 -Wstrict-prototypes CMakeFiles/accept.dir/src/test/accept.c.o -o bin/accept -rdynamic -lrt
make[2] : on quitte le répertoire « /tmp/nix-build-rr-1.3.0.drv-0/rr-1.3.0 »
- Dominant language
- C++
- Stars
- 10.7k
- Forks
- 662
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rr-debugger/rr
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rr-debugger/rr#4096 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rr-debugger/rr#4093 · 6 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rr-debugger/rr#4090 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rr-debugger/rr#4060 · 5 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
rr-debugger/rr#4059 · 1 comment ·
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·