Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[infra] Fix order of stamp generation for ExternalBuild_CMake #8487

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions infra/cmake/modules/ExternalBuildTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ function(ExternalBuild_CMake)
file(MAKE_DIRECTORY ${ARG_BUILD_DIR})
file(MAKE_DIRECTORY ${ARG_INSTALL_DIR})

file(WRITE "${BUILD_STAMP_PATH}" "${PKG_IDENTIFIER}")
Copy link
Contributor

@hseok-oh hseok-oh Feb 22, 2022

Choose a reason for hiding this comment

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

It was designed to not retry build when failed.

# NOTE Do NOT retry build once it fails
if(EXISTS ${BUILD_STAMP_PATH})
file(READ ${BUILD_STAMP_PATH} READ_IDENTIFIER)
if("${READ_IDENTIFIER}" STREQUAL "${PKG_IDENTIFIER}")
return()
endif("${READ_IDENTIFIER}" STREQUAL "${PKG_IDENTIFIER}")
endif(EXISTS ${BUILD_STAMP_PATH})

Please update above comment.

Copy link
Contributor Author

@seanshpark seanshpark Feb 22, 2022

Choose a reason for hiding this comment

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

OK, it was by design...
I had a problem while make a cross build of external project and had to remove the stamp to make it retry the build.
So I think by design is like while development, the developer should manually clean the stamp.
Once the development is done, external build should not break in normal cases.
If it does break, then there is some critical situation and should skip retry as it will may always fail...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think leaving as-is would be better :)


execute_process(COMMAND ${CMAKE_COMMAND}
-G "${CMAKE_GENERATOR}"
-DCMAKE_INSTALL_PREFIX=${ARG_INSTALL_DIR}
Expand All @@ -63,6 +61,8 @@ function(ExternalBuild_CMake)
message(FATAL_ERROR "${ARG_PKG_NAME} Package: Build failed (check '${BUILD_LOG_PATH}' for details)")
endif(NOT BUILD_EXITCODE EQUAL 0)

file(WRITE "${BUILD_STAMP_PATH}" "${PKG_IDENTIFIER}")

set(NUM_BUILD_THREADS 1)
if(DEFINED EXTERNALS_BUILD_THREADS)
set(NUM_BUILD_THREADS ${EXTERNALS_BUILD_THREADS})
Expand Down