Code Monkey home page Code Monkey logo

Comments (7)

bminixhofer avatar bminixhofer commented on May 22, 2024

Oh sorry, I misunderstood the original issue then. In any case a postprocess function makes sense to reduce the size of the final binary.

Your proposed cache_preprocess function also makes sense. I have to think a bit about the naming, that function would basically transform the buffer to some other buffer immediately after downloading it.

I'm not quite happy with that additional complexity and in general with having to store the binaries in-tree as you do in cargo-spellcheck now but I don't think there's a better solution..

from nlprule.

bminixhofer avatar bminixhofer commented on May 22, 2024

Actually you don't have to store the binaries in-tree if you just run the build.rs once before cargo publish, right? In that case only the additional complexity is an issue and that's not too bad in the nlprule-build crate.

from nlprule.

drahnr avatar drahnr commented on May 22, 2024

I don't think this works. Cargo requires all sources to be part of the git tree and a commit to be able to publish, and that's part of the "deploy when github is down" user story. So while postprocess is nice, I would not want to decompress the files on each run (at least for cargo-spellcheck which is a short lived task, that doesn't seem reasonable).

from nlprule.

drahnr avatar drahnr commented on May 22, 2024

I'd be happy to create PR for this!

from nlprule.

bminixhofer avatar bminixhofer commented on May 22, 2024

That would be great, sure! I think the best solution is a transform function which transforms the binary immediately after downloading / building. It has to be transformed consistently regardless of whether it is built from the build directory or downloaded.

My comment above was perhaps a bit confusing because I conflated the two things (this issue and storing the binaries in-tree), what I meant was that you can just

cargo build # <- creates the nlprule-data directory in your case
cargo publish --allow-dirty

if you didn't want to store the binaries in Git.

from nlprule.

drahnr avatar drahnr commented on May 22, 2024

That would be great, sure! I think the best solution is a transform function which transforms the binary immediately after downloading / building. It has to be transformed consistently regardless of whether it is built from the build directory or downloaded.

Good point, noted.

My comment above was perhaps a bit confusing because I conflated the two things (this issue and storing the binaries in-tree), what I meant was that you can just

cargo build # <- creates the nlprule-data directory in your case
cargo publish --allow-dirty

That would work, but it includes the risk of publishing a local state of uncommitted changes which I am not keen on. It seems to be a solution, but not a pretty one.

if you didn't want to store the binaries in Git.

I do :) the user story dependencies should not differ between crates-io and a git based installation (one can also install directly from git with cargo).

from nlprule.

bminixhofer avatar bminixhofer commented on May 22, 2024

one can also install directly from git with cargo

Oh, that's a good point then. I just thought it's not ideal because it might blow up the size of the repository a bit. So it is enough for me if it is not necessary to store the binaries in-tree when making something that depends on nlprule.

from nlprule.

Related Issues (20)

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.