onelson / jq-sys

generated bindings rust for libjq

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Always rebuilding

est31 opened this issue · comments

commented

For some reason, when I turn on bundling, it's always rebuilding the entire library for me. There is no caching involved. That's obviously bad.

Yeah. I'm betting this is also somehow related to the outstanding issue where if you build with or without the bundled feature, you have to cargo clean between switching. The build.rs needs some work.

So, I have been looking at this from a couple different ways. First and foremost, it looks like I had a series of cargo:rerun-if-s in the build script, originally designed to help avoid redundant rebuilds. If I remove them all, things seem to cache mostly the way we'd expect. I think maybe those instructions might have made sense when I had been depending on a jq-src crate, but no longer. Leveraging a git submodule just felt a lot more straightforward than having a 3rd crate in the mix.

The issue I mentioned above where alternating between a non-bundled build and a bundled build can break the build script still persists (#3). This mystery will likely be solved another day. Still, I think just having the cache working properly when not alternating the feature is a big enough win for now.

If you are watching the clock - I'd expect to cut releases for this and onelson/jq-rs#1 sometime this weekend. I'll plan to spend a little more time working towards #3, but I won't wait on it if it doesn't seem obvious with a little extra research.

I think this should be fixed in v0.2.1.

commented

Thanks for looking into it @onelson !