autotools-rs icon indicating copy to clipboard operation
autotools-rs copied to clipboard

Separate installation prefix from build directory

Open benesch opened this issue 3 years ago • 2 comments

Right now autotools-rs builds into OUT_DIR but also configures the installation prefix as OUT_DIR. That means the build files get mixed in with the installation artifacts. Not generally a huge deal, but I have a use case where I want to extract the compiled artifacts without the build artifacts downstream of Cargo.

This is my current workaround:

https://github.com/MaterializeInc/rust-protobuf-native/blob/cbc2b33ac0d474ca557018f4695cc508076ffeb0/protobuf-src/build.rs#L22-L32

Would you be open to a patch to bring that behavior upstream? If so, would you prefer it to be configurable or just to make this the default behavior? (FWIW I can't think of a reason that someone would prefer the current behavior to separate build and install directories.)

benesch avatar Jan 19 '22 00:01 benesch

Absolutely :)

lu-zero avatar Jan 19 '22 00:01 lu-zero

Hrm, I got wedged trying to figure out what to do with build_insource:

https://github.com/lu-zero/autotools-rs/blob/644cb0def78d13f73e6fea1b47b467ed89d38f32/src/lib.rs#L425-L426

That runs ./configure --prefix=BUILDDIR and then runs make install on that, which ... well gosh, I don't know, does that work? Seems very strange! I guess it works if you get lucky and none of the files in the source tree conflict with the files that will be installed?

benesch avatar Jan 19 '22 01:01 benesch