Project

General

Profile

Actions

Bug #4186

closed

Travis-CI Linux builds broken due to Python version mismatch

Added by Davide Pesavento almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Build
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

Looks like some python or waf issue.

https://travis-ci.org/named-data/ndn-cxx/builds/253363506
https://travis-ci.org/named-data/NFD/builds/252961042

Travis have recently upgraded the Ubuntu Trusty stack that we use, see https://docs.travis-ci.com/user/build-environment-updates/2017-07-12
In particular, "switch language: generic from connie stack to sugilite stack" applies to our builds, and may be the cause of the failure.

Actions #1

Updated by Davide Pesavento almost 7 years ago

  • Subject changed from Travis-CI broken (again) to Travis-CI Linux builds broken (again)
Actions #2

Updated by Junxiao Shi almost 7 years ago

  • Related to Bug #2406: Incorrect dependency calculation for version.hpp added
Actions #3

Updated by Davide Pesavento almost 7 years ago

What's the connection with #2406?

Actions #4

Updated by Davide Pesavento almost 7 years ago

  • Related to deleted (Bug #2406: Incorrect dependency calculation for version.hpp)
Actions #5

Updated by Davide Pesavento almost 7 years ago

  • Status changed from New to In Progress

The cause is a python version mismatch between root and the regular user.

$ echo $PATH
/home/travis/bin:/home/travis/.local/bin:/home/travis/.rvm/gems/ruby-2.4.1/bin:/home/travis/.rvm/gems/ruby-2.4.1@global/bin:/home/travis/.rvm/rubies/ruby-2.4.1/bin:/home/travis/.pyenv/shims:/home/travis/.phpenv/shims:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.7.4.linux.amd64/bin:/home/travis/.local/bin:/home/travis/.nvm/versions/node/v7.4.0/bin:/opt/pyenv/bin:/opt/python/2.7.13/bin:/opt/python/3.6.1/bin:/opt/python/3.3.6/bin:/opt/python/3.4.6/bin:/opt/python/3.5.3/bin:/opt/python/pypy2-5.6.0/bin:/usr/local/phantomjs/bin:/usr/local/phantomjs:/home/travis/perl5/perlbrew/bin:/usr/local/neo4j-3.2.1/bin:/home/travis/.kiex/elixirs/elixir-1.0.4/bin:/home/travis/.kiex/bin:/usr/local/clang-3.5.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/travis/.phpenv/bin:/opt/ghc/bin:/home/travis/.rvm/bin

$ python --version
Python 2.7.13

$ sudo bash -c 'echo $PATH'
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

$ sudo python --version
Python 2.7.6
Actions #6

Updated by Junxiao Shi almost 7 years ago

  • Related to Bug #2406: Incorrect dependency calculation for version.hpp added
Actions #7

Updated by Junxiao Shi almost 7 years ago

Please do not revert changes without first asking and waiting for a 5-day period.

What's the connection with #2406?

The error message in ndn-cxx build is exactly the same.

Actions #8

Updated by Davide Pesavento almost 7 years ago

Junxiao Shi wrote:

The error message in ndn-cxx build is exactly the same.

So what? it's a standard python error message. The scenario and the cause are completely different.

Actions #9

Updated by Davide Pesavento almost 7 years ago

  • Related to deleted (Bug #2406: Incorrect dependency calculation for version.hpp)
Actions #10

Updated by Davide Pesavento almost 7 years ago

One possible solution (verified on Travis) is to manually restore PATH before executing python. That is, instead of sudo ./waf we use:

sudo env "PATH=$PATH" ./waf

This requires changing the jenkins scripts. Would it be acceptable? Other ideas?

Actions #11

Updated by Junxiao Shi almost 7 years ago

  • Target version set to v0.6

How about sudo -E?

Actions #12

Updated by Davide Pesavento almost 7 years ago

sudo -E doesn't preserve PATH.

Actions #13

Updated by Davide Pesavento almost 7 years ago

Davide Pesavento wrote:

One possible solution (verified on Travis) is to manually restore PATH before executing python. That is, instead of sudo ./waf we use:

sudo env "PATH=$PATH" ./waf

This requires changing the jenkins scripts. Would it be acceptable? Other ideas?

@Alex, are you ok with this?

Actions #14

Updated by Junxiao Shi over 6 years ago

This is caused by travis-ci issue 5326 and affects ndn-cxx-breaks as well.
ndn-cxx-breaks has adopted a workardound that uses system default Python for both non-sudo and sudo, which only involves changes in .travis.yml.
I recommend using the same workaround for ndn-cxx, NFD, ndn-tools, NLSR, and repo-ng.

Actions #15

Updated by Junxiao Shi over 6 years ago

One possible solution (verified on Travis) is to manually restore PATH before executing python.

I disagree with this solution because note-14 solution is less intrusive.

Actions #16

Updated by Davide Pesavento over 6 years ago

Junxiao Shi wrote:

This is caused by travis-ci issue 5326

It's an unusual configuration, but I'd argue that it's not a travis bug. You can't assume that sudo PATH and non-sudo PATH are the same.

I disagree with this solution because note-14 solution is less intrusive.

"note-14 solution" is not a solution.

Actions #17

Updated by Junxiao Shi over 6 years ago

  • Subject changed from Travis-CI Linux builds broken (again) to Travis-CI Linux builds broken due to Python version mismatch

20170809 approves note-10 solution.

I have no objection.

This shall be applied to all affected projects including but not limited to ndn-cxx, NFD, ndn-tools, and NLSR.

Actions #18

Updated by Davide Pesavento over 6 years ago

  • % Done changed from 0 to 60
Actions #19

Updated by Davide Pesavento over 6 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 60 to 100

Patches for ndn-cxx, NFD, ndn-tools, NLSR have been merged.

Actions

Also available in: Atom PDF