Pass the name to the config.cache file to the build script.

If --cache-file is not specified, no config.cache file will be used.
Add an "omit_artifacts" setting for platforms where we don't publish
artifacts.
This commit is contained in:
Todd C. Miller
2023-01-20 10:30:19 -07:00
parent ee2f2287a6
commit 0010c98613

View File

@@ -349,14 +349,18 @@ sub run_job {
} }
# Unpack tarball and run build script. # Unpack tarball and run build script.
# When cross-building, pass the target system on the command line. my $build_args = "";
my $osversion = "";
if (exists $conf->{"crossbuild"}) { if (exists $conf->{"crossbuild"}) {
$osversion = "--osversion " . $conf->{"crossbuild"} . " "; # When cross-building, pass the target system on the command line.
$build_args .= "--osversion " . $conf->{"crossbuild"} . " ";
}
if (!$ignore_cache) {
# Name of the config.cache file, if using.
$build_args .= "--cache-file config.cache ";
} }
$status = run_remote_command($conf, $status = run_remote_command($conf,
"cd $temporary && ./$build_script_base ${osversion}$tarball_base", "cd $temporary && ./$build_script_base ${build_args}$tarball_base",
\*BUILDLOG); \*BUILDLOG);
if ($status != 0) { if ($status != 0) {
warn "$platform: build failed on $host\n" unless $exiting; warn "$platform: build failed on $host\n" unless $exiting;
@@ -364,14 +368,16 @@ sub run_job {
goto remove_tmp; goto remove_tmp;
} }
printf BUILDLOG "copy %s:%s -> %s\n", $host, if (!exists $conf->{'omit_artifacts'} || !$conf->{'omit_artifacts'}) {
"$temporary/artifacts/*", $artifacts; printf BUILDLOG "copy %s:%s -> %s\n", $host,
$status = copy_from_remote("$temporary/artifacts/\*", $artifacts, "$temporary/artifacts/*", $artifacts;
$host, \*BUILDLOG, $conf->{"proxy_cmd"}); $status = copy_from_remote("$temporary/artifacts/\*", $artifacts,
if ($status != 0) { $host, \*BUILDLOG, $conf->{"proxy_cmd"});
warn "$platform: unable to scp $host:$temporary/artifacts/* $artifacts" unless $exiting; if ($status != 0) {
$exit_value = 4; warn "$platform: unable to scp $host:$temporary/artifacts/* $artifacts" unless $exiting;
goto remove_tmp; $exit_value = 4;
goto remove_tmp;
}
} }
# Update config.cache file if using. # Update config.cache file if using.
@@ -822,12 +828,22 @@ sub default_build_script {
open(my $fh, ">", $fname); open(my $fh, ">", $fname);
print $fh <<~'EOF'; print $fh <<~'EOF';
#!/bin/sh #!/bin/sh
case "$1" in CONFIGURE_OPTS=
--osversion) while test $# != 0; do
osversion="$2" case "$1" in
shift 2 --cache-file)
;; CONFIGURE_OPTS="--cache-file=../$2"
esac shift 2
;;
--osversion)
osversion="$2"
shift 2
;;
*)
break
;;
esac
done
if [ -z "$1" ] || [ \! -r "$1" ]; then if [ -z "$1" ] || [ \! -r "$1" ]; then
echo "No tarball specified" echo "No tarball specified"
@@ -850,7 +866,7 @@ sub default_build_script {
osversion="`./scripts/pp --probe`" osversion="`./scripts/pp --probe`"
fi fi
./scripts/mkpkg --osversion="$osversion" || exit 1 ./scripts/mkpkg $CONFIGURE_OPTS --osversion="$osversion" || exit 1
for f in *.rpm *.deb *.bff *.depot *.pkg *.txz ../artifacts; do for f in *.rpm *.deb *.bff *.depot *.pkg *.txz ../artifacts; do
if [ -f "$f" ]; then if [ -f "$f" ]; then
mv "$f" ../artifacts mv "$f" ../artifacts
@@ -1110,6 +1126,11 @@ Each platform supports the following settings:
=over 4 =over 4
=item omit_artifacts
If set to true, avoid copying any artifacts built for this platform.
This can be used to build on systems where we don't publish packages.
=item crossbuild =item crossbuild
The name of the platform to cross-compile for. If specified, this The name of the platform to cross-compile for. If specified, this