-
Notifications
You must be signed in to change notification settings - Fork 323
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
Update bp_03_run_executables_and_tests.md #2092
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions and a question for clarity.
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 `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`.
⬇️ Suggested change
-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`.
+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: ***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposals commited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is was missing, thanks @F-Loyer, this greatly helps.
Once this is is complete, we should summarize it there: https://ocaml.org/docs/your-first-program#watch-mode
This PR does a better job at motivating dune build --watch
than PR #2064 (which introduced the referred section).
|
||
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. | ||
|
||
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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A remark about launching dune build --watch
in the background should be added. For clarity, I believe an item list with the various cases should be added too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok for the background use of dune build --watch
, but since this command prints the evolution of the compilation, I find it better to launch it on a dedicated terminal... and work with other terminals.
Do you mean a summary with the different dune
commands. dune exec ...
, dune build --watch
, dune test
. There are not a lot of cases.
@@ -43,7 +43,7 @@ You can run it with `dune exec bin/main.exe` or `dune exec my-app`. | |||
|
|||
The `dune exec <executable_path>.exe` can take some time to compile a project when multiple files are involved. It can be beneficial to have a process that recompiles files 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 that need to be compiled, and afterwards, just waits for a modified file that will trigger the compilation of needed modules. | |||
The command `dune build --watch` overwatches for things that need to be compiled. It waits for a file modification that triggers the compilation of needed modules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think overwatches is word used outside of military tactics. Oversees things? Or just "...watches for things"?
@sabine, here are the edits: https://github.com/ocaml/ocaml.org/tree/dune-watch |
I read:
it is not possible, but not needed too since when a file is changed, The real issue is with the concurrency of this command and a |
How about: "Thus it's unnecessary to launch |
"It is unnecessary to launch |
How about: |
I may be picky. "It is unnecessary to launch or "It is unnecessary to launch |
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. |
Co-authored-by: Christine Rose <[email protected]>
Co-authored-by: Christine Rose <[email protected]>
Co-authored-by: Christine Rose <[email protected]>
Co-authored-by: Cuihtlauac Alvarado <[email protected]>
Co-authored-by: Cuihtlauac Alvarado <[email protected]>
Co-authored-by: Christine Rose <[email protected]>
9c6a02a
to
1bdfc32
Compare
Edit: Resolves #1822
This PR address #1822
However, the limitation due to the
_build
directory lock ofdune
makes it a little difficult to use thedune build --watch
feature.