Skip to content

[test][platform:linux] First Linux/Android cargo test run: 573/578 green, the 5 failures are environment leakage not behavior — bind_builtins quartet loads the host inputrc (GNU-correct; INPUTRC=/dev/null → 4/4 green), /-listing test assumes a listable root #610

Closed

Description

@caomengxuan666

Result summary

First-ever cargo test --workspace --locked on Android/Termux aarch64 (bionic, 6-core): 573 passed / 5 failed / 0 ignored (2.03 s). All five failures are environment leakage into test expectations, not behavior divergence — after isolating the environment, this run shows zero product failures on the platform. (The subsystems the current perf work touches — arithmetic, parameter expansion, assignment — are green on-device: cargo test --lib arithmetic parameter → 51/51.)

Failures 1-4: the bind_builtins quartet — the host inputrc leaks in

Evidence:

  • They fail deterministically in a fresh single-test process (--test-threads=1 --exact <name>, one process per test), with the same numbers as the parallel run — so this is not test pollution:
    • generation_changes_on_mutation_only — after bind -p >/dev/null (a pure listing) the registry generation is 6 where before was 0 (bind_builtins.rs:914);
    • bind_x_listing_and_removal_round_trip — bind -m emacs-standard -x ... records keymap == None, expected Some("emacs-standard") (:878);
    • bind_x_registration_is_visible_and_process_global_across_clones — one bind -x yields snapshot len 3, expected 1 (:854);
    • macro_and_function_bindings_register_and_unbind_by_function — two bind commands yield len 4, expected 2 (:893).
  • Root cause verified by isolation: INPUTRC=/dev/null cargo test ... → 4/4 pass. This host has a Termux system inputrc ($PREFIX/etc/inputrc, standard GNU emacs-mode escape bindings) and a user ~/.inputrc. The bind engine's first-use inputrc load injects the host's bindings and mutates the generation — which is correct GNU behavior: on the same device, bash -c 'bind -p' lists 399 bindings including inputrc-defined ones ("\C-q": quoted-insert). GNU's bind -p/bind -x also run against the loaded inputrc; rubash matches it.
  • Why it was never seen: the dev loop runs on Windows, where no inputrc exists and the bare-environment assumption holds. The subsystem landed 2026-10-05 (b1a88dc, "feat(bind): real bind builtin") and was never executed on a Unix host until now — despite Android binaries shipping.
  • Fix (test-side): pin the environment in these tests — set INPUTRC to a controlled empty file (and/or isolate HOME) before Executor::new() so the registry starts from a known state on every host. Tests that intend to exercise inputrc loading should get an explicit fixture inputrc instead of inheriting the host's. Per AGENTS.md's "fix the wrong invariant" rule: the invariant "the bind registry starts empty" is only true on bare hosts; make it true by construction.

Failure 5: compspec_file_action_lists_root assumes a listable /

  • The test runs the file action on "z /" and asserts non-empty directory candidates. On this device (locked-down Android policy), opendir("/") is denied: ls / → Permission denied, os.listdir('/') → EACCES. An empty candidate list is the correct answer here.
  • Fix (test-side): seed the file action against a directory the test controls (temp-dir fixture) instead of /, or skip when / is unreadable.

Impact

  • Not a product bug — the engine is behaviorally green on Android once the two environment leaks are pinned (expected baseline after fixes: 578/578).
  • Real cost anyway: any human or agent running the sanctioned fast loop (cargo test --workspace --locked) on a Unix host sees 5 reds that read exactly like platform divergence — a standing invitation to "fix" behavior that is GNU-correct (the AGENTS.md failure mode this repo already bans elsewhere). Now that Android binaries ship, the suite needs a Unix-clean baseline.

Repro

cargo test --workspace --locked                    # 573/578 — the 5 failures above
INPUTRC=/dev/null cargo test --lib --locked -- \
  --test-threads=1 executor::bind_builtins          # 4/4 green
ls /                                                # Permission denied (this device class)
bash -c 'bind -p' | grep quoted-insert              # GNU does the same inputrc surfacing

Related

Activity

  1. added
    bug
    platform:linux
    P2-medium
    on Oct 15, 2026
  2. caomengxuan666 commented on Oct 15, 2026

    @caomengxuan666
    MemberAuthor

    已认领并确认:5 个失败中 bind quartet 是宿主 INPUTRC 环境泄漏(INPUTRC=/dev/null 后 4/4 通过),根目录 listing 用例是假设平台根目录可列出。将分别修测试隔离/平台前置条件,不改 shell 语义。

  3. caomengxuan666 commented on Oct 15, 2026

    @caomengxuan666
    MemberAuthor

    Verified: #613's isolation holds on-device — a full cargo test --workspace --locked with the host inputrc present now passes the entire --lib target (578/578, 1.83 s; fail-fast only reaching --test cli_tests proves lib was green without any INPUTRC override), and the bind quartet + compspec no longer fail in any environment. The reported 5 failures are fixed. Follow-up: reaching cli_tests unmasked 24 pre-existing Android-red tests (strict subset of the 33 at e785; this batch fixed 9, regressed 0) — triaged by root cause and filed as #615 so this issue's scope stays closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2-mediumbugplatform:linux

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions