-
Notifications
You must be signed in to change notification settings - Fork 27
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
Args options for CMake --build
and --install
#110
Open
KazNX
wants to merge
3
commits into
colcon:master
Choose a base branch
from
KazNX:feature/cmake-build-args
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This regex is insufficient to catch other job-like flags in Make.
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.
With respect to the functional overlap, I agree there's some conceptual overlap between
_have_job_arg
and_get_make_arguments
, but the logic is distict. They are both capturing information from different places and for different use cases._have_job_arg
is testing whether the command line has specified a number of jobs to use, while_get_make_arguments
is implicitly looking upMAKEFLAGS
from the environment variable for similar arguments in order to pass this through to the build. Really_have_job_arg
is trying to ascertain whether we need to call_get_make_arguments
.I'm not sure how this could gracefully merged into
_get_make_arguments
becasue we don't actually need to do anything when_have_job_arg
is true. The semantics of the name_get_make_arguments
really don't fit this either. The name implies it's pulling variousmake
arguments into the command line being constructed, but it actually only extracts the job arguments.Overall I'm not a fan of the
MAKEFLAGS
extraction primarily because it's taking an environment variable associated withmake
and implicitly using it with other, nonmake
programs. Presumbly, invokingmake
will already get the job arguments fromMAKEFLAGS
because that's whatMAKEFLAGS
is designed to do. Ninja doesn't look like it has an equivalent and this looks like a bit of a hack and explicitly supporting job arguments when invoking colcon makes it obsolute.I'd argue that coclon is actually subverting
MAKEFLAGS
and would suggest that having this PR makes thisMAKEFLAGS
usage obsolete. Both functions could be deprecated and removed in future.I had concidered renaming
_get_make_arguments
but decided to keep it siloed and avoid diving to deeply into the intended behaviour of_get_make_arguments
.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.
With respect to the regular expression what flags are you thinking it will miss?
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.
All of these are flags affect the job server:
colcon-cmake/colcon_cmake/task/cmake/build.py
Lines 294 to 302 in ecf417d
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.
I was actually avoiding handling
-l
becuause that's on its own doesn't use jobs.However, your link does highlight a way I could resolve both issues above. Would you be satisfied with pulling out the job args parsing regular expressions into its own function for both
_have_job_arg
and_get_make_arguments
to use? This way the parsing is unified, but each function can continue to parse from different places as is needed.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.
Actually, some of these are not valid for the command line and are only valid for
make
. It looks likeninja
doesn't only uses the-j
and-l
abbreviations and does not support--jobs
or--load-average
. I can see the complexity of determining whether to parseMAKEFLAGS
or not exploding.