Skip to content

Commit

Permalink
Fix Travis & missing build dependency (#1627)
Browse files Browse the repository at this point in the history
* Added missing build dependency. The control plane now depends on the front end, so that the parser is built before the P4Runtime serializer. This fixes a heisenbug in the build process.

* Build now checks for `bison>=3.0.2`.

* Don't clobber the user's `.bash_profile` in `install_os_deps.sh`.

* Fix Travis OS X job. Modifying `.bash_profile` isn't good enough for Travis. Have to set
environment variables in `.travis.yml`.
  • Loading branch information
liujed authored Dec 11, 2018
1 parent 6314c70 commit d31449a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:

before_install:
- tools/install_os_deps.sh
- if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then export PATH="/usr/local/opt/bison/bin:$PATH" ; fi

install:
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then tools/start_ccache; fi
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ set (P4C_LIB_DEPS)
# required tools and libraries
find_package (PythonInterp REQUIRED)
find_package (FLEX REQUIRED)
find_package (BISON REQUIRED)
find_package (BISON 3.0.2 REQUIRED)
if (ENABLE_PROTOBUF_STATIC)
set(SAVED_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
Expand Down
2 changes: 1 addition & 1 deletion control-plane/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ set_source_files_properties (${P4RUNTIME_GEN_SRCS} PROPERTIES GENERATED TRUE)
build_unified(CONTROLPLANE_SOURCES)
add_library (controlplane STATIC ${CONTROLPLANE_SOURCES} )
target_link_libraries (controlplane ${PROTOBUF_LIBRARY})
add_dependencies (controlplane mkP4configdir genIR)
add_dependencies (controlplane mkP4configdir genIR frontend)
1 change: 0 additions & 1 deletion frontends/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ set (FRONTEND_SOURCES
set_source_files_properties(${IR_GENERATED_SRCS} PROPERTIES GENERATED TRUE)
set_source_files_properties(${v1PARSER_GEN_SRCS} PROPERTIES GENERATED TRUE)
set_source_files_properties(${p4PARSER_GEN_SRCS} PROPERTIES GENERATED TRUE)
set_source_files_properties(frontends/parsers/p4/p4parser.hpp PROPERTIES GENERATED TRUE)

set (FRONTEND_CPPLINT_FILES
${P4_FRONTEND_SRCS} ${P4_FRONTEND_HDRS}
Expand Down
3 changes: 2 additions & 1 deletion tools/install_os_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then

# Prefer Homebrew's bison over the macOS-provided version
$BREW link --force bison
echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' > ~/.bash_profile
echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.bash_profile
export PATH="/usr/local/opt/bison/bin:$PATH"

# install pip and required pip packages
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Expand Down

0 comments on commit d31449a

Please sign in to comment.