autotools-rs
autotools-rs copied to clipboard
do not rerun configure if Makefile exists
I use simple build.rs
:
extern crate autotools;
fn main() {
let dst = autotools::build("3rdparty/rsync-3.1.3");
println!(
"rustc-env=RSYNC_BIN={}",
dst.join("bin").join("rsync").display()
);
}
and after adding such build.rs
build becomes really slow,
because of it runs configure
every build.
It would be nice check if Makefile
exists and if so just run make
.
As I know make
automatically runs configure
if something changed.
If you want to add an option such as configure_once
in a pull request I'd merge it immediately.
Checking for Makefile existence isn't enough sadly, you'd have to account for other changes such as different with/without options requested.
Checking for Makefile existence isn't enough sadly, you'd have to account for other changes such as >different with/without options requested.
What about checking config.log
and compare new flags with flags from config.log
and if flags matches and makefile exists, just run make?
Sounds good (also saving the command in the build dir and compare it would work), are you willing to give it a try?
@Dushistov do you still have the need for this feature?
long story short: I have to turn off usage of autotools-rs from build.rs and use prebuild binary instead. So at now I do not use autotools-rs anymore.
The more long variant of story: during CI (Continuous Integration) run time to time build failed, because of autoconf/automake build system decides that it need rerun of m4 -> shell code
pass, and this doesn't work in out-of-source variant that uses autotools-rs
. Because of really I need result of autoconf/automake build only for one specific case old linux distribution/amd64, so I decide just build this binary by hands.
Sounds a bad quirk in rsync, but if you have a tree using it I can have a look.
@lu-zero
Sounds a bad quirk in rsync, but if you have a tree using it I can have a look.
It is reproducible on master branch of rsync.
For example I build rsync out of tree:
$ git clone git://git.samba.org/rsync.git
$ mkdir build-rsync
$ cd build-rsync
$ ../rsync/configure && make
then I touch configure.ac
$ touch ../rsync/configure.ac
$ make
autoconf -o configure.sh
autoconf -o configure.sh
autoconf: error: no input file
autoconf: error: no input file
Obviously I do not touch any source code of rsync, so I have no idea why time to time this bug happens on CI, but symptomatic is identical.
Probably would be a good idea to report the issue to the rsync
project.
The build-system doesn't use automake
and does not support out of source directory.
#6 should solve your problem.