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
cmd/compile: ssa debug does not regenerate/update ssa.html #31290
Comments
Using:
I see the content printed to stdout is correct, only the file |
I can reproduce. I don't think it is what you think it is, though.
I get 6, not 0. I agree it would be nice to make the ssa.html output repeatable. @josharian @ysmolsky |
@randall77 can you try with other function name instead of p? A name that you’ve never used before. |
Why would that matter? |
@randall77 yes, but if you removed ssa.html, compiler never generate it again for that function name. Using another function name works. |
True, |
Oh yeah. I am very well aware of this issue with |
A quick search-and-replace of "<" with "\n" in the ssa.htmls yields a diff like: 1131c1131
< span class="stats">[10569 ns]
---
> span class="stats">[11420 ns]
1543c1543
< span class="stats">[5937 ns]
---
> span class="stats">[6914 ns]
1953c1953
< span class="stats">[1263 ns]
---
> span class="stats">[1791 ns]
2363c2363
< span class="stats">[11318 ns]
---
> span class="stats">[24605 ns]
2623c2623
< span class="stats">[4633 ns]
---
> span class="stats">[8060 ns]
2883c2883
< span class="stats">[11829 ns]
---
> span class="stats">[14419 ns]
3179c3179
< span class="stats">[502 ns]
---
> span class="stats">[639 ns] I don't care much about the timing info, so we could remove it. Not sure how much it matters vs perfect reproducibility. |
Ah, that makes sense. I was worried it was something nondeterministic about the compiler. Might be kind of nice to have timing info only if you ask for it with a flag. |
From the perspective of It is, quite literally, treated as go/src/cmd/go/internal/work/exec.go Lines 231 to 238 in 3cb92fc
|
Latest victim of this. I was testing something with a freshly minted compiler and then compared with go1.12. And when I went back to generating with the tip, then the result was same as go1.12 ! When it happened the first time, I thought maybe I had made a mistake the first time. Was stuck quite some time with this. I got totally stumped when I deleted the file but it never generated it again ! Then I decided to rebuild the compiler with an incorrect instruction, and then saw it generate again. Only then I remembered there was an issue like this, and came to add my report. What is the general guideline to workaround this ? Renaming functions work, but is that what everyone does ? |
I met this again using |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
file p.go:
Edit
p.go
to become:Then:
Seems good. Change
p.go
to original content, mean remove linei = 1
. Then:What did you expect to see?
ssa.html
content always update, and file is re-created after deleting.What did you see instead?
Content never updates from 3rd run, file is not re-created after deleting.
The text was updated successfully, but these errors were encountered: