-
Notifications
You must be signed in to change notification settings - Fork 26
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
OCaml script for bootstrap build #14
Conversation
I'm not completely opposed to using ocaml for bootstrapping, but this script looks hardly maintainable. In particular there is no dependency management, so far any bigger change we would have to figure out the deps manually again. (Note that boot/Makefile is generated.) Also, there is no easy to way to change configurations on the fly. I'm proposing something different: The Makefile format is easy enough to parse, even with Str. Why don't we provide a simple "make" script for Windows that does the dependency management, and substitutes the variables? I guess this could be a implemented with around the same number of lines (when done in a clever way and w/o any optimizations). Some years ago I implemented a make utility with a lot of bells and whistles (https://godirepo.camlcity.org/svn/godi-bootstrap/godi-tools/trunk/console-src/godi-pkg/godi_make.ml), and this took 4500 lines, but a simple version without DSL would need only a fraction of that. I mean we mainly need something that:
That cannot be that much. |
Thank you for reviewing my PR. My motivation to implement this boot script was that I need something work today to build OMake from source on Windows. More advanced solution for bootstrapping would be great. But it is not provided at this point. And we can do such smart thing in OMake, I think. At least merging this script breaks nothing. This can be exist in source tree in parallel with other way for boot. Please let me know merging this can cause any trouble. I welcome this one is replaced with more advanced one in the future. In my understanding, changing configuration is not needed for boot because we do configured build using omake-boot.exe later. Please correct me if that was wrong. I thought this is maintainable because it was easy to create from scratch, and easy to adapt to Cygwin and Linux (I have tested in Windows, Cygwin, and Debian Linux). I created this using command log generated by Make running on Linux. But this is only my point of view. The real test about maintainability is that it will be maintained or not by users. If this script will be deprecated or unmaintained, we can remove this at that time. (Or, just leave unmaintained.) Thanks for your link to godi_make.ml. It is interesting but also too advanced to me. I can't comment about it today because I need take time to learn from it. |
Find in the branch "homemade" a little utility I wrote today, make.ml. So far the following works: Under Linux:
successfully bootstraps omake without using GNU make. For doing the same under Windows, a couple of things are still missing:
But anyway, this is pretty close already. |
Great job! It is still too advanced to me but looks much simpler than previous one. I am reading this now. |
Just an FYI, this issue has real world consequence for some users: |
We picked up the general idea, but implemented it differently. |
This patch adds one new OCaml script for bootstrap build, boot.ml.
Following command performs bootstrap build:
$ ocaml boot.ml
This bootstrap script has several good points:
Comments and suggestions are welcome!