Repository navigation
fix 10 cross-platform conformance xfails - #781
Conversation
475f779 to
7b4cf3c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f8b6bcbde
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9cfdf09c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a053e9594a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| file := r.currentCallFile() | ||
| line := r.currentVisibleLine(0) | ||
| if file == "" || file == "stdin" || line == 0 || strings.HasSuffix(file, " trap") { | ||
| return msg | ||
| } | ||
| return fmt.Sprintf("%s: line %d: %s", path.Clean(file), line, msg) |
There was a problem hiding this comment.
Preserve caller line for eval control-flow diagnostics
controlFlowBuiltinErrorf always uses currentVisibleLine(0), which is the line number inside the currently parsed chunk. When break/continue/top-level return are triggered via eval, the chunk is parsed from runShellReader(..., name="") and lines restart at 1, but currentCallFile() still points to the outer script path; this produces misleading errors like <script>: line 1 instead of the actual callsite line. This regression affects file+line diagnostics added in this commit for control-flow builtins invoked through eval.
Useful? React with 👍 / 👎.
Summary
This PR clears 10 cross-platform (
darwin+linux) conformance xfails in the OILS suite and removes those entries frominternal/conformance/manifest.json.The fixes cover:
builtin-getopts: keepOPTARGset to""for no-arg options underset -ubuiltin-getopts: restore theOPTIND narrowed downcasestrict-options: sourced top-levelreturnstrict-options: top-level control-flow diagnosticsstrict-options: errexit and top-level control-flow diagnosticshere-doc: multiple pipeline here-doc FDshere-doc: multiple pipeline here-doc FDs on multiple linespipeline: initialPIPESTATUSremains unset until materializedbuiltin-trap-bash:trap RETURNbuiltin-trap-err: redirect-only ERR trap line accountingRoot Cause
A few separate runtime/interpreter mismatches were involved:
returnbecause chunked execution did not stop onreturningfile: line N:diagnostics for real script files$LINENOPIPESTATUSwas being materialized too early for compound wrappersgetoptsneeded bash-compatible empty-OPTARGhandling for successful no-arg optionsValidation
Ran:
go test ./internal/shell/interp -run 'Test(Getopts|PIPESTATUS|SourceReturnTrap|TopLevelControlFlow|ErrTrap)' -count=1go test ./internal/runtime -run 'Test(PipelineRegressionNestedShellCommandsInheritHereDocFDs|ErrTrapRegressionCommandStringLeadingBlankUsesSpecLineNumbers)$' -count=1GBASH_RUN_CONFORMANCE=1 GBASH_CONFORMANCE_BASH=$(./scripts/ensure-bash.sh) go test ./internal/conformance -run 'TestConformance/bash/oils/(builtin-getopts|strict-options|here-doc|pipeline|builtin-trap-bash|builtin-trap-err)\\.test\\.sh/(OPTARG_is_empty_\\(not_unset\\)_after_parsing_a_flag_doesn'"'"'t_take_an_arg|OPTIND_narrowed_down|Sourcing_a_script_that_returns_at_the_top_level|top_level_control_flow|errexit_and_top-level_control_flow|Multiple_here_docs_in_pipeline|Multiple_here_docs_in_pipeline_on_multiple_lines|Initial_value_of_PIPESTATUS_is_empty_string|trap_RETURN|trap_ERR_with_redirect)$' -count=1make lintNotes
A broader file-level conformance sweep for these same files still shows unrelated, non-target failures, mainly older trap
LINENOmismatches and the neighboringbuiltin-getopts.test.sh::OPTIND after multiple getopts with different speccase. Those were left out of this batch intentionally.