-
Notifications
You must be signed in to change notification settings - Fork 86
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
Is there a way to include files based on an externally generated list #221
Comments
Hi @alerque |
I thought I was being pretty tricky here, but just realized another design issue has me blocked. I came up with a full file list to include. I auto generated this using the build system that had the data anyway, and used it to write out a file that is just a flat list of The trouble is, it seems a whitelist is useless. Exclude takes total priority, so the only way this is going to work is with a blacklist of every file in the file system I don't want to include, which is much more complicated. I'm now in a catch 22. Copying files to an isolated location defeats a large chunk of the purpose of using this crate in the first place: being able to use filesystem data while working in the development tree and only having assets embeded in release builds. Is there any way we can get some sort of prioritized globing worked out, perhaps more like |
Yep you are right this library is mainly used to improve dx. Maybe if we move the priority of exclude below that of the include it might work. I agree something like |
Lowering the priority of One other note is about performance: the current compile times don't seem to be related to how many files or how much data gets embeded, but they are very related to how big the file system in |
Sorry it took me a bit to spin up the project with this in it without my other workarounds to avoid this. I dug up some code from about the time I reported this and the warm build time for Cargo with 0.8 was running about 64 seconds. Switching to a Git dependency, I'm seeing warm builds between 30-40 seconds. I'm not sure why it now varies so much, but it seems clear it's at least somewhere close to halved my build times. It's a little harder to get a grip on how much of my total build time is related to embeding, but disabling all the various rust-embeded brings warm build times down to about 8 seconds. There is a bit of work building an asset list and a little bit more prepping some of them for embeding, but it seems like there might be a bit of overhead still involved in handling a large list of includes. |
I see from #148 (thanks @mbme) where proc macros for include/exclude were added, but the documentation is a bit sparse on how the order works. What I'd actually like to have happen is use the multiple-includes feature to iterate over a known list of resources. I have pre-generated lists of files I'd like to embed already at build time. Unfortunately there is other stuff mixed in the source folders, so just specifying a top level folder isn't too practical, nor is manually maintaining a list of thousands of includes. I can have the list available as an ENV var or written to a file before build, so potentially I could have
build.rs
do some lifting here ... is there a mechanism I can use to specify an explicit include list, then exclude=* to block everything else from the folder?The text was updated successfully, but these errors were encountered: