Skip to content

Conversation

@mbinna
Copy link
Contributor

@mbinna mbinna commented Feb 13, 2017

Not using sudo is a good thing: it reduces boot time from 20-52s to 1-6s.

See: https://docs.travis-ci.com/user/ci-environment/

Not using sudo is a good thing: it reduces boot time from 20-52s to
1-6s.

See: https://docs.travis-ci.com/user/ci-environment/
This directory is write-accessible. /usr/local is not.
@pmai
Copy link
Contributor

pmai commented Feb 13, 2017

In order for this to work you probably need to supply the alternative protobuf install paths to the cmake call via -D, otherwise the protobuf will not be found. Probably also need to adjust the cache check, otherwise this will not build correctly on old caches. I'll try a commit that does this.

- mkdir -p build
- cd build
- cmake ..
- cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install ..
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't you write it like CMAKE_PREFIX_PATH=${DEPS_DIR}/protobuf/install:${PATH}? Does the current version do something different?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -D command-line flag vs. environment variable is mostly just our default practice to avoid reliance on environment variables which are passed through to other processes. The reason we don't append the PATH is that CMAKE_PREFIX_PATH is just a set of additional paths to look for packages, which defaults to empty. cmake will continue to use the PATH environment variable normally in any case.

PATH should not be overwritten!
Changed:
CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install ..
To:
CMAKE_PREFIX_PATH=${DEPS_DIR}/protobuf/install:${PATH} ..
fix build fail
@pmai
Copy link
Contributor

pmai commented Feb 14, 2017

Not sure why the build fails, probably the issue of path separators? Anyway including PATH on the CMAKE_PREFIX_PATH is not what we want, since CMAKE_PREFIX_PATH serves a different purpose, and PATH is used by cmake normally anyways, depending on system settings.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine!

@ghost ghost merged commit dfc90bb into master Feb 14, 2017
@mbinna mbinna deleted the no-sudo branch February 17, 2017 12:39
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants