google-apis-rs / generator

A binding and CLI generator for all google APIs
Apache License 2.0
71 stars 14 forks source link

See if 'just' could be used for everything #11

Closed Byron closed 4 years ago

Byron commented 4 years ago

Motivation: Make already shows some teeth, which motivates me to give 'just' a serious try.

Let's see if it can be suited for this project.

This will be useful!

Disadvantages

Outcome

Use it for

ggriffiniii commented 4 years ago

I think what would help me a lot in understanding the requirements of the generated repo would be a brief description of the different actions that we plan on supporting and an overview of how that's accomplished. I don't have the background and haven't thought about the problem enough to have a good idea of these things, but I know you have. Currently, I'm a little lost looking at things like API index and mapped API index and I'm having a hard time seeing how the pieces fit together.

Having this overview would also give me a much better idea of why tools like make and just are required.

Byron commented 4 years ago

I understand, the names don't necessarily make it easy figure out what to call, and when. Even though I have created the Makefile, I keep forgetting to run things in the right order when trying to 'rerun everything' after the generator changed.

For now, I have updated the README.md in the 'generated' repo to show how I would go when testing the generator against all APIs.

Generally, I use make to keep track of which programs called, and how, and usually that's a good indicator of how things fit together. Something that makes make valuable to me, and where just can't help unfortunately, is its ability to avoid work, and to paralellize work.

In the past, this was easier than writing task-based paralelization by hand.

With the arrival of just, I am asking myself if the last selling points of make are worth keeping it. cargo unfortunately doesn't support parallelization as it blocks on the target directory, and the generator is the only thing left that has a benefit. But in practice, I don't think it's too massive.

Let me keep tinkering with 'just', as it helps clear up my mind :).

Byron commented 4 years ago

@ggriffiniii I will rework the top-level Makefile in the generated repository to 'just', which certainly will be helping to clean it up, and make things clearer. Generally 'all there is to it' is these 'index' files are used to know which APIs should be built. And the mapped index is one that could be pruned based on error files found in the file system. The index then serves as input to know what the make/justfile should contain. The difficulties arose from there being no 'easy' targets to start over, and forget about the previous errors. With the new targets and the README that would be fixed for me.

Byron commented 4 years ago

@ggriffiniii I finished the overhaul, and it should be a bit more intuitive now, after the top-level files have been switched to 'just'.

Please note that under the hood in generated, make is still used for optimizing the runtime of bulk code generation, and for assuring that running cargo-check always runs on the latest code and spec, but only when needed.

I hope all these changes aren't too confusing - please let me know what works and what doesn't, so I can keep improving it (or you do it, of course).