evmar / n2

n2 ("into"), a ninja compatible build system
Apache License 2.0
338 stars 26 forks source link

Add validation inputs #90

Closed Colecf closed 9 months ago

Colecf commented 9 months ago

These were added to regular ninja in: https://github.com/ninja-build/ninja/commit/04c410b15b70fb321928ffba19d697db15cb0121

Android uses them, so they're needed to port android to n2. (which is something I'm exploring but not committing to)

evmar commented 9 months ago

This is so cool! I'm very curious about whether n2 works out for Android.

I think there's likely some easy low hanging perf fruit but I haven't tried n2 yet on any reasonably large build -- the app I worked on had like 1k edges total. I think the architecture is mostly in the right to be able to scale, but there are surely some simple things I overlooked, like maybe some O(n) in the number of ready edges or something silly like that.

And further I think it would be relatively easy to add larger ideas like multithreading for build.ninja parsing if that's useful.

In general, if you have any build.ninja files to share for investigating, or feature requests or observations etc., I'd love to hear them and help out where I can!

evmar commented 9 months ago

Also, if for Android purposes you wanted to explore more invasive changes like a binary file format, I would be happy to explain any part of n2 you need. But from this PR it feels like you already have pretty much gotten it.

Colecf commented 9 months ago

Thanks! I'm glad you're open to supporting android. Upstream backing is definitely a factor in the switch.

There's still a lot of work/investigation to port android to n2, but some other thoughts I had while looking into it:

evmar commented 9 months ago

Now that we're on the subject, didn't I see some rumor about Android switching to bazel? Is that still happening?

Colecf commented 9 months ago

Unfortunately the migration to bazel was recently cancelled. :/

evmar commented 9 months ago

Is it worth opening bugs about the remaining issues? Re the frontend_file, I had experimented a bit with https://github.com/evmar/n2/pull/34 which feels pretty similar, and had ideas like https://www.figma.com/file/ewO2MBU5MXlt5i3cZsoBrC/Ninja-VSCode-integration?type=design&node-id=0%3A1&mode=design&t=taX8UFxmqs7Xo0II-1