Harden load/compile pipeline, generated bindings, and eq install - #1
Open
undivisible wants to merge 1 commit into
Open
Harden load/compile pipeline, generated bindings, and eq install#1undivisible wants to merge 1 commit into
undivisible wants to merge 1 commit into
Conversation
Compile C to PIC objects instead of preprocessing, honor LoadOptions compile/link, and make demo-app/full-demo actually compile and link. Align compiler argv and version probing with the working polyglot build, reject dangerous extra compile args, and sanitize identifiers in generated Rust. eq install now requires sudo confirmation, matches compiler names exactly, and no longer treats "c" as C#.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_dd5e858c-9db1-4008-b2cc-92d497687118) |
|
Tick the box to add this pull request to the merge queue (same as
|
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.
Summary
Implements the high-severity SAFE subset from the burn audit:
Honest
load()/compile_to_c-c -fPIC), not preprocessor output..o/.a/.c)..his copied for bindings.LoadOptions.compile/linkare honored. Binding errors surface asLoadError::BindingFailed.compile_args/link_argsare validated (no-fplugin,@response, output overrides,-Wl).demo-appandfull-demonow usecc+generate_bindings+include!and actually link.Polyglot TUI
polyglot.rstypechecks.Compiler argv /
find_compiler-fPIC -OReleaseFast. Nim: nimcache under the output dir,--app:staticlib --noMain --mm:none --passC:-fPIC. Odin:-file -reloc-mode:pic. C/C++/D: PIC.version_args(versionvs--version). Resolvedcompiler_pathis stored. C# also probesdotnet.compile_batchmaps thread panics toCompileErrorinstead ofunwrap.Generated Rust hardening
^[A-Za-z_][A-Za-z0-9_]*$; enum discriminants are integer literals only.eq installeq install cno longer installs C#.EQ_INSTALL_YES=1to opt in;EQ_INSTALL_NO_SUDO=1still skips system PMs).Command.current_dir(TEMP)instead of process-globalset_current_dir. Winget gets non-interactive accept flags.Follow-ups (not in this PR)
{.ffi.}/@ffihonesty and rust-ffi null checks.bindings.code, fmt gate, lockfile, dashboard.html).crepuscularity-tui(clone-alone).Test plan
cargo test --all-featurescargo clippy --all-targets --all-features -- -D warningscargo fmt -- --checkcargo builddemo-app and full-demo; ran both binariesNote
Medium Risk
Touches compile invocation, code generation from untrusted headers, and privileged package installs—important for security and build correctness, though guarded by validation and confirmations.
Overview
Hardens the FFI load/compile path and generated Rust bindings, and tightens
eq installbehavior.Load & compile: C now builds PIC objects (not preprocessor output), expects the correct artifact extension, copies sibling
.hfiles, and honorsLoadOptions.compile/link. Extra compile/link args are validated; binding failures becomeLoadError::BindingFailed. Demobuild.rsfiles usecc+generate_bindings+include!instead ofload().Bindings & imports: Generated code validates C identifiers, enum discriminants (integer literals only), and types via
c_type_to_rust_checked—unsupported or malicious header content is skipped with warnings instead of pasted into Rust.Compiler detection & argv: Stores resolved
compiler_path, per-languageversion_args, and PIC-oriented flags for Zig/Nim/Odin/C/C++/D. Batch compile maps worker panics to errors.eq install: Exact compiler name matching (fixeseq install cvs C#), interactive sudo confirmation (EQ_INSTALL_YES), sequential installs, winget non-interactive flags, and Windows UNC cwd handled per-subprocess.Polyglot GUI: Removes dead constellation animation code so
polyglot.rstypechecks.Reviewed by Cursor Bugbot for commit d238dfd. Configure here.