Coder Social home page Coder Social logo

includedir's People

Contributors

axos88 avatar emk avatar shenek avatar tilpner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

includedir's Issues

Passthrough is flaky with new rerun-if-changed behaviour

Before, it would check for the passthrough environment variable every run, but since
that's fixed now, the developer needs to force a rerun for passthrough to be re-evaluated.

Possible solution: Check PASSTHROUGH env var at startup, lookup paths in FS instead of in phf_map, remove passthrough codegen option

Update to phf 8.0

Been getting these attempt to calculate the remainder with a divisor of zero errors from phf 0.7.24 in our project Tauri. According to the phf github this is a known issue that was resolved in 0.8. You can find associated issues here

Is there any way that you could update the library to 8.0 to help remove these problems?

Tree API?

I didn't use this with a large amount of files or deep file structures yet,
but while a phf map may be fast, it breaks down as soon as the included directories become deeper and more complex.

Would a filesystem-ish tree API be a better fit here?
One could imitate the std::fs API without writability, to allow for proper path manipulation,
directory listing, tree walking, etc.

Opinions? @emk

Emit rerun-if-changed instructions to Cargo

If includedir_codegen is used from build.rs, it's strictly required to limit rebuilds to only cases of the files changed that are being included, so includedir_codegen should emit cargo:rerun-if-changed=<path> for each file includes.
cc @eddyb

Try using fst?

Might be interesting to see whether using fst can be faster than phf and/or yield a smaller binary size. You'll probably have to build with the (compressed) contents first and then build the map using the sorted list of file paths and use (offset,len) tuples as values. Loading the map should be something like Map::from_static_slice(include_bytes!(concat!(env!("OUT_DIR"), "/index.fst"))). I've done something like this in static-filez.

Including in a module

Hello.

To clean up main.rs, I'd like to include the file resulting from the build script to another module (let's say src/assets.rs).

Alas, the current generated file assumes it's included in the top-level module / main.rs and at build time, trying to use something from includedir fails as it doesn't find the includedir crate (did you mean self::includedir...).

Is it possible to add an option or eventually detect include! in modules to make the generated file include self:: as a suffix and avoid this issue?

Thanks in advance and have a nice day.

OUT_DIR not found

Upgraded from rust 1.28 to 1.30, and it stopped compiling:

include!(concat!(env!("OUT_DIR"), "/data.rs"));
error: couldn't read "src/routes/false/data.rs": No such file or directory (os error 2)
  --> src/routes/statics.rs:11:1
   |
11 | include!(concat!(env!("OUT_DIR"), "/data.rs"));
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.