-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[vcpkg-make] Misc fixes, in particular: parallel builds #43249
Changes from all commits
202ee28
5814e9f
e3d254e
14f7afd
462b92e
dad7a91
e1a60fd
67dc5d8
1e09b5b
5d69dc6
2be94f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ macro(z_vcpkg_make_set_common_vars) | |
endforeach() | ||
set(buildtypes release) | ||
if(NOT VCPKG_BUILD_TYPE) | ||
list(APPEND buildtypes debug) | ||
list(PREPEND buildtypes debug) | ||
endif() | ||
endmacro() | ||
|
||
|
@@ -557,7 +557,6 @@ function(z_vcpkg_make_prepare_flags) | |
${flags_opts} | ||
) | ||
if(NOT DEFINED VCPKG_BUILD_TYPE) | ||
list(APPEND all_buildtypes DEBUG) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused in port |
||
z_vcpkg_make_prepare_compile_flags( | ||
CONFIG DEBUG | ||
COMPILER_FRONTEND "${VCPKG_DETECTED_CMAKE_C_COMPILER_FRONTEND_VARIANT}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,7 +97,6 @@ function(vcpkg_make_configure) | |
set(opts "") | ||
if(NOT arg_DISABLE_DEFAULT_OPTIONS) | ||
z_vcpkg_make_default_path_and_configure_options(opts AUTOMAKE CONFIG "${configup}") | ||
vcpkg_list(APPEND arg_OPTIONS ${opts}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This appended the second config's options, to the first config's options, breaking the debug,relase build order. |
||
endif() | ||
|
||
set(configure_path_from_wd "./${relative_build_path}/configure") | ||
|
@@ -116,7 +115,8 @@ function(vcpkg_make_configure) | |
"${configure_path_from_wd}" | ||
OPTIONS | ||
${BUILD_TRIPLET} | ||
${arg_OPTIONS} | ||
${arg_OPTIONS} | ||
${opts} | ||
${arg_OPTIONS_${configup}} | ||
WORKING_DIRECTORY | ||
"${target_dir}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_make.cmake") | |
function(vcpkg_make_install) | ||
cmake_parse_arguments(PARSE_ARGV 0 arg | ||
"DISABLE_PARALLEL" | ||
"LOGFILE_ROOT;MAKEFILE;TARGETS" | ||
"OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" | ||
"LOGFILE_ROOT;MAKEFILE" | ||
"OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;TARGETS" | ||
) | ||
z_vcpkg_unparsed_args(FATAL_ERROR) | ||
|
||
|
@@ -81,26 +81,27 @@ function(vcpkg_make_install) | |
endif() | ||
|
||
foreach(target IN LISTS arg_TARGETS) | ||
string(REPLACE "/" "_" target_no_slash "${target}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most targets aren't "phony" but actual files. But filepaths must not be used to construct the log file name. |
||
vcpkg_list(SET make_cmd_line ${make_command} ${arg_OPTIONS} ${arg_OPTIONS_${cmake_buildtype}} V=1 -j ${VCPKG_CONCURRENCY} ${extra_opts} -f ${arg_MAKEFILE} ${target} ${destdir_opt}) | ||
vcpkg_list(SET no_parallel_make_cmd_line ${make_command} ${arg_OPTIONS} ${arg_OPTIONS_${cmake_buildtype}} V=1 -j 1 ${extra_opts} -f ${arg_MAKEFILE} ${target} ${destdir_opt}) | ||
message(STATUS "Making target '${target}' for ${TARGET_TRIPLET}-${short_buildtype}") | ||
if (arg_DISABLE_PARALLEL) | ||
vcpkg_run_shell_as_build( | ||
WORKING_DIRECTORY "${working_directory}" | ||
LOGNAME "${arg_LOGFILE_ROOT}-${target}-${TARGET_TRIPLET}-${short_buildtype}" | ||
LOGNAME "${arg_LOGFILE_ROOT}-${target_no_slash}-${TARGET_TRIPLET}-${short_buildtype}" | ||
SHELL ${shell_cmd} | ||
NO_PARALLEL_COMMAND ${configure_env} ${no_parallel_make_cmd_line} | ||
COMMAND ${configure_env} ${no_parallel_make_cmd_line} | ||
) | ||
else() | ||
vcpkg_run_shell_as_build( | ||
WORKING_DIRECTORY "${working_directory}" | ||
LOGNAME "${arg_LOGFILE_ROOT}-${target}-${TARGET_TRIPLET}-${short_buildtype}" | ||
LOGNAME "${arg_LOGFILE_ROOT}-${target_no_slash}-${TARGET_TRIPLET}-${short_buildtype}" | ||
SHELL ${shell_cmd} | ||
COMMAND ${configure_env} ${no_parallel_make_cmd_line} | ||
COMMAND ${configure_env} ${make_cmd_line} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is why the build wasn't parallel. |
||
NO_PARALLEL_COMMAND ${configure_env} ${no_parallel_make_cmd_line} | ||
) | ||
endif() | ||
file(READ "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_ROOT}-${target}-${TARGET_TRIPLET}-${short_buildtype}-out.log" logdata) | ||
file(READ "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_ROOT}-${target_no_slash}-${TARGET_TRIPLET}-${short_buildtype}-out.log" logdata) | ||
if(logdata MATCHES "Warning: linker path does not have real file for library") | ||
message(FATAL_ERROR "libtool could not find a file being linked against!") | ||
endif() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Restarting without parallelism" shouldn't be displayed if the build was initiated without parallelism.
This is achieved by not passing the
NO_PARALLEL_COMMAND
option whenarg_NO_PARALLEL_COMMAND
is empty.