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

How do I actually run it? #7

Open
gergoerdi opened this issue Nov 7, 2021 · 5 comments
Open

How do I actually run it? #7

gergoerdi opened this issue Nov 7, 2021 · 5 comments

Comments

@gergoerdi
Copy link
Contributor

Because idris2-dom is missing IndexedDB support, I thought I'd just plop in the WebIDL files from e.g. https://searchfox.org/mozilla-central/source/dom/webidl and it should Just Work (tm), but alas, I can't even figure out how to run it. It seems to look for an .idr output file in some directory somewhere (that I can kind-of override mostly with the -o flag, if only I pass the -o flag before the input file name?!), but I thought the whole point is to create the .idr file.

@gergoerdi
Copy link
Contributor Author

Also, one of the outputs seems to be the Web.Internal.Types module, but that module is already part of idris2-dom so I will have a bad time if my IndexedDB FFI package also has that module. Or is the idea that it would have to be included with idris2-dom, together with all other W3C specs past, present and future?

@gergoerdi
Copy link
Contributor Author

OK I kind of figured out how it works: basically, it needs $OUT/Web/Raw and $OUT/Web/Internal directories to already exist (if run with -o $OUT), but otherwise doesn't seem to do any readback.

Which turns out to be a problem on its own, because it means I can't re-run it on idris2-dom, without knowing the exact set of input files. Otherwise, it removes all the existing definitions from Web.Interlal.Types.

@stefan-hoeck
Copy link
Owner

Yeah sorry, running this is very basic, but it didn't bother me so far... Here's how to run this after building it with make lib:

$ build/exec/generateDomBindings -o outdir idl/*.webidl

where outdir is the source dir of the idris2-dom project (for instance: ../idris2-dom/src). And yes, I need to make this more accessible, possibly by adding a proper make target which automatically generates the necessary directories in outdir.

Please note also that it makes no sense to run this with a single .webidl file, since many interfaces are spread across several files.

@stefan-hoeck
Copy link
Owner

And yes, the Web.Internal.Types is hardcoded so far. Another thing that needs changing, if this should be used by other projects than idris2-dom.

@gergoerdi
Copy link
Contributor Author

Yeah sorry, running this is very basic, but it didn't bother me so far... Here's how to run this after building it with make lib:

$ build/exec/generateDomBindings -o outdir idl/*.webidl

Ah, I missed that /idl directory in idris2-webidl because I was looking for it in idris2-dom (since in my mind, idris2-webidl was a generic tool and idris2-dom was just one use of it, with its own set of IDLs to compile). So in that case, I should be able to re-create the whole of idris2-dom with the addition of the IndexedDB interfaces. Let me try just that.

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

2 participants