ocaml.org icon indicating copy to clipboard operation
ocaml.org copied to clipboard

Update bp_03_run_executables_and_tests.md

Open F-Loyer opened this issue 1 year ago • 8 comments

Edit: Resolves #1822

This PR address #1822

However, the limitation due to the _build directory lock of dune makes it a little difficult to use the dune build --watch feature.

F-Loyer avatar Feb 24 '24 00:02 F-Loyer

I mean that when we modify multiple files, the compilation is performed with the current (as soon as each file is saved), then after the last modification, the build task can have very few files which remains to be compiled. Perhaps I should have written the section in such a way. --Frédéric LoyerLe 26 févr. 2024 à 08:32, Christine Rose @.***> a écrit : @christinerose commented on this pull request.

A few suggestions and a question for clarity.

In data/tutorials/platform/bp_03_run_executables_and_tests.md:

@@ -39,6 +39,14 @@ For instance, if you've put your dune file in bin/dune with the following co

You can run it with dune exec bin/main.exe or dune exec my-app.

+## Building the Project When Files Changes + +The dune exec <executable_path>.exe could take some time to compile a project when multiple files are involved. It could be interesting to have a process which recompiles each file as soon as they are changed. Then after the last saved file, it is possible that it remains only a last file to compile or just the linking process of all files and libraries.

⬇️ Suggested change -The dune exec <executable_path>.exe could take some time to compile a project when multiple files are involved. It could be interesting to have a process which recompiles each file as soon as they are changed. Then after the last saved file, it is possible that it remains only a last file to compile or just the linking process of all files and libraries. +The dune exec <executable_path>.exe could take some time to compile a project when multiple files are involved. It could be interesting to have a process that recompiles each file as soon as they are changed. Then after the last saved file, it is possible that it remains only a last file to compile or just the linking process of all files and libraries.

In the last part of this sentence, do you mean: It is possible that only one file remains to be compiled Also, I don't understand what you mean by "just the linking process of all..." Do you mean that perhaps only one file and the linking process remain? Please clarify and we'll work on this sentence together. 😊

In data/tutorials/platform/bp_03_run_executables_and_tests.md:

@@ -39,6 +39,14 @@ For instance, if you've put your dune file in bin/dune with the following co

You can run it with dune exec bin/main.exe or dune exec my-app.

+## Building the Project When Files Changes + +The dune exec <executable_path>.exe could take some time to compile a project when multiple files are involved. It could be interesting to have a process which recompiles each file as soon as they are changed. Then after the last saved file, it is possible that it remains only a last file to compile or just the linking process of all files and libraries. + +The command dune build --watch looks for things which need to be compiled, and afterwards, just waits for a modified file which will trigger the compilation of needed modules.

⬇️ Suggested change -The command dune build --watch looks for things which need to be compiled, and afterwards, just waits for a modified file which will trigger the compilation of needed modules. +The command dune build --watch looks for things that need to be compiled, and afterwards, just waits for a modified file that will trigger the compilation of needed modules.

In data/tutorials/platform/bp_03_run_executables_and_tests.md:

@@ -39,6 +39,14 @@ For instance, if you've put your dune file in bin/dune with the following co

You can run it with dune exec bin/main.exe or dune exec my-app.

+## Building the Project When Files Changes + +The dune exec <executable_path>.exe could take some time to compile a project when multiple files are involved. It could be interesting to have a process which recompiles each file as soon as they are changed. Then after the last saved file, it is possible that it remains only a last file to compile or just the linking process of all files and libraries. + +The command dune build --watch looks for things which need to be compiled, and afterwards, just waits for a modified file which will trigger the compilation of needed modules. + +However, dune locks the build directory, then it is not possible to launch two dunecommands at the same time. The dune build --watch has to be stopped (typing Ctrl-C) before launching the application. Or we can launch the application without the help of dune by typing _build\default\<executable_path>.exe.

⬇️ Suggested change -However, dune locks the build directory, then it is not possible to launch two dunecommands at the same time. The dune build --watch has to be stopped (typing Ctrl-C) before launching the application. Or we can launch the application without the help of dune by typing _build\default\<executable_path>.exe. +However, dune locks the build directory, then it is not possible to launch two dune commands at the same time. The dune build --watch has to be stopped (typing Ctrl-C) before launching the application. Or we can launch the application without the help of Dune by typing _build\default\<executable_path>.exe.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

F-Loyer avatar Feb 26 '24 07:02 F-Loyer

@sabine, here are the edits: https://github.com/ocaml/ocaml.org/tree/dune-watch

cuihtlauac avatar Mar 06 '24 13:03 cuihtlauac

I read:

Thus it is not possible to launch dune build again, both would be concurrent.

it is not possible, but not needed too since when a file is changed, dune build --watch will be triggered again.

The real issue is with the concurrency of this command and a dune exec.

F-Loyer avatar Mar 06 '24 16:03 F-Loyer

I read:

Thus it is not possible to launch dune build again, both would be concurrent.

it is not possible, but not needed too since when a file is changed, dune build --watch will be triggered again.

The real issue is with the concurrency of this command and a dune exec.

How about: "Thus it's unnecessary to launch dune build again, as both would be concurrent."

christinerose avatar Mar 07 '24 11:03 christinerose

How about: "Thus it's unnecessary to launch dune build again, as both would be concurrent."

"It is unnecessary to launch dune build again as a building process is triggered when needed. It won't be possible either as both would be concurrent"

F-Loyer avatar Mar 07 '24 13:03 F-Loyer

"It is unnecessary to launch dune build again as a building process is triggered when needed. It won't be possible either as both would be concurrent"

How about: "It is unnecessary to launch dune build again, as it triggers a building process when necessary. It also won't be possible because both would be concurrent"

christinerose avatar Mar 08 '24 14:03 christinerose

"It is unnecessary to launch dune build again as a building process is triggered when needed. It won't be possible either as both would be concurrent"

How about: "It is unnecessary to launch dune build again, as it triggers a building process when necessary. It also won't be possible because both would be concurrent"

I may be picky.

"It is unnecessary to launch dune build again, as dune build --watch triggers a building process when necessary. It also won't be possible because both would be concurrent"

or

"It is unnecessary to launch dune build --watch again, as it triggers a building process when necessary. It also won't be possible because both would be concurrent"

F-Loyer avatar Mar 08 '24 18:03 F-Loyer

"It is unnecessary to launch dune build again as a building process is triggered when needed. It won't be possible either as both would be concurrent"

How about: "It is unnecessary to launch dune build again, as it triggers a building process when necessary. It also won't be possible because both would be concurrent"

I may be picky.

"It is unnecessary to launch dune build again, as dune build --watch triggers a building process when necessary. It also won't be possible because both would be concurrent"

or

"It is unnecessary to launch dune build --watch again, as it triggers a building process when necessary. It also won't be possible because both would be concurrent"

Be picky! It's important to get it just right. I'm picky too. 🙂

Either of these work for me, whichever you feel is the most accurate.

christinerose avatar Mar 11 '24 10:03 christinerose