-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Linker compliance tests failing with source map errors #51647
Labels
area: compiler
Issues related to `ngc`, Angular's template compiler
Milestone
Comments
devversion
added
the
area: compiler
Issues related to `ngc`, Angular's template compiler
label
Sep 4, 2023
1 task
Submitted babel/babel#15930 on the Babel side to see if this is the expected behavior on their side. Still seems wrong to me at first glance, but unclear if it will be a wontfix. |
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 4, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 5, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 5, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 8, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 8, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 8, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 11, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 11, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 12, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 12, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 12, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 13, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 13, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 13, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 13, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 14, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 14, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 16, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 17, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 19, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 19, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 20, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 20, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 20, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 20, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 20, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Dec 20, 2023
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Jan 3, 2024
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
devversion
added a commit
to devversion/angular
that referenced
this issue
Jan 3, 2024
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647.
atscott
pushed a commit
that referenced
this issue
Jan 4, 2024
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via #49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. #51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via #51647. PR Close #53571
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this issue
Jan 23, 2024
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647. PR Close angular#53571
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this issue
Jan 26, 2024
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647. PR Close angular#53571
danieljancar
pushed a commit
to danieljancar/angular
that referenced
this issue
Jan 26, 2024
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647. PR Close angular#53571
amilamen
pushed a commit
to amilamen/angular
that referenced
this issue
Jan 26, 2024
The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via angular#49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. angular#51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via angular#51647. PR Close angular#53571
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which @angular/* package(s) are the source of the bug?
compiler-cli
Is this a regression?
Yes
Description
Our linker compliance tests are failing with many hundreds of unmet expectations due to broken source mappings being generated. This started happening as we updated Babel via #49914.
Aside from other regressions in compliance output due to the tests not running, the real mapping errors surface a real issue where it's not yet quite clear whether we need to adjust or Babel introduced a bug.
I've investigated this deeply and digged into internals of Babel and have a good understanding of the source map generation when translating AST to text. Let's have a look at one failure.
Right now this is broken and the mapping points to a totally unrelated source span. At first glance, this seems magical and it's unclear why this is happening. Debugging the linker Babel ast factory and host, it turns out that we are actually properly trying to set the source map information for e.g.
CallExpressions
toelementStart
- still with the right offsets.An initial assumption was that we somehow regressed/broke our source map flattening in ngtsc. Something that is non-trivial to understand very easy to break. I've tried to look directly at the intermediary sources, instead of relying on the flattened source map- and the incorrect mappings were still visible. Hence the flattening is not the culprit.
Going deeper, with more reversing of Babel's generator/traversal- I've assumed that somehow the printer is not picking up our source map information. e.g.
node.loc
may no longer be correct. Turns out this is still the valid field- so our logic is correct. Going further, I noticed that the traversal and state of "current source span" (it's a shared state in the AST printer in Babel) is unexpectedly reset in node traversal. e.g.Babel basically sets the span for the call expression, but then when the call expression is printed, it goes deeper into the member expression -> then the core import. The core import then causes another span to become the "current source span" but never is reset to the parent span when the we go up the tree again (in-order printing). This then results in the mapping to be incorrect. Everything after
i0
ends up following the source span of the core import and the actualCallExpression
source span is ignored.This started happening with babel/babel@4f4b450#diff-192a3f85cae6c8a5d19e16b083d4c421b517650b00a0e8ae10cf80cb1ce7d941R590. Previously the source spans were always reset to the previous ones, when e.g. a child node completed printing.
Possible fixes:
Consider working with Babel to see if the changes actually make sense. It seems odd that a child node AST location would affect the source mappings from a higher-level source mapping that spans over the rest of children. The granularity introduced seems acceptable- but also not sure about size here. In either case the locations seem wrong.
Ensure the import does not have a span. I determined the import always has a span because we are re-using the original AST node from the
ngImport
field of partial declarations. We cannot should likely not do this in the translator as that one is agnostic to e.g. Babel/TS AST.Keep the source span for the import, but instead make sure that the followed printed text of the call expression (
i0.elementStart(xxx)
) has the proper span to the HTML sourcePlease provide a link to a minimal reproduction of the bug
Here is a reproduction showing the incorrect source mappings:
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: