Skip to content

feat: add --debug-compile-stdin to read main.nr from STDIN for testing#8253

Merged
michaeljklein merged 10 commits intomasterfrom
michaeljklein/debug-compile-stdin
Apr 30, 2025
Merged

feat: add --debug-compile-stdin to read main.nr from STDIN for testing#8253
michaeljklein merged 10 commits intomasterfrom
michaeljklein/debug-compile-stdin

Conversation

@michaeljklein
Copy link
Contributor

Description

Problem*

Prerequisite of #7991

Summary*

  • Accept main.nr from STDIN when --debug-compile-stdin is enabled
  • Use an implicit Nargo.toml

Additional Context

Not testing here because I plan to add tests in a follow up PR, but I could add a smoke test

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@michaeljklein michaeljklein requested a review from a team April 28, 2025 20:13
@michaeljklein michaeljklein marked this pull request as ready for review April 28, 2025 20:13
@michaeljklein michaeljklein requested review from a team and vezenovm April 30, 2025 18:08
@asterite
Copy link
Collaborator

I'm trying it like this:

echo "fn main() {}" | nargo compile --debug-compile-stdin

and I get this error:

Cannot find file src/main.nr which is defaulted due to specifying `type = "bin"` in Nargo.toml

I think it's erroring before reaching the new conditional.

@michaeljklein
Copy link
Contributor Author

@asterite where does nargo point to on your path?

With $NARGO="target/debug/nargo", I'm getting:

❯ cat src/main.nr | $NARGO compile --debug-compile-stdin
❯ echo "fn main() {}" | $NARGO compile --debug-compile-stdin
❯ echo "fn main() {}" | $NARGO compile --debug-compile-stdin --print-acir
Compiled ACIR for main (unoptimized):
func 0
current witness index : _0
private parameters indices : []
public parameters indices : []
return value indices : []

@asterite
Copy link
Collaborator

Huh, now it's working. I did git pull, I don't know if the last merge did it, or maybe I was at an old point (though it was the first time I jumped into this branch).

I guess nevermind then, sorry!

@michaeljklein
Copy link
Contributor Author

@asterite all good

Copy link
Collaborator

@asterite asterite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@michaeljklein michaeljklein added this pull request to the merge queue Apr 30, 2025
Merged via the queue into master with commit 77b2261 Apr 30, 2025
115 checks passed
@michaeljklein michaeljklein deleted the michaeljklein/debug-compile-stdin branch April 30, 2025 19:59
github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request May 1, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat: add `--debug-compile-stdin` to read `main.nr` from `STDIN` for
testing (noir-lang/noir#8253)
feat: better error message on unicode whitespace that isn't ascii
whitespace (noir-lang/noir#8295)
chore: update `quicksort` from iterative `noir_sort` version
(noir-lang/noir#7348)
fix: use correct meta attribute names in contract custom attributes
(noir-lang/noir#8273)
feat: `nargo expand` to show code after macro expansions
(noir-lang/noir#7613)
feat: allow specifying fuzz-related dirs when invoking `nargo test`
(noir-lang/noir#8293)
chore: redo typo PR by ciaranightingale
(noir-lang/noir#8292)
chore: Extend the bug list with issues found by the AST fuzzer
(noir-lang/noir#8285)
fix: don't disallow writing to memory after passing it to brillig
(noir-lang/noir#8276)
chore: test against zkpassport rsa lib
(noir-lang/noir#8278)
feat: omit element size array for more array types
(noir-lang/noir#8257)
chore: refactor array handling in ACIRgen
(noir-lang/noir#8256)
chore: document cast (noir-lang/noir#8268)
END_COMMIT_OVERRIDE

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants