-
Notifications
You must be signed in to change notification settings - Fork 50
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
Failing codegen on Any #528
Comments
As mentioned on the bridged Someone could put in some work to codegen and submit a PR but I couldn't promise to be timely with a review unfortunately because of how big it all is—although lots of tests would certainly help. As for its general usability - if you avoid the unimplemented features then it works just fine, it's in active use across a lot of projects - notably in the dag-pb codec itself: https://github.com/ipld/go-codec-dagpb and the unixfs ADL: https://github.com/ipfs/go-unixfsnode/tree/main/data; it's just got a lot of unimplemented edges, |
Just so I'm being clear, I'm not using Any, at least directly. The generator fails as it sets up internal maps for callbacks. From what I can see it never gets to my typedefs. I'm surprised any code will work in is current state. I appreciate you don't have the cycles and it's not a priority, thank you for the honest response. |
The way to use codegen isn't with a parseable schema (yet), it predates schema parsing in fact and this is the problem you're running in to - parsed schemas end up pulling in a lot of stuff that codegen can't handle even without touching them. The way to use codegen is to build the schema programmatically. You can see that in action here: https://github.com/ipld/go-codec-dagpb/blob/master/gen.go and https://github.com/ipld/go-codec-dagpb/blob/master/gen.go Also if you want to see a codegen to bindnode transition then check out ipld/go-ipld-adl-hamt#39 which took the older |
This probably happens because the "prelude" was revamped to use You can see where that's introduced here: go-ipld-prime/schema/dmt/compile.go Line 38 in 65bfa53
The codegen should work fine with schemas parsed from the DSL. The only hiccup is that that parsing pipeline passes through the Depending on what your aims are, this may provide an alternative path to hacking towards what you want: We did always mean to have the prelude be optional, just never introduced a flag for that :) You can see how that flag would be pretty easy to introduce, though. Adding |
Panics at...
Generate
should error, not panic.2, Is the generator in a good state or is it not up to date with the current state of IPLD? I noticed the CLI tool was archived.
The text was updated successfully, but these errors were encountered: