Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during code generation: unsupported proc macro punctuation character '{' #160

Closed
sunnyrains opened this issue Oct 10, 2024 · 1 comment · Fixed by #161
Closed

Error during code generation: unsupported proc macro punctuation character '{' #160

sunnyrains opened this issue Oct 10, 2024 · 1 comment · Fixed by #161
Labels
bug Something isn't working buildsystem Related to generating the device-modules from ATDF files.

Comments

@sunnyrains
Copy link

after running
~/Desktop/avr-device$ make atmega32a

-e MAKEDEPS atmega4808
-e MAKEDEPS atmega32u4
-e MAKEDEPS atmega32a
-e MAKEDEPS atmega328pb
-e MAKEDEPS atmega328p
-e MAKEDEPS atmega324pa
-e MAKEDEPS atmega8u2
-e MAKEDEPS atmega8
-e MAKEDEPS atmega2560
-e MAKEDEPS atmega168
-e MAKEDEPS atmega164pa
-e MAKEDEPS atmega16
-e MAKEDEPS atmega128rfa1
-e MAKEDEPS atmega128a
-e MAKEDEPS atmega1284p
-e MAKEDEPS atmega1280
-e MAKEDEPS at90usb1286
-e ATDF2SVD atmega32a
-e PATCH atmega32a
-e SVD2RUST atmega32a
[INFO svd2rust] Parsing device from SVD file
[INFO svd2rust] Rendering device
thread 'main' panicked at /home/bbino/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.87/src/lib.rs:847:13:
unsupported proc macro punctuation character '{'
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
make: *** [Makefile:38: src/devices/atmega32a/mod.full.rs] Error 101

@Arian8j2
Copy link

faced exact issue today, backtrace shows this:

unsupported proc macro punctuation character '{'
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: proc_macro2::Punct::new
   3: svd2rust::generate::register::render_register_mod
   4: svd2rust::generate::register::render
   5: svd2rust::generate::peripheral::render_ercs
   6: svd2rust::generate::peripheral::render
   7: svd2rust::generate::device::render
   8: svd2rust::run
   9: svd2rust::main

it's clearly svd2rust issue that comes from a breaking change commit in proc-macro2, and not related to avr-device.
until the problem get fixed in svd2rust you can get around it by installing sv2rust by running this command:

cargo install svd2rust --locked

@Rahix Rahix added bug Something isn't working buildsystem Related to generating the device-modules from ATDF files. labels Oct 12, 2024
@Rahix Rahix changed the title error after running make on ubunt22.4 jammy Error during code generation: unsupported proc macro punctuation character '{' Oct 12, 2024
@Rahix Rahix linked a pull request Oct 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working buildsystem Related to generating the device-modules from ATDF files.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants