-
Notifications
You must be signed in to change notification settings - Fork 326
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
Report Warning in the CLI Execution #9749
Comments
With #9773 I can do GraalVM Insight experiment... Define Insight Script in JavaScriptCreate a file let mod = Polyglot.eval("enso", `
from Standard.Base import Warning, Meta
h o = Warning.has_warnings o
w o = Warning.get_all o . at 0 . to_text
t o = o.to_text
`);
let h = mod.eval_expression("h")
let w = mod.eval_expression("w")
let t = mod.eval_expression("t")
function detect_warnings_among_local_variables(ctx, frame) {
print(`Detecting warnings at the end of ${ctx.name}`);
for (let n in frame) {
let o = frame[n];
if (h(o)) {
print(`value of ${n} is ${t(o)} has warning ${w(o)}`);
}
}
insight.off('return', detect_warnings_among_local_variables)
}
insight.on('return', detect_warnings_among_local_variables, {
roots: true,
rootNameFilter : ".*main"
}); it contains a mixture of Enso and JavaScript code. The JavaScript part "attaches itself" to end of execution of any method with a name that matches Run any Script with InsightCreate an Enso file with JAVA_OPTS=-Dpolyglot.insight=enso_insight.js ./built-distribution/enso-engine-*/enso-*/bin/enso --run Main.enso
Detecting warnings at the end of local.Main::local.Main::main
value of operator32735 is /tmp/temp_file_ensodryrun6824262491422756151.xlsx has warning Warning Only a dry run has occurred, with data written to a temporary file. Press the Record Once button ❙⬤❙ to write the actual file. the |
While investigating #9749 a JavaScript call to `Polyglot.eval("enso", ....).eval_expression("id")` was made. It crashed as JavaScript isn't using `String` but `TruffleString` to represent strings.
Jaroslav Tulach reports a new STANDUP for yesterday (2024-04-24): Progress: -
|
Jaroslav Tulach reports a new STANDUP for yesterday (2024-04-25): Progress: -
|
Jaroslav Tulach reports a new STANDUP for yesterday (2024-04-26): Progress: - removed Truffle from
|
Jaroslav Tulach reports a new STANDUP for yesterday (2024-04-29): Progress: - reopened QA for #9635 (comment)
|
Jaroslav Tulach reports a new STANDUP for yesterday (2024-04-30): Progress: - presentation for GeeCON: prepare & rehersal
|
As part of changes for #9749, let's rewrite the launcher to Java.
One of the problems of the GraalVM Insight is the need to mix Enso and JavaScript. One way to avoid that is to make sure
That could be done if we pretended that
|
The AtTheEndOfFirstMethod code gives us alternative way (other than GraalVM Insight) to stop at the end of main method execution. There already is :list command and it can be used to dump local variables and their warnings. CCing @radeusgd |
Can we also return a non-zero exit code if errors occur in main. |
The current plan:
|
Jaroslav Tulach reports a new STANDUP for yesterday (2024-08-16): Progress: - Outdated launcher merged: #10779
|
Jaroslav Tulach reports a new STANDUP for yesterday (2024-08-17): Progress: - 10% speedup: #10837 (comment)
|
Jaroslav Tulach reports a new STANDUP for yesterday (2024-08-18): Progress: - warnings to stderr: 4fda04b
|
Jaroslav Tulach reports a new STANDUP for yesterday (2024-08-19): Progress: - meetings and discussions It should be finished by 2024-08-20. |
Jaroslav Tulach reports a new STANDUP for yesterday (2024-08-20): Progress: - addressing review comments: #10842
|
Jaroslav Tulach reports a new STANDUP for today (2024-08-21): Progress: - merged: #10842
|
Currently, if you run a script in the CLI any warnings produced will be swallowed silently.
It would be good if any warning that occurs in the
main
method variables are sent to the logging system so can be seen by the user and captured into Elastic.The text was updated successfully, but these errors were encountered: