Skip to contentSkip to conversation

Travis-CI: update the list of Ruby's and Python's versions

PATCH Applied Nicolas Iooss 2 participants 4 messages Jun 28, 2017 – Jun 30, 2017 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Travis-CI: update the list of Ruby's and Python's versions

Travis-CI no longer provides Ruby 2.0 in its Trusty environment (it has been updated according to
https://blog.travis-ci.com/2017-06-21-trusty-updates-2017-Q2-launch).
Remove this version from .travis.yml.

Moreover Python 3.6 and Ruby 3.4 are available. Test building with them.

Last by not least, pypy virtual environment directory has been renamed pypy2 (/home/travis/virtualenv/pypy2 is a symbolic link to pypy2-5.6.0).

The updated .travis.yml file has been tested on
https://travis-ci.org/fishilico/selinux/builds/248126824

---
 .travis.yml | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
.travis.yml +11 -10
index fa25d1b336ac..573e73322e28 100644
@@ -11,21 +11,22 @@ compiler:
 env:
   matrix:
     # Test the last version of Python and Ruby together, with some linkers
-    - PYVER=python3.5 RUBYLIBVER=2.3
-    - PYVER=python3.5 RUBYLIBVER=2.3 LINKER=gold
-    - PYVER=python3.5 RUBYLIBVER=2.3 LINKER=bfd
+    - PYVER=python3.6 RUBYLIBVER=2.4
+    - PYVER=python3.6 RUBYLIBVER=2.4 LINKER=gold
+    - PYVER=python3.6 RUBYLIBVER=2.4 LINKER=bfd
 
     # Test several Python versions
-    - PYVER=python2.7 RUBYLIBVER=2.3
-    - PYVER=python3.3 RUBYLIBVER=2.3
-    - PYVER=python3.4 RUBYLIBVER=2.3
-    - PYVER=pypy RUBYLIBVER=2.3
+    - PYVER=python2.7 RUBYLIBVER=2.4
+    - PYVER=python3.3 RUBYLIBVER=2.4
+    - PYVER=python3.4 RUBYLIBVER=2.4
+    - PYVER=python3.5 RUBYLIBVER=2.4
+    - PYVER=pypy2 RUBYLIBVER=2.4
     #- PYVER=pypy3 RUBYLIBVER=2.3 # PyPy3 5.5.0 provides the Python2 form of some structures, which makes it incompatible with SWIG
 
     # Test several Ruby versions
-    - PYVER=python3.5 RUBYLIBVER=2.0
-    - PYVER=python3.5 RUBYLIBVER=2.1
-    - PYVER=python3.5 RUBYLIBVER=2.2
+    - PYVER=python3.6 RUBYLIBVER=2.1
+    - PYVER=python3.6 RUBYLIBVER=2.2
+    - PYVER=python3.6 RUBYLIBVER=2.3
 
 # Use Travis-CI Ubuntu 14.04 Trusty infrastructure
 sudo: required
Signature · 1 line
2.13.1
#1 lore raw

PATCH 2/3 libsepol/tests: override CPPFLAGS too

A build toolchain may override CPPFLAGS on the command line of "make". Doing so currently breaks libsepol/tests compilation, as it requires "-I../include/ -I$(CHECKPOLICY)" to be provided in gcc's arguments.

This completes commit 15f274073322 ("Makefiles: override *FLAGS and *LIBS").

---
 libsepol/tests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libsepol/tests/Makefile +1 -1
index 1bd96db9b7b2..e7e305e8150b 100644
@@ -12,7 +12,7 @@ LIBSEPOL := ../src/libsepol.a
 # This is less than ideal, but it makes the tests easier to maintain by allowing source policies
 # to be loaded directly.
 CHECKPOLICY := ../../checkpolicy/
-CPPFLAGS += -I../include/ -I$(CHECKPOLICY)
+override CPPFLAGS += -I../include/ -I$(CHECKPOLICY)
 
 # test program object files
 objs := $(patsubst %.c,%.o,$(sort $(wildcard *.c)))
Signature · 1 line
2.13.1
#2 lore raw

PATCH 3/3 Travis-CI: test defining CFLAGS, LDFLAGS, etc. on make command line

In reply to Nicolas Iooss

Some Makefiles rely on adding values to variables like CFLAGS, LDFLAGS, etc. For example doing "LDFLAGS += -L../src" does not work fine when LDFLAGS is defined on the command line of "make".

Commits 297877ab88ee ("libselinux utils: override LD{FLAGS, LIBS} for libselinux.so in Makefile") and 15f274073322 ("Makefiles: override *FLAGS and *LIBS") recently fixed such issues, by introducing keyword "override" in the relevant Makefile statements.

In order to prevent the fixed issues from appearing again, add a test case in Travis-CI configuration file. This case adds on make's command line minimal definitions for CFLAGS and LDFLAGS and empty definitions for CPPFLAGS and LDLIBS.

An example of build failure due to a missing override in a required CPPFLAGS addition is provided on
https://travis-ci.org/fishilico/selinux/builds/245107609

---
 .travis.yml | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
.travis.yml +10 -6
index 573e73322e28..481ea7dae8bb 100644
@@ -12,6 +12,7 @@ env:
   matrix:
     # Test the last version of Python and Ruby together, with some linkers
     - PYVER=python3.6 RUBYLIBVER=2.4
+    - PYVER=python3.6 RUBYLIBVER=2.4 TEST_FLAGS_OVERRIDE=1
     - PYVER=python3.6 RUBYLIBVER=2.4 LINKER=gold
     - PYVER=python3.6 RUBYLIBVER=2.4 LINKER=bfd
 
@@ -96,14 +97,17 @@ before_script:
   - echo "$PYTHON" ; $PYTHON --version
   - echo "$RUBY" ; $RUBY --version
 
+  # If TEST_FLAGS_OVERRIDE is defined, test that overriding CFLAGS, LDFLAGS and other variables works fine
+  - if [ -n "$TEST_FLAGS_OVERRIDE" ]; then EXPLICIT_MAKE_VARS="CFLAGS=-I$DESTDIR/usr/include LDFLAGS=-L$DESTDIR/usr/lib LDLIBS= CPPFLAGS=" ; fi
+
 script:
   # Start by installing everything into $DESTDIR
-  - make install -k
-  - make install-pywrap -k
-  - make install-rubywrap -k
+  - make install $EXPLICIT_MAKE_VARS -k
+  - make install-pywrap $EXPLICIT_MAKE_VARS -k
+  - make install-rubywrap $EXPLICIT_MAKE_VARS -k
 
   # Now that everything is installed, run "make all" to build everything which may have not been built
-  - make all -k
+  - make all $EXPLICIT_MAKE_VARS -k
 
   # Set up environment variables for the tests
   - export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib"
@@ -118,7 +122,7 @@ script:
   - echo "$RUBYLIB"
 
   # Run tests
-  - make test
+  - make test $EXPLICIT_MAKE_VARS
 
   # Test Python and Ruby wrappers
   - $PYTHON -c 'import selinux;import selinux.audit2why;import semanage;print(selinux.is_selinux_enabled())'
@@ -132,7 +136,7 @@ script:
     git status --short | sed -n 's/^??/error: missing .gitignore entry for/p' | (! grep '^')
 
   # Clean up everything and show which file would be added to "make clean"
-  - make clean distclean
+  - make clean distclean $EXPLICIT_MAKE_VARS
   - |-
     git ls-files --ignored --others --exclude-standard | sed 's/^/error: "make clean distclean" did not remove /' | (! grep '^')
 
Signature · 1 line
2.13.1
#3 lore raw

Re: [PATCH 3/3] Travis-CI: test defining CFLAGS, LDFLAGS, etc. on make command line

Quoted 16 lines · Nicolas Iooss

Some Makefiles rely on adding values to variables like CFLAGS, LDFLAGS, etc. For example doing "LDFLAGS += -L../src" does not work fine
when LDFLAGS is defined on the command line of "make".

Commits 297877ab88ee ("libselinux utils: override LD{FLAGS, LIBS} for libselinux.so in Makefile") and 15f274073322 ("Makefiles: override *FLAGS and *LIBS") recently fixed such issues, by introducing keyword "override" in the relevant Makefile statements.

In order to prevent the fixed issues from appearing again, add a test case in Travis-CI configuration file. This case adds on make's command
line minimal definitions for CFLAGS and LDFLAGS and empty definitions for CPPFLAGS and LDLIBS.

Quoted 3 lines

An example of build failure due to a missing override in a required CPPFLAGS addition is provided on
https://travis-ci.org/fishilico/selinux/builds/245107609

Thanks, applied all three.

Quoted 67 lines

---
 .travis.yml | 16 ++++++++++------

 1 file changed, 10 insertions(+), 6 deletions(-)
.travis.yml +0 -0
index 573e73322e28..481ea7dae8bb 100644
@@ -12,6 +12,7 @@ env:

   matrix:
     # Test the last version of Python and Ruby together, with some linkers
     - PYVER=python3.6 RUBYLIBVER=2.4
+    - PYVER=python3.6 RUBYLIBVER=2.4 TEST_FLAGS_OVERRIDE=1
     - PYVER=python3.6 RUBYLIBVER=2.4 LINKER=gold
     - PYVER=python3.6 RUBYLIBVER=2.4 LINKER=bfd

.travis.yml +0 -0
@@ -96,14 +97,17 @@ before_script:

   - echo "$PYTHON" ; $PYTHON --version
   - echo "$RUBY" ; $RUBY --version

+  # If TEST_FLAGS_OVERRIDE is defined, test that overriding CFLAGS, LDFLAGS and other variables works fine
+  - if [ -n "$TEST_FLAGS_OVERRIDE" ]; then EXPLICIT_MAKE_VARS="CFLAGS=-I$DESTDIR/usr/include LDFLAGS=- L$DESTDIR/usr/lib LDLIBS= CPPFLAGS=" ; fi
+
 script:
   # Start by installing everything into $DESTDIR
-  - make install -k
-  - make install-pywrap -k
-  - make install-rubywrap -k
+  - make install $EXPLICIT_MAKE_VARS -k
+  - make install-pywrap $EXPLICIT_MAKE_VARS -k
+  - make install-rubywrap $EXPLICIT_MAKE_VARS -k

   # Now that everything is installed, run "make all" to build everything which may have not been built
-  - make all -k
+  - make all $EXPLICIT_MAKE_VARS -k

   # Set up environment variables for the tests
   - export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib"

.travis.yml +0 -0
@@ -118,7 +122,7 @@ script:

   - echo "$RUBYLIB"

   # Run tests
-  - make test
+  - make test $EXPLICIT_MAKE_VARS

   # Test Python and Ruby wrappers
   - $PYTHON -c 'import selinux;import selinux.audit2why;import semanage;print(selinux.is_selinux_enabled())'

.travis.yml +0 -0
@@ -132,7 +136,7 @@ script:

     git status --short | sed -n 's/^??/error: missing .gitignore entry for/p' | (! grep '^')

   # Clean up everything and show which file would be added to "make clean"
-  - make clean distclean
+  - make clean distclean $EXPLICIT_MAKE_VARS
   - |-
     git ls-files --ignored --others --exclude-standard | sed 's/^/error: "make clean distclean" did not remove /' | (! grep '^')