-
Notifications
You must be signed in to change notification settings - Fork 32
Print javascript stack trace #229
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
Conversation
Ok it looks like stack traces are very unstable wrt NodeJS version, which is unsurprising. Could you make it so that they only show when there's an unexpected runtime error? (As in: none of |
I have made the changes. Not sure if this is the best way to do this, but I just add a new parameter |
Thanks. I see the CI is still mysteriously failing with the |
I managed to reproduce the behavior on my machine. This behavior seems to be caused by how Some related posts on stack overflow (thanks to Ruqing who helped me to look into this issue): Below is my terminal history showing how the problem is reproduced. ~/c/mlscript (hkmc2-print-stack-trace)> git diff-files --exit-code # exit code 0
~/c/mlscript (hkmc2-print-stack-trace)> git status # no changes
On branch hkmc2-print-stack-trace
Your branch is up to date with 'anto/hkmc2-print-stack-trace'.
nothing to commit, working tree clean
~/c/mlscript (hkmc2-print-stack-trace)> echo x >> hkmc2/jvm/src/test/scala/hkmc2/ReplHost.scala # add something
~/c/mlscript (hkmc2-print-stack-trace)> truncate -s-2 hkmc2/jvm/src/test/scala/hkmc2/ReplHost.scala # undo the previous change
~/c/mlscript (hkmc2-print-stack-trace)> git diff-files --exit-code # now `git diff-files --exit-code` exit with 1, although there is no change in the contents of any file
:100644 100644 d9ccf26c987c5e29e8cda92004077828c62d064e 0000000000000000000000000000000000000000 M hkmc2/jvm/src/test/scala/hkmc2/ReplHost.scala
~/c/mlscript (hkmc2-print-stack-trace) [1]> git diff-files --exit-code -p # `git diff-files --exit-code -p` exit with 1, but do not show any diff
~/c/mlscript (hkmc2-print-stack-trace) [1]> git diff --exit-code -p # `git diff --exit-code -p` exit with 0
~/c/mlscript (hkmc2-print-stack-trace)> git diff-files --exit-code -p # `git diff-files --exit-code -p` now also exit with 0
~/c/mlscript (hkmc2-print-stack-trace)> git status # `git status` shows no changes
On branch hkmc2-print-stack-trace
Your branch is up to date with 'anto/hkmc2-print-stack-trace'.
nothing to commit, working tree clean
~/c/mlscript (hkmc2-print-stack-trace)> echo x >> hkmc2/jvm/src/test/scala/hkmc2/ReplHost.scala # add something
~/c/mlscript (hkmc2-print-stack-trace)> truncate -s-2 hkmc2/jvm/src/test/scala/hkmc2/ReplHost.scala # and undo the change again
~/c/mlscript (hkmc2-print-stack-trace)> git status # execute `git status` first
On branch hkmc2-print-stack-trace
Your branch is up to date with 'anto/hkmc2-print-stack-trace'.
nothing to commit, working tree clean
~/c/mlscript (hkmc2-print-stack-trace)> git diff-files --exit-code -p # after `git status`, `git diff-files --exit-code -p` exit with 0
~/c/mlscript (hkmc2-print-stack-trace)> git --version
git version 2.39.5 (Apple Git-154) |
Wow, thanks for looking into this! I wonder why this was never a problem before. I suppose the new diff-tests is overriding some files even though there are no actual changes. So what do you suggest to fix it? Fixing the root issue could actually make more sense. Could you commit the fix in this PR? |
Indeed I guess this was not a problem before because previous diff-tests will run For the fix I think although |
Thanks for the fixes! |
No description provided.