fix: Update proc-macro2 usage for latest nightly#3663
Conversation
proc-macro2 usage for latest nightly
proc-macro2 usage for latest nightlyproc-macro2 usage for latest nightly
|
as far as I can tell it also affects stable, not only nightly (at least on my local build) |
|
Replace the respective error line with 📁 File:
📝 Line 499:let source_path = proc_macro2::Span::call_site().file(); |
|
I'm facing this problem too even though I use stable version of rustc. |
|
same. Not only nightly |
acheroncrypto
left a comment
There was a problem hiding this comment.
Thanks for the quick fix.
We're also planning to make the IDL generation use the stable compiler by default and make code that required nightly optional via a CLI flag to avoid issues like this one. It sounds like these methods will be stabilized (as mentioned in rust-lang/rust#139671), so we might be able to avoid nightly completely when that happens.
Related: There is an open issue (rust-lang/rust#139903) regarding the naming of local_file.
|
Is anything that I can help maybe?, I need this fix ASAP. Also, I want to tell the CI failed |
|
@hryer we're waiting on the update and I'll check into the CI |
|
Hello. Is this going to be released as a hotfix for Anchor v0.31.0? |
|
Please fix it ASAP. |
|
having the same issue |
this is the temporary fix that worked best for me: |
|
Facing the same issue. |
i can't find this file , where would i locate it ? |
|
Using |
so how do i generate IDL for frontend use ? |
acheroncrypto
left a comment
There was a problem hiding this comment.
We're most likely going to make a patch release for this issue. Thanks for the fix and also responsiveness!
|
Hi, how to pull these changes? Will it be released in anchor 0.31.1? |
|
How will these changes be reflected? In anchor 0.31.1 ? |
|
anchor-cli 0.31.0 |
|
Is it fixed? |
|
So what's the solution? |
Update to anchor 0.31.1 which was released today |
please check the issue, I figured out the issue yesterday but today I am facing a new issue |
|
@hryer this line: let source_path = proc_macro2::Span::call_site().source_file().path(); |
|
For anyone still runing into this issue: Make sure you're using
|
|
Getting below error while using
Error no method named error[E0599]: no method named |
have you tried reverting proc_macro2 v0.1.95 to proc_macro2 v0.1.94? |
|
Hi @0xm4ud ,
With below configuration
I am getting this error no method named |
|
@rotcan I saw that error this morning. What I did was: cargo update -p proc-macro2, rustup override set 1.81, which solved it for me. |
|
@0xm4ud , still getting same error with below setting :(
no method named |
|
@rotcan hmm.. cargo update -p proc-macro2 should've changed/updated your proc-macro2 version, but by your post I see still is 1.94, try removing the lib /proc-macro2-1.0.94/directory and running cargo update -p proc-macro2 again. |
|
@0xm4ud Got it working thanks. I deleted proc-macro2-1.0.94 & 95 directory and anchor-syn-0.31.1 directory in cargo registry. Then ran rustup update. |
|
Was confused by people saying you need nightly rust. You don't need to be using nightly in your workspace, but you DO need to update your nightly because anchor idl generation uses it. Make sure you have run |
|
this works for me:
|
Splits the mint flow into two on-chain instructions to support the Bonsol
callback signing model (where the prover PDA — not the user authority —
signs the mint):
1. init_lote(): permissionless reservation of LoteAccount, called by
the client BEFORE submitting the proof request to Bonsol. Binds
the lote to the expected execution_account PDA derived from the
execute_v1 args.
2. mint_from_proof(): refactored to be a true Bonsol callback handler.
Validates execution_request via vendored handle_callback (key,
owner=Bonsol, signer, image_id), then populates the pre-reserved
lote and mints the 3 assets.
Account changes:
- LoteAccount: +execution_account (Pubkey), +is_minted (bool)
- MintFromProof accounts: removed init/payer/authority/system_program,
added execution_request (UncheckedAccount). 13 -> 9 boxed fields.
- New InitLote accounts struct (cpa, lote, payer, system_program).
Other:
- Add IMAGE_ID_HEX const + #[cfg(test)] cross-validation with IMAGE_ID
- Add MRV_OUTPUT_SIZE / CALLBACK_PAYLOAD_SIZE constants for host-runner
to construct the callback_instruction_prefix correctly
- New errors: AlreadyMinted, PeriodoMismatch
- Drop orphan helper output_bytes_extract_periodo
- bonsol_callback.rs: silence dead_code warning on input_digest field
(reserved for future audit-trail use)
Validation:
- cargo build-sbf: clean (~325KB, 9 boxed accounts in MintFromProof)
- cargo test --lib: 3 host-side tests pass
KNOWN ISSUE: anchor test fails to build IDL due to anchor-syn 0.30.1
hard-dependency on proc_macro::SourceFile (removed from rustc) combined
with proc-macro2 1.0.94 unable to compile on modern toolchains. This is
the upstream bug fixed in anchor 0.31.1 (PR otter-sec/anchor#3663),
not backported to 0.30.1. Confirmed unfixable by Rust version pinning:
no Rust version satisfies both edition2024 (cargo deps) and proc_macro::
SourceFile availability simultaneously.
TS tests are deferred to end-to-end devnet integration (Stage 6 of the
hackathon roadmap), where init_lote and the callback path are exercised
against a real Bonsol prover. Plan: stay on Anchor 0.30.1 through the
hackathon submission, evaluate upgrade to 0.31.x post-MVP.
As of nightly-2025-04-16,
SourceFileand the methods around it don't exist anymore, so anyone updating rust or installing rust won't be able to compile the idl anymore.proc-macro2already updated, this PR updates anchor accordingly. Note that this will require users to update to the latest nightly (and will break users with an older nightly). Idk if this counts as a breaking change since it only affects nightly...Fixes #3662