Copies of exported #include headers should refer to the original files
Categories
(Firefox Build System :: General, enhancement)
Tracking
(Not tracked)
People
(Reporter: mozbugz, Unassigned)
Details
Header files that are EXPORTed (as per moz.build) are copied verbatim into $OBJDIR/dist/include and arbitrary subdirectories (so it's not obvious to connect from the copied file to its origin).
This has a few side effects:
- During builds, error&warning messages refer to copied files.
- Because of that, if building from an IDE, clicking on an error/warning opens the copied file; The unaware dev may try to fix the error there and be confused by the error re-occurring, and worse the fix may be lost when the corrected file is overwritten by another copy.
- When debugging, the debugger uses the copied file, which may also confuse the dev if they want to modify the code from there.
It would be great if the build system could mitigate these risks somehow.
A couple of ideas:
- Instead of copying the full file, its content could be replaced with an #include that points at the original file. (I don't know if that would work.)
- Copied files could have a
#line 1 "/full/path/to/original/header.h"inserted at the top. A quick test building on Windows, and debugging with vscode, worked.
Comment 1•6 years ago
|
||
We're aware of the issue and we have a way forward which we'll be working on at some point in the future. Follow bug 1591450 for more :)
| Reporter | ||
Comment 2•6 years ago
|
||
Thank you Ricky, good to know.
I would argue that my bug here (copies should refer to originals) is not strictly a duplicate of bug 1591450 (don't make copies), but of course the latter would render the former moot.
I hope that bug 1591450 can get resolved soon.
If not (too hard, or taking a long time), please consider this (I hope) simpler option, at least as a temporary accommodation that could help a lot of people. 😉
Description
•