You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Filing this at @oli-obk's request, based on discussions on Zulip. Related to #44 .)
We should be able to get lists of files on the filesystem, within const eval. This would work similarly to getting file contents via include_bytes!. We'd get a full directory listing (or a full list of files matching a glob), sort it for reproducibility, and use similar machinery for "rebuild if this changes".
(Note that unlike a file, where we might be able to use timestamps, for a directory and especially for a glob, we may have to just generate the file list unconditionally and compare secure hashes of it to decide if we need to rebuild. That has performance implications for no-op builds.)
@oli-obk suggested that this could work by tagging specific portions of low-level directory I/O as something akin to lang items, and then implementing that low-level directory I/O specially in CTFE.
(As a first pass, before supporting the full standard API at compile time, we could have macros like include_dir_list! or include_file_glob_list! that just return something like &[Path].)
The text was updated successfully, but these errors were encountered:
(Filing this at @oli-obk's request, based on discussions on Zulip. Related to #44 .)
We should be able to get lists of files on the filesystem, within const eval. This would work similarly to getting file contents via
include_bytes!
. We'd get a full directory listing (or a full list of files matching a glob), sort it for reproducibility, and use similar machinery for "rebuild if this changes".(Note that unlike a file, where we might be able to use timestamps, for a directory and especially for a glob, we may have to just generate the file list unconditionally and compare secure hashes of it to decide if we need to rebuild. That has performance implications for no-op builds.)
@oli-obk suggested that this could work by tagging specific portions of low-level directory I/O as something akin to lang items, and then implementing that low-level directory I/O specially in CTFE.
(As a first pass, before supporting the full standard API at compile time, we could have macros like
include_dir_list!
orinclude_file_glob_list!
that just return something like&[Path]
.)The text was updated successfully, but these errors were encountered: