-
Notifications
You must be signed in to change notification settings - Fork 21
tests: set umask for libpmemfile tests #217
Conversation
tests/preload/CMakeLists.txt
Outdated
@@ -38,6 +38,12 @@ add_cstyle(tests-preload-config ${CMAKE_CURRENT_SOURCE_DIR}/config/config.c) | |||
add_check_whitespace(tests-preload-basic ${CMAKE_CURRENT_SOURCE_DIR}/basic/basic.c) | |||
add_check_whitespace(tests-preload-config ${CMAKE_CURRENT_SOURCE_DIR}/config/config.c) | |||
|
|||
add_library(setumask_o OBJECT setumask.c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is no need for an intermediary OBJECT target for this.
Neither is the _shared postfix needed, as we don't build a static version of this.
Also, I don't see why we would need to set OUTPUT_NAME.
It could just:
add_library(setumask SHARED setumask.c)
set_target_properties(setumask PROPERTIES INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/src/)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -0,0 +1,9 @@ | |||
#include "compiler_utils.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't check_license say something about missing license here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Reviewed 2 of 2 files at r1. Comments from Reviewable |
tests/preload/CMakeLists.txt
Outdated
add_library(setumask SHARED setumask.c) | ||
set_target_properties(setumask PROPERTIES | ||
INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/src/ | ||
POSITION_INDEPENDENT_CODE ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does one really need to manually set POSITION_INDEPENDENT_CODE for a lib marked as SHARED? Isn't that automatic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that is needed when adding an OBJECT library, as cmake doesn't know yet where that is going to be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It failed on Travis without it. See https://travis-ci.org/pmem/pmemfile/builds/245748025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That travis build doesn't correspond to what is here, that still contains the extra OBJECT target.
Scanning dependencies of target setumask_o
[ 61%] Building C object tests/preload/CMakeFiles/setumask_o.dir/setumask.c.o
[ 61%] Built target setumask_o
...
[ 71%] Linking C shared library libsetumask.so
/usr/bin/ld: CMakeFiles/setumask_o.dir/setumask.c.o: relocation R_X86_64_PC32 against undefined symbol `umask@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
So of course, while compiling the object target, cmake didn't know if that should be PIE or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Codecov Report
@@ Coverage Diff @@
## master #217 +/- ##
==========================================
+ Coverage 78.8% 78.82% +0.02%
==========================================
Files 70 71 +1
Lines 11016 11019 +3
Branches 1493 1493
==========================================
+ Hits 8681 8686 +5
- Misses 1813 1815 +2
+ Partials 522 518 -4
Continue to review full report at Codecov.
|
Right now we depend on umask being set to 022 in the environment.
Reviewed 1 of 2 files at r2, 1 of 1 files at r3. Comments from Reviewable |
Reviewed 1 of 2 files at r2, 1 of 1 files at r3. Comments from Reviewable |
Right now we depend on umask being set to 022 in the environment.
This change is