-
Notifications
You must be signed in to change notification settings - Fork 437
fix(subst): skip large files on 32-bit #9811
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The change looks fine, but we need to be careful with introducing new exceptions. The issue is that exceptions don't get marshalled automatically over RPC so you can just break things internally when this error is raised. Instead, I propose the following:
|
Fixes #9538 This logs a warning for large files (>16MB on 32-bit systems). Signed-off-by: Etienne Millon <me@emillon.org>
Thanks. I adapted that to the new API. |
Leonidas-from-XIV
approved these changes
Jan 30, 2024
emillon
added a commit
to emillon/dune
that referenced
this pull request
Feb 5, 2024
Fixes ocaml#9538 This logs a warning for large files (>16MB on 32-bit systems). Signed-off-by: Etienne Millon <me@emillon.org>
Merged
emillon
added a commit
to emillon/dune
that referenced
this pull request
Feb 5, 2024
Fixes ocaml#9538 This logs a warning for large files (>16MB on 32-bit systems). Signed-off-by: Etienne Millon <me@emillon.org>
emillon
added a commit
that referenced
this pull request
Feb 5, 2024
* test: add repro for #9538 (subst on 32-bit) (#9539) Signed-off-by: Etienne Millon <me@emillon.org> * refactor: detect large files in Io functions (#9828) `Io.read_all` and related functions read the contents of a file in a string, which has a size limit (`Sys.max_string_length`) and can be an issue in 32-bit systems. This makes an explicit check and raises a `Code_error` in these situations. Signed-off-by: Etienne Millon <me@emillon.org> * fix(subst): ignore large files (#9811) Fixes #9538 This logs a warning for large files (>16MB on 32-bit systems). Signed-off-by: Etienne Millon <me@emillon.org> --------- Signed-off-by: Etienne Mi 8000 llon <me@emillon.org>
emillon
added a commit
to emillon/opam-repository
that referenced
this pull request
Feb 5, 2024
CHANGES: - Fix performance regression for incremental builds (ocaml/dune#9769, fixes ocaml/dune#9738, @rgrinberg) - Fix `dune ocaml top-module` to correctly handle absolute paths. (ocaml/dune#8249, fixes ocaml/dune#7370, @Alizter) - subst: ignore broken symlinks when looking at source files (ocaml/dune#9810, fixes ocaml/dune#9593, @emillon) - subst: do not fail on 32-bit systems when large files are encountered. Just log a warning in this case. (ocaml/dune#9811, fixes ocaml/dune#9538, @emillon) - boot: sort directory entries in readdir. This makes the dune binary reproducible in terms of filesystem order. (ocaml/dune#9861, fixes ocaml/dune#9794, @emillon)
nberth
pushed a commit
to nberth/opam-repository
that referenced
this pull request
Jun 18, 2024
CHANGES: - Fix performance regression for incremental builds (ocaml/dune#9769, fixes ocaml/dune#9738, @rgrinberg) - Fix `dune ocaml top-module` to correctly handle absolute paths. (ocaml/dune#8249, fixes ocaml/dune#7370, @Alizter) - subst: ignore broken symlinks when looking at source files (ocaml/dune#9810, fixes ocaml/dune#9593, @emillon) - subst: do not fail on 32-bit systems when large files are encountered. Just log a warning in this case. (ocaml/dune#9811, fixes ocaml/dune#9538, @emillon) - boot: sort directory entries in readdir. This makes the dune binary reproducible in terms of filesystem order. (ocaml/dune#9861, fixes ocaml/dune#9794, @emillon)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #9538
When
subst
tries to work on a file, it first loads it in memory as an OCamlstring
. This type has a maximum size,Sys.max_string_length
. This is not an issue on 64-bit systems, but the 32-bit limit can be below the size of actual files.However, it is unlikely that these files need substitutions, so we just log a warning in this case.