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

do not rerun configure if Makefile exists

Open Dushistov opened this issue 5 years ago • 9 comments

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.

Dushistov avatar Jul 17 '18 19:07 Dushistov

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.

lu-zero avatar Jul 18 '18 15:07 lu-zero

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?

Dushistov avatar Jul 19 '18 04:07 Dushistov

Sounds good (also saving the command in the build dir and compare it would work), are you willing to give it a try?

lu-zero avatar Jul 19 '18 04:07 lu-zero

@Dushistov do you still have the need for this feature?

lu-zero avatar Oct 15 '18 16:10 lu-zero

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.

Dushistov avatar Oct 15 '18 18:10 Dushistov

Sounds a bad quirk in rsync, but if you have a tree using it I can have a look.

lu-zero avatar Oct 15 '18 18:10 lu-zero

@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.

Dushistov avatar Dec 04 '18 14:12 Dushistov

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.

lu-zero avatar Dec 04 '18 18:12 lu-zero

#6 should solve your problem.

lu-zero avatar Jan 25 '19 17:01 lu-zero