pantsbuild / scie-pants

Protects your Pants from the elements.
https://www.pantsbuild.org/docs/installation
Apache License 2.0
18 stars 17 forks source link

Use `ureq` for "science" download, not `cargo install`'d `ptex` #391

Closed huonw closed 2 months ago

huonw commented 2 months ago

This replaces an inline cargo install of https://github.com/a-scie/ptex with the ureq library. The ptex binary seems to only be used as a "portable" curl -O <url>, which can, I think, be done with code built into the package/ lib itself.

This change:

It also gets rid of two explicit dependencies (once_cell, url)... but ureq depends on both, so they don't actually disappear from the dependency tree. 🤷

I chose ureq because it doesn't seem to add much compilation time. With some benchmarks on my 4-core laptop:

build type time before (s) time after (s)
clean 9-10 10-11
cached, comment change in package/src/utils/build.rs 0.5-0.6 0.5-0.6

There's three commits, which can be reviewed individually. The middle one is the interesting one, with the other two minor related refactors.

huonw commented 2 months ago

I did a CI build without the cache, because the cached build wasn't exercising this new code path. Seems to work ✅