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

Allow patching of lists #82

Open
gatecat opened this issue May 10, 2021 · 0 comments
Open

Allow patching of lists #82

gatecat opened this issue May 10, 2021 · 0 comments

Comments

@gatecat
Copy link
Contributor

gatecat commented May 10, 2021

Consider trying to patch the exception map, for example to test chipsalliance/fpga-interchange-schema#42. Aside from the StringIdx issue in #81, patching something that is a list rather than a struct fails even earlier.

exceptions.yaml:

 - primName: FOO
   macroName: BAR

run

python -mfpga_interchange.patch  --schema_dir ~/fpga-interchange-schema/interchange --patch_path exceptionMap  --schema device --patch_format yaml LIFCL-17.device exceptions.yaml LIFCL-17-patched.device

fails with:

Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/david/python-fpga-interchange/fpga_interchange/patch.py", line 72, in <module>
    main()
  File "/home/david/python-fpga-interchange/fpga_interchange/patch.py", line 65, in main
    patch_capnp(message, patch_path, args.patch_format, f)
  File "/home/david/python-fpga-interchange/fpga_interchange/patch.py", line 30, in patch_capnp
    message_to_populate = message_to_populate.init(patch_path[-1])
  File "capnp/lib/capnp.pyx", line 1272, in capnp.lib.capnp._DynamicStructBuilder.init
  File "capnp/lib/capnp.pyx", line 1288, in capnp.lib.capnp._DynamicStructBuilder.init
capnp.lib.capnp.KjException: capnp/dynamic.c++:693: failed: init() without a size is only valid for struct and object fields.
stack: 7f32523e6be1 7f3252734173 7f32526aca3b 7f325321a252 7f325320071c 7f32531fc461 7f3253208269 7f32531f77b6 7f3253208269 7f32531f77b6 7f32531f628c 7f32531f5c50 7f32532b7b12 7f32532beedc 7f3253208c40 7f32531f77b6 7f32531f628c 7f325320840d 7f32531f77b6 7f32531f628c 7f325320840d 7f32532e2f67 7f32532d9a91 7f32532aaba8 7f3252f2d151 55bda411d04d
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

No branches or pull requests

1 participant