-
-
Notifications
You must be signed in to change notification settings - Fork 184
Explicitly specify build and test jobs parallelism count #1959
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
base: master
Are you sure you want to change the base?
Changes from 4 commits
2b62d6f
9853b92
9414173
91c008a
0d4adc4
8902f6b
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 |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ foreach(component "asm" "link" "fix" "gfx") | |
| COMMAND bash -- test.sh | ||
| WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${component}") | ||
| set_tests_properties("rgb${component}" PROPERTIES REQUIRED_FILES "$<TARGET_FILE:rgb${component}>" | ||
| PROCESSORS 1 | ||
| PROCESSORS $ENV{CTEST_PARALLEL_LEVEL} | ||
|
Rangi42 marked this conversation as resolved.
Outdated
|
||
| LABELS "rgb${component}") | ||
| endforeach() | ||
| set_tests_properties(rgbgfx PROPERTIES REQUIRED_FILES "$<TARGET_FILE:rgbgfx>;$<TARGET_FILE:randtilegen>;$<TARGET_FILE:rgbgfx_test>") | ||
|
|
@@ -44,9 +44,9 @@ add_test(NAME fetch-test-deps | |
| set_tests_properties(fetch-test-deps PROPERTIES FIXTURES_SETUP "external-repos" | ||
| LABELS "external") | ||
| add_test(NAME external | ||
| COMMAND bash -- run-tests.sh --only-external ${ONLY_FREE} ${OS_NAME} | ||
| COMMAND bash -- run-tests.sh --jobs $ENV{CTEST_PARALLEL_LEVEL} --only-external ${ONLY_FREE} ${OS_NAME} | ||
| WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") | ||
| set_tests_properties(external PROPERTIES DEPENDS "rgbasm;rgblink;rgbfix;rgbgfx" # Only attempt building whole projects if each tool passes muster on its own. | ||
| PROCESSORS 4 | ||
| PROCESSORS $ENV{CTEST_PARALLEL_LEVEL} | ||
|
Comment on lines
+47
to
+50
Member
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. We cannot rely on this environment variable, as the parallelism may be specified via the CLI only, and this would plainly error out without the env var. We don't have access to that parameter at configure time, anyway, and the env var could also be set only when running We could try querying the number of logical CPUs (
Contributor
Author
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. Presumably the worst that could happen is the config-time |
||
| FIXTURES_REQUIRED "external-repos" | ||
| LABELS "external") # Allow filtering out external tests. | ||
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.
--parallel 0was not the "number of logical CPUs", it's "unbounded", same asmake -j.https://cmake.org/cmake/help/latest/manual/ctest.1.html#cmdoption-ctest-j:
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.
Annoying how this is inconsistent with other instances of
-j 0or-j. Thanks for noticing.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.
Aaah, wait, the behaviour is different for the environment variable!
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.
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.
A blank
CTEST_PARALLEL_LEVELvalue wouldn't be reusable for passing to the individual third-party repos asmake -j$ENV{CTEST_PARALLEL_LEVEL}. If you'd still prefer this to be empty as the number of logical CPUs, do you have any suggestion for what to do about that? (Also, shouldCMAKE_BUILD_PARALLEL_LEVELandCMAKE_INSTALL_PARALLEL_LEVELbe set to''instead of4in create-release-artifacts.yml?)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.
The
$ENVconcern is obsoleted by #1959 (comment). As for those other two variables, they have different behaviour...BUILD_uses the native tool's default (number of CPUs for Ninja, but 1 for Make);INSTALL_... doesn't specify, but I expect that it would reject 0 likeBUILD_does (I just tested that).Note also that since we aren't enabling the
INSTALL_PARALLELglobal property, the latter actually turns out to do nothing lol