Skip to content

Alllow .res files in stdlib #5714

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

Merged
merged 13 commits into from
Oct 3, 2022
Merged

Alllow .res files in stdlib #5714

merged 13 commits into from
Oct 3, 2022

Conversation

cristianoc
Copy link
Collaborator

Files in stdlib use ocamldep to figure out dependencies. Allow .res files and temporarily convert them to .ml to feed them to ocamldep

Files in stdlib use ocamldep to figure out dependencies.
Allow .res files and temporarily convert them to .ml to feed them to ocamldep
@cristianoc cristianoc requested a review from cknitt October 1, 2022 15:48
@cristianoc
Copy link
Collaborator Author

@cknitt @mattdamon108 this is just a proof of concept -- I'll need some JS help to clean it up.

@cristianoc cristianoc marked this pull request as draft October 1, 2022 15:54
@cknitt
Copy link
Member

cknitt commented Oct 2, 2022

Is this really intended for 10.1? Or should it rather go into 11.0?

What exactly would you like to get cleaned up?

@cristianoc
Copy link
Collaborator Author

Is this really intended for 10.1? Or should it rather go into 11.0?

What exactly would you like to get cleaned up?

I'd like to be able to export functions which are ml keywords.
For JSX V4, and for Js.Promise2.then instead of then_.

So one can convert to .ml without ovewrtiting ".cm*" files.
@cristianoc
Copy link
Collaborator Author

One issue remaining is that config (performed by ninja.js at the end of build) has at least the same effect as touch jscomp/others which forces others to be processes again when building again on no change.

There's already something like that going on even before this PR: If you do a clean build. Then build again, some work is done. The third time it is not. Looks like something in "test" is changed at the end of the first build (presumably by config), so that the second build needs to do work again.

cristianoc and others added 4 commits October 2, 2022 11:00
No need to protect now that a temporary dir is used for temporary .ml files.
Of course, it would be nice to clean up the build, separately.
more idiomatic path parse

Co-authored-by: woonki <woonki.moon@gmail.com>
@@ -63,11 +63,13 @@ o others/js_vector.cmj : cc_cmi others/js_vector.ml | others/belt_internals.cmi
o others/js_vector.cmi : cc others/js_vector.mli | others/belt_internals.cmi others/js.cmi $bsc
o others/js_weakmap.cmi others/js_weakmap.cmj : cc others/js_weakmap.ml | others/belt_internals.cmi others/js.cmi $bsc
o others/js_weakset.cmi others/js_weakset.cmj : cc others/js_weakset.ml | others/belt_internals.cmi others/js.cmi $bsc
o others/js_xxx.cmi others/js_xxx.cmj : cc others/js_xxx.res | others/belt_internals.cmi others/js.cmi others/js_promise.cmj $bsc
o others/js_yyy.cmi others/js_yyy.cmj : cc others/js_yyy.res | others/belt_internals.cmi others/js.cmi others/js_xxx.cmj $bsc
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good: js_xxx uses js_promise and js_yyy uses js_xxx

@cristianoc cristianoc requested review from cknitt and mununki October 2, 2022 09:16
@cristianoc
Copy link
Collaborator Author

This is ready for another review. It is now using a temporary directory, so even if dependencies get computed twice in parallel, it still works.

Separately, the build needs to be cleaned up. Why does it compute dependencies twice. And why the dev and build ninjas are identical, and why is there a distinction between dev and build, and what is and is not supposed to run in parallel anyway, and why tests build again after a successful clean build.

@cristianoc cristianoc marked this pull request as ready for review October 2, 2022 12:13
Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍 🎉

Just a few nits, and the Js_xxx and Js_yyy should be removed before merging.

@cristianoc cristianoc merged commit ab3f687 into 10.1_release Oct 3, 2022
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

Successfully merging this pull request may close these issues.

3 participants