-
Notifications
You must be signed in to change notification settings - Fork 3k
Extend feature which displays errors/warnings as Link #6999
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
Extend feature which displays errors/warnings as Link #6999
Conversation
PR ARMmbed#6270 added a parameter which allows the user to decide in case of an error or warning to print the output as a link. This extension of this option also prints the ARM-GCC output in a link format.
@ARMmbed/mbed-os-tool can you please review? |
@0xc0170 can you pls request a review from "ARMmbed/mbed-os-tools" again, because I don't know how to do that 😏 |
@@ -988,6 +988,8 @@ def compile_command(self, source, object, includes): | |||
_, ext = splitext(source) | |||
ext = ext.lower() | |||
|
|||
source = abspath(source) if PRINT_COMPILER_OUTPUT_AS_LINK else source | |||
|
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.
Why is this change 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.
Because the GCC gives out what he gets, i.e. when you are passing relative paths the gcc prints out relative paths and vice versa.
@@ -433,7 +433,7 @@ def __init__(self, target, notify=None, macros=None, build_profile=None, | |||
self.build_all = False | |||
|
|||
# Build output dir | |||
self.build_dir = build_dir | |||
self.build_dir = abspath(build_dir) if PRINT_COMPILER_OUTPUT_AS_LINK else build_dir |
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.
Why is this change 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.
Because the GCC gives out what he gets, i.e. when you are passing relative paths the gcc prints out relative paths and vice versa.
@DBS06 I'm not so sure about the |
@theotherjimmy I am also very keen to avoid behavioral changes. I did that because the GCC gives out what he gets, i.e. when you are passing relative paths the gcc prints out relative paths and vice versa (see GCC Output). The other option would be to search inside the gcc output for relative paths to a file and exchange them "manually" with absolute paths, but I think giving the gcc absolute paths is more robust and a faster solution. |
@DBS06 These paths should be relative to the project root, correct? Is that a problem? |
@theotherjimmy to see it as a link (like in the picture) they should be absolute. if they are absolute, nearly every IDE can interpret them as a link. As described the GCC gives out what he gets, I thought it would be a cleaner solution to give the GCC absolute paths (if you want the option PRINT_COMPILER_OUTPUT_AS_LINK enabled), rather then parsing through the GCC-Output and replace every relative path with an absolute path. "GCC gives out what he gets" -> if you pass to the GCC an relative path, the GCC prints errors/warnings with a relative path and if you pass an absolute path, GCC prints errors/warnings with an absolute 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.
This is not as bad as I had initially thought: it only affects the source and destination dirs; not the include paths. This is a diff of < 100 bytes in command line length. I'm not super concerned about that.
@theotherjimmy nice 👍 |
Welp, let's see what the exporter CI says. /morph build |
Build : SUCCESSBuild number : 2197 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1824 |
/morph mbed2-build |
/morph uvisor-test |
1 similar comment
/morph uvisor-test |
Description
I already made a PR #6270 which offers a flag to displays errors/warnings as a Link to file and line.
I extended this feature to display, in case of an error, also the GCC output as a clickable link.
See here GCC Output.
The feature will be activated by setting
PRINT_COMPILER_OUTPUT_AS_LINK = True
in the application specificmbed_settings.py
.Pull request type