-
Notifications
You must be signed in to change notification settings - Fork 47
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
add check root dir #383
add check root dir #383
Conversation
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #383 +/- ##
==========================================
- Coverage 80.01% 78.57% -1.45%
==========================================
Files 56 56
Lines 3272 3290 +18
Branches 543 546 +3
==========================================
- Hits 2618 2585 -33
- Misses 615 654 +39
- Partials 39 51 +12
Continue to review full report at Codecov.
|
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 docblock / messages could be a bit clearer / more precise (and contain spelling mistakes) but let's first focus on the functional parts.
Why is the check limited to the build
and test
verbs? (Also the whole ticket description doesn't mention test
.)
colcon_core/verb/__init__.py
Outdated
:param str this_build_tool: The name of this build tool | ||
:raises RuntimeError: if marker file is found in parent directory | ||
""" | ||
original_path = Path(os.getcwd()) |
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.
Wouldn't it be clearer (easier to test, and more reusable) if the function would have the start path as an argument rather then getting it internally from global state?
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
@dirk-thomas Thanks for the timely review. I tried to address most of the comments, but not sure about a few.
Those are the only two verbs in
I added an arg |
Signed-off-by: claireyywang <[email protected]>
Thanks so much! This will be a very nice UX improvement. |
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.
Those are the only two verbs in
colcon-core
, and seem to address the feature request in #369. Is there anywhere else that could also use this check?
The same check seems to be applicable to several other verbs: graph
, info
, list
, test-result
.
colcon_core/verb/build.py
Outdated
@@ -116,6 +123,7 @@ def add_arguments(self, *, parser): # noqa: D102 | |||
self.task_argument_destinations = decorated_parser.get_destinations() | |||
|
|||
def main(self, *, context): # noqa: D102 | |||
check_and_mark_root_dir(context.args.start_path) |
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 think the invocation here in the verb is too late since e.g. the log
directory has already been created which isn't desired.
Signed-off-by: claireyywang <[email protected]>
Wouldn't it limit the usability of these verbs if they can only be invoked in root directory? |
Isn't that the whole idea of this PR - to limit the locations where |
I think the consequence of not running The idea of this PR is to address discussion in #139 and #369, which both point to the |
How about |
lol I've actually never used that verb. I'll take a look and see if I can add the root dir check to it as well. Thanks for the heads up. |
@claireyywang Friendly ping. |
What is the state of this PR? This as well as #487 are some quite significant UX improvements that people who start out in ROS 2 (coming from ROS 1) find very much annoying. If @claireyywang is not available anymore, I would take a look at it. But I don't want to invest time and effort only for it to end up like #487. |
We will address this with a separate colcon extension. There has been discussion in #139. I'll close this PR since this isn't the approach we plan to take. |
Adds a
.root_dir
marker file when first building a workspace. Check for.root_dir
file wheneverbuild
ortest
verbs are invoked, terminate command if marker file not found. closes #369What this PR does not cover:
colcon build
is invoked in~/
, no error/warning will be output by this function, and a marker file will be generated in~/
.colcon
file for this warning function to work properlyTo test this function, follow build from source instruction here https://colcon.readthedocs.io/en/released/developer/bootstrap.html, then run
colcon build
in different directories to see the error msg.Terminal output if
colcon build
in child dir:still need to add test cases...