-
Notifications
You must be signed in to change notification settings - Fork 3
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
can't build Blodwen #2
Comments
OK, so I've progressed a bit but I realise that the layout of the Blodwen project doesn't seem to work properly with rules_idris. From looking at the generated ipkg file I can see that it thinks modules should be prefixed with I moved
I'm guessing but I think it's because there are really 2 projects in here, blodwen and ttimp which presumably have some parts in common. So I next tried to temporarily get rid of WRT the problem of |
OK, so the issue here is that Blodwen has multiple projects in one source directory, it appears that ./Core/Evaluate.idr isn't actually used anywhere. I managed to get things working by changing the ideris_library rule srcs to be the exact files I need only, rather than a glob of everything. Unfortunately I still have the problem of rules_idris thinking that the module name should be |
Yes, right now idris rules tries to follow the idea that bazel can have nested modules that are, at the same time, bazel rules. That is, if I have the modules foo.Foo and foo.bar.Bar, the file structure would be something like this:
For this reason, all the directories are, right now, meaningful. I might, if you think it useful, add an optional |
I was thinking that the language should be the same as an ipkgs file, so Additionally, why do we need to use the ip tool? couldn't we just generate an ipkg file based on modules the user requires and then use |
This would work in a top level module all right, but would not be so clear on a sub module. Imagine this:
In this example there are two modules
I find this far from ideal. My solution is to add this With the
With this approach, idris_rules and bazel are going to regard the modules as
In cases where the whole project is in a single "idris_library" or a single "idris_binary", you would be absolutely right and, in fact, that was my intention initially. But bazel has a convoluted way to move stuff from the output of one rule to the input of another rule. The ip tool basically generates a zip file with everything one module have (minus dependencies) and makes it a single thing to move. In fact, this zip file contains all the ibc files of that module too, ensuring things get compiled only once. |
but a submodule shouldn't have a BUILD file in it should it? Currently it seems to consider |
In bazel they can. And in a way, is the idea: with the BUILD init, it becomes an independent compile (and test!) unit |
are they mandatory though? you wouldn't want a BUILD file in every subdirectory, /~https://github.com/edwinb/Blodwen/tree/master/src for example |
No, they are not mandatory. But if you take a look at bazel, you'll see that the more you split the code this way, the more you benefit from bazel. The idea is that bazel is very good keeping the relationship betwwen each 'rule' to ensure to only build/test whatever has been affected by a change |
ok so given all this, can we add In the case of Blodwen there are 2 packages within the |
IIUC an |
Ok, I had a go with |
This also needs to be the same for |
Hi, as an initial project I tried to convert Blodwen to bazel however I got
You can see my fork here /~https://github.com/shmish111/Blodwen
The text was updated successfully, but these errors were encountered: