Repository navigation
fix(interpreter): close Oils type/hash, redirect, here-doc, shell-option and special-variable gaps - #2644
Merged
Conversation
…ion and special-variable gaps type/hash follow bash (flags, hashed paths, relative PATH entries, a bounded command hash table); eval/source accept `--`; shopt knows bash 5.2's options and defaults; test gains -v/-o; SHELLOPTS/BASHOPTS are computed readonly variables and `export SHELLOPTS` reaches child shells; bash parses -c/-O/+O/-/-- like bash. Redirect targets expand once (ambiguous redirect, failglob, no globbing of quoted text); 2>&1 merges stderr in write order for groups, functions, scripts, eval, source and child shells; 1<&2, exec N>&M-, per-command N<<EOF fds, `<&N` on a closed fd, noclobber for &>, here-doc line continuation. $_, $BASHPID, readonly UID/EUID/PPID, env -i startup variables, LINENO in for (( )), GNU wc padding. Oils spec 78.8% -> 82.1% (2120 -> 2211 of 2692), no new misses.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 49217b1 | Commit Preview URL Branch Preview URL |
Oct 08 2026, 03:34 PM |
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
Closes 91 more Oils spec cases in
type/hash,command, redirects, here-docs, shell options and special variables. No file gains a new miss.type/hash: full flag set (-a -f -P -p -t). The lookup order matches bash. A bounded command hash table (512 entries) addshash -r -d -t -l -pandset +h, andPATH=clears the table. A non-executable file on PATH now fails with 126.eval/source: accept--.sourcesearches PATH, whichshopt -u sourcepathturns off.shopt,SHELLOPTS,BASHOPTS: bash 5.2's full option list with its defaults.SHELLOPTSandBASHOPTSare computed and readonly, and an exportedSHELLOPTSreaches child shells.test -vandtest -onow work.env -i bashgets bash's minimal environment, and/usr/bin/bashstarts a real child shell.-c,-O/+Oand-o/+oare parsed the way bash does.2>&1, stderr is interleaved in write order across groups, functions, scripts,eval,sourceand child shells.1<&2andexec 6>&5-work.N<<EOFandN<<<won a function, script or group are visible inside it.<&Non a closed fd gives "Bad file descriptor", and&>honours noclobber.$_is tracked.$BASHPIDchanges in each subshell. UID, EUID and PPID are readonly.$LINENOinsidefor (( ))reports theforline.wc: counts are padded the way GNUwcpads them.Why
This is step 1 (fidelity) and step 5 (measurement) of the level-up roadmap: closing the largest groups of Oils misses outside the areas the BashBox work owns.
Before / After (verified)
Full Oils run, saved as
scripts/oils-spec/results/oils-spec-linux-x86_64-20261008T152730Z:Per-file misses, before → after:
Files that pass completely went from 28 to 36. The bash oracle is unchanged at 104/102.
A new regression file,
redirect-and-shell-builtins.test.sh(24 cases), was checked against bash 5.2. The remaining misses are documented inlimitations.md: FIFO<>, interactive-only cases, the empty-by-design startup environment, and$LINENOin a top-level(( )).Risk
depth_32case needs 1,891,601 bytes, which is 3.6 KB over main and well under CI's 2 MB stack. Redirect preparation and builtin output now run in boxed futures to keep the hot path small.tm_dos_060now uses a budget of 1, because$_exists at startup and isn't counted.ln.test.shusescd /tmp/, so the bash comparison maps the path to a private directory.Checklist
-D warningsjust check-okf,just check-doc-linksGenerated by Claude Code