selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0
@ 2019-01-20 19:19 Nicolas Iooss
  2019-01-20 19:19 ` [PATCH 2/3] Travis-CI: add Ruby 2.6 to the test matrix Nicolas Iooss
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nicolas Iooss @ 2019-01-20 19:19 UTC (permalink / raw)
  To: selinux

PyPy 6.0 was released in April 2018 but became available on Travis-CI
only recently. Now that it is available, use it.

While at it, compile Python modules with libpypy-c.so, now that PyPy
provides this library. This would enable linking Python modules with
-Wl,-no-undefined (or -Wl,-z,defs) and help fixing issues with
https://github.com/SELinuxProject/selinux/pull/130.

Tracking issues:
* https://github.com/travis-ci/travis-ci/issues/9542
* https://travis-ci.community/t/pypy-2-7-on-xenial/889

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 .travis.yml | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 08a29b2f5adc..b8e97f83bbcd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,10 +20,8 @@ env:
     - PYVER=python2.7 RUBYLIBVER=2.5.1
     - PYVER=python3.5 RUBYLIBVER=2.5.1
     - PYVER=python3.6 RUBYLIBVER=2.5.1
-    # pypy2.7 seems not to be available in Travis-CI Xenial template yet.
-    # https://github.com/travis-ci/travis-ci/issues/9542
-    #- PYVER=pypy RUBYLIBVER=2.5.1
-    - PYVER=pypy3.5 RUBYLIBVER=2.5.1
+    - PYVER=pypy2.7-6.0 RUBYLIBVER=2.5.1
+    - PYVER=pypy3.5-6.0 RUBYLIBVER=2.5.1
 
     # Test several Ruby versions
     - PYVER=python3.7 RUBYLIBVER=2.4
@@ -98,8 +96,12 @@ before_script:
   - export PYTHON="$VIRTUAL_ENV/bin/python"
   # Use the header files in /opt/python/... for Python because the virtualenvs do not provide Python.h
   - export PKG_CONFIG_PATH="/opt/python/$($PYTHON -c 'import sys;print("%d.%d.%d" % sys.version_info[:3])')/lib/pkgconfig"
-  # PyPy does not provide a config file for pkg-config nor a pypy-c.so
-  - if echo "$PYVER" | grep -q pypy ; then export PYINC=-I$($PYTHON -c 'import sys;print(sys.prefix)')/include PYLIBS= ; fi
+  # PyPy does not provide a config file for pkg-config
+  # libpypy-c.so is provided in bin/libpypy-c.so for PyPy and bin/libpypy3-c.so for PyPy3
+  - if echo "$PYVER" | grep -q pypy ; then
+        export PYINC=-I$($PYTHON -c 'import sys;print(sys.prefix)')/include ;
+        export PYLIBS="$($PYTHON -c 'import sys;print("-L%s/bin -l%s" % (sys.prefix, "pypy-c" if sys.version_info < (3,) else "pypy3-c"))')" ;
+    fi
 
   # Find the Ruby executable with version $RUBYLIBVER
   - rvm reinstall ruby-$RUBYLIBVER --binary
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] Travis-CI: add Ruby 2.6 to the test matrix
  2019-01-20 19:19 [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0 Nicolas Iooss
@ 2019-01-20 19:19 ` Nicolas Iooss
  2019-01-20 19:19 ` [PATCH 3/3] scripts: introduce env_use_destdir.sh helper Nicolas Iooss
  2019-01-21 13:25 ` [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0 Petr Lautrbach
  2 siblings, 0 replies; 5+ messages in thread
From: Nicolas Iooss @ 2019-01-20 19:19 UTC (permalink / raw)
  To: selinux

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 .travis.yml | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index b8e97f83bbcd..19914f4c2823 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,19 +11,20 @@ compiler:
 env:
   matrix:
     # Test the last version of Python and Ruby together, with some linkers
-    - PYVER=python3.7 RUBYLIBVER=2.5.1
-    - PYVER=python3.7 RUBYLIBVER=2.5.1 TEST_FLAGS_OVERRIDE=1
-    - PYVER=python3.7 RUBYLIBVER=2.5.1 LINKER=gold
-    - PYVER=python3.7 RUBYLIBVER=2.5.1 LINKER=bfd
+    - PYVER=python3.7 RUBYLIBVER=2.6
+    - PYVER=python3.7 RUBYLIBVER=2.6 TEST_FLAGS_OVERRIDE=1
+    - PYVER=python3.7 RUBYLIBVER=2.6 LINKER=gold
+    - PYVER=python3.7 RUBYLIBVER=2.6 LINKER=bfd
 
     # Test several Python versions
-    - PYVER=python2.7 RUBYLIBVER=2.5.1
-    - PYVER=python3.5 RUBYLIBVER=2.5.1
-    - PYVER=python3.6 RUBYLIBVER=2.5.1
-    - PYVER=pypy2.7-6.0 RUBYLIBVER=2.5.1
-    - PYVER=pypy3.5-6.0 RUBYLIBVER=2.5.1
+    - PYVER=python2.7 RUBYLIBVER=2.6
+    - PYVER=python3.5 RUBYLIBVER=2.6
+    - PYVER=python3.6 RUBYLIBVER=2.6
+    - PYVER=pypy2.7-6.0 RUBYLIBVER=2.6
+    - PYVER=pypy3.5-6.0 RUBYLIBVER=2.6
 
-    # Test several Ruby versions
+    # Test several Ruby versions (http://rubies.travis-ci.org/)
+    - PYVER=python3.7 RUBYLIBVER=2.5.1
     - PYVER=python3.7 RUBYLIBVER=2.4
     - PYVER=python3.7 RUBYLIBVER=2.3
     - PYVER=python3.7 RUBYLIBVER=2.2
@@ -31,9 +32,9 @@ env:
 matrix:
   exclude:
     - compiler: clang
-      env: PYVER=python3.7 RUBYLIBVER=2.5.1 LINKER=gold
+      env: PYVER=python3.7 RUBYLIBVER=2.6 LINKER=gold
     - compiler: clang
-      env: PYVER=python3.7 RUBYLIBVER=2.5.1 LINKER=bfd
+      env: PYVER=python3.7 RUBYLIBVER=2.6 LINKER=bfd
 
 # Use Travis-CI Ubuntu 16.04 Xenial Xerus infrastructure, "full image" variant
 sudo: required
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] scripts: introduce env_use_destdir.sh helper
  2019-01-20 19:19 [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0 Nicolas Iooss
  2019-01-20 19:19 ` [PATCH 2/3] Travis-CI: add Ruby 2.6 to the test matrix Nicolas Iooss
@ 2019-01-20 19:19 ` Nicolas Iooss
  2019-01-21 13:25 ` [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0 Petr Lautrbach
  2 siblings, 0 replies; 5+ messages in thread
From: Nicolas Iooss @ 2019-01-20 19:19 UTC (permalink / raw)
  To: selinux

Set-up environment variables in order to use DESTDIR in Python, Ruby,
etc. This makes testing Python scripts easier.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 .travis.yml             |  5 +----
 scripts/env_use_destdir | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 4 deletions(-)
 create mode 100755 scripts/env_use_destdir

diff --git a/.travis.yml b/.travis.yml
index 19914f4c2823..7a9e73ce55db 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -129,10 +129,7 @@ script:
   - make all $EXPLICIT_MAKE_VARS -k
 
   # Set up environment variables for the tests
-  - export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib"
-  - export PATH="$DESTDIR/usr/sbin:$DESTDIR/usr/bin:$DESTDIR/sbin:$DESTDIR/bin:$PATH"
-  - export PYTHONPATH="$DESTDIR$($PYTHON -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
-  - export RUBYLIB="$DESTDIR/$($RUBY -e 'puts RbConfig::CONFIG["vendorlibdir"]'):$DESTDIR/$($RUBY -e 'puts RbConfig::CONFIG["vendorarchdir"]')"
+  - . ./scripts/env_use_destdir
 
   # Show variables (to help debugging issues)
   - echo "$LD_LIBRARY_PATH"
diff --git a/scripts/env_use_destdir b/scripts/env_use_destdir
new file mode 100755
index 000000000000..4fbfb8dec44f
--- /dev/null
+++ b/scripts/env_use_destdir
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Set-up environment variables to run programs which are built in DESTDIR folder
+#
+# Usage example to use variables in the current shell:
+#   $ export DESTDIR=$HOME/selinux-destdir
+#   $ make install install-pywrap install-rubywrap
+#   $ . ./scripts/env_use_destdir
+#   $ make test
+#
+# Or to use variables in a subcommand, for example to run tests:
+#   $ export DESTDIR=$HOME/selinux-destdir
+#   $ make install install-pywrap install-rubywrap
+#   $ ./scripts/env_use_destdir secilc ...
+#   $ ./scripts/env_use_destdir make test
+
+if [ -z "${DESTDIR:-}" ] ; then
+    echo >&2 "Error: variable DESTDIR needs to be defined in order to use this script."
+    echo >&2 "Example:"
+    # shellcheck disable=SC2164
+    echo >&2 "    DESTDIR=$(cd "$(dirname -- "$0")/.." ; pwd)/DESTDIR . $0"
+    exit 1
+fi
+
+export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib"
+export PATH="$DESTDIR/usr/sbin:$DESTDIR/usr/bin:$DESTDIR/sbin:$DESTDIR/bin:$PATH"
+
+# shellcheck disable=SC2155
+export PYTHONPATH="$DESTDIR$(${PYTHON:-python} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
+
+# shellcheck disable=SC2155
+export RUBYLIB="$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorlibdir"]'):$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorarchdir"]')"
+
+# Run the command given on the command line
+if [ $# -gt 0 ] ; then
+    exec "$@"
+fi
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0
  2019-01-20 19:19 [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0 Nicolas Iooss
  2019-01-20 19:19 ` [PATCH 2/3] Travis-CI: add Ruby 2.6 to the test matrix Nicolas Iooss
  2019-01-20 19:19 ` [PATCH 3/3] scripts: introduce env_use_destdir.sh helper Nicolas Iooss
@ 2019-01-21 13:25 ` Petr Lautrbach
  2019-01-24 10:46   ` Petr Lautrbach
  2 siblings, 1 reply; 5+ messages in thread
From: Petr Lautrbach @ 2019-01-21 13:25 UTC (permalink / raw)
  To: Nicolas Iooss; +Cc: selinux


Nicolas Iooss <nicolas.iooss@m4x.org> writes:

> PyPy 6.0 was released in April 2018 but became available on 
> Travis-CI
> only recently. Now that it is available, use it.
>
> While at it, compile Python modules with libpypy-c.so, now that 
> PyPy
> provides this library. This would enable linking Python modules 
> with
> -Wl,-no-undefined (or -Wl,-z,defs) and help fixing issues with
> https://github.com/SELinuxProject/selinux/pull/130.
>
> Tracking issues:
> * https://github.com/travis-ci/travis-ci/issues/9542
> * https://travis-ci.community/t/pypy-2-7-on-xenial/889
>
> Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Thanks!

Acked-by: Petr Lautrbach <plautrba@redhat.com>

https://github.com/SELinuxProject/selinux/pull/132


> ---
>  .travis.yml | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index 08a29b2f5adc..b8e97f83bbcd 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -20,10 +20,8 @@ env:
>      - PYVER=python2.7 RUBYLIBVER=2.5.1
>      - PYVER=python3.5 RUBYLIBVER=2.5.1
>      - PYVER=python3.6 RUBYLIBVER=2.5.1
> -    # pypy2.7 seems not to be available in Travis-CI Xenial 
> template yet.
> -    # https://github.com/travis-ci/travis-ci/issues/9542
> -    #- PYVER=pypy RUBYLIBVER=2.5.1
> -    - PYVER=pypy3.5 RUBYLIBVER=2.5.1
> +    - PYVER=pypy2.7-6.0 RUBYLIBVER=2.5.1
> +    - PYVER=pypy3.5-6.0 RUBYLIBVER=2.5.1
>  
>      # Test several Ruby versions
>      - PYVER=python3.7 RUBYLIBVER=2.4
> @@ -98,8 +96,12 @@ before_script:
>    - export PYTHON="$VIRTUAL_ENV/bin/python"
>    # Use the header files in /opt/python/... for Python because 
>    the virtualenvs do not provide Python.h
>    - export PKG_CONFIG_PATH="/opt/python/$($PYTHON -c 'import 
>    sys;print("%d.%d.%d" % sys.version_info[:3])')/lib/pkgconfig"
> -  # PyPy does not provide a config file for pkg-config nor a 
> pypy-c.so
> -  - if echo "$PYVER" | grep -q pypy ; then export 
> PYINC=-I$($PYTHON -c 'import sys;print(sys.prefix)')/include 
> PYLIBS= ; fi
> +  # PyPy does not provide a config file for pkg-config
> +  # libpypy-c.so is provided in bin/libpypy-c.so for PyPy and 
> bin/libpypy3-c.so for PyPy3
> +  - if echo "$PYVER" | grep -q pypy ; then
> +        export PYINC=-I$($PYTHON -c 'import 
> sys;print(sys.prefix)')/include ;
> +        export PYLIBS="$($PYTHON -c 'import sys;print("-L%s/bin 
> -l%s" % (sys.prefix, "pypy-c" if sys.version_info < (3,) else 
> "pypy3-c"))')" ;
> +    fi
>  
>    # Find the Ruby executable with version $RUBYLIBVER
>    - rvm reinstall ruby-$RUBYLIBVER --binary


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0
  2019-01-21 13:25 ` [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0 Petr Lautrbach
@ 2019-01-24 10:46   ` Petr Lautrbach
  0 siblings, 0 replies; 5+ messages in thread
From: Petr Lautrbach @ 2019-01-24 10:46 UTC (permalink / raw)
  To: Nicolas Iooss; +Cc: selinux

Petr Lautrbach <plautrba@redhat.com> writes:

> Nicolas Iooss <nicolas.iooss@m4x.org> writes:
>
>> PyPy 6.0 was released in April 2018 but became available on Travis-CI
>> only recently. Now that it is available, use it.
>>
>> While at it, compile Python modules with libpypy-c.so, now that PyPy
>> provides this library. This would enable linking Python modules with
>> -Wl,-no-undefined (or -Wl,-z,defs) and help fixing issues with
>> https://github.com/SELinuxProject/selinux/pull/130.
>>
>> Tracking issues:
>> * https://github.com/travis-ci/travis-ci/issues/9542
>> * https://travis-ci.community/t/pypy-2-7-on-xenial/889
>>
>> Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
>
> Thanks!
>
> Acked-by: Petr Lautrbach <plautrba@redhat.com>
>
> https://github.com/SELinuxProject/selinux/pull/132
>

It's merged now.

>
>> ---
>>  .travis.yml | 14 ++++++++------
>>  1 file changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/.travis.yml b/.travis.yml
>> index 08a29b2f5adc..b8e97f83bbcd 100644
>> --- a/.travis.yml
>> +++ b/.travis.yml
>> @@ -20,10 +20,8 @@ env:
>>      - PYVER=python2.7 RUBYLIBVER=2.5.1
>>      - PYVER=python3.5 RUBYLIBVER=2.5.1
>>      - PYVER=python3.6 RUBYLIBVER=2.5.1
>> -    # pypy2.7 seems not to be available in Travis-CI Xenial template yet.
>> -    # https://github.com/travis-ci/travis-ci/issues/9542
>> -    #- PYVER=pypy RUBYLIBVER=2.5.1
>> -    - PYVER=pypy3.5 RUBYLIBVER=2.5.1
>> +    - PYVER=pypy2.7-6.0 RUBYLIBVER=2.5.1
>> +    - PYVER=pypy3.5-6.0 RUBYLIBVER=2.5.1
>>       # Test several Ruby versions
>>      - PYVER=python3.7 RUBYLIBVER=2.4
>> @@ -98,8 +96,12 @@ before_script:
>>    - export PYTHON="$VIRTUAL_ENV/bin/python"
>>    # Use the header files in /opt/python/... for Python because    the
>> virtualenvs do not provide Python.h
>>    - export PKG_CONFIG_PATH="/opt/python/$($PYTHON -c 'import
>> sys;print("%d.%d.%d" % sys.version_info[:3])')/lib/pkgconfig"
>> -  # PyPy does not provide a config file for pkg-config nor a pypy-c.so
>> -  - if echo "$PYVER" | grep -q pypy ; then export PYINC=-I$($PYTHON -c
>> 'import sys;print(sys.prefix)')/include PYLIBS= ; fi
>> +  # PyPy does not provide a config file for pkg-config
>> +  # libpypy-c.so is provided in bin/libpypy-c.so for PyPy and
>> bin/libpypy3-c.so for PyPy3
>> +  - if echo "$PYVER" | grep -q pypy ; then
>> +        export PYINC=-I$($PYTHON -c 'import sys;print(sys.prefix)')/include ;
>> +        export PYLIBS="$($PYTHON -c 'import sys;print("-L%s/bin -l%s" %
>> (sys.prefix, "pypy-c" if sys.version_info < (3,) else "pypy3-c"))')" ;
>> +    fi
>>     # Find the Ruby executable with version $RUBYLIBVER
>>    - rvm reinstall ruby-$RUBYLIBVER --binary

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-24 10:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-20 19:19 [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0 Nicolas Iooss
2019-01-20 19:19 ` [PATCH 2/3] Travis-CI: add Ruby 2.6 to the test matrix Nicolas Iooss
2019-01-20 19:19 ` [PATCH 3/3] scripts: introduce env_use_destdir.sh helper Nicolas Iooss
2019-01-21 13:25 ` [PATCH 1/3] Travis-CI: upgrade PyPy to 6.0 Petr Lautrbach
2019-01-24 10:46   ` Petr Lautrbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).