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,6 +368,7 @@ sub run_job {
goto remove_tmp; goto remove_tmp;
} }
if (!exists $conf->{'omit_artifacts'} || !$conf->{'omit_artifacts'}) {
printf BUILDLOG "copy %s:%s -> %s\n", $host, printf BUILDLOG "copy %s:%s -> %s\n", $host,
"$temporary/artifacts/*", $artifacts; "$temporary/artifacts/*", $artifacts;
$status = copy_from_remote("$temporary/artifacts/\*", $artifacts, $status = copy_from_remote("$temporary/artifacts/\*", $artifacts,
@@ -373,6 +378,7 @@ sub run_job {
$exit_value = 4; $exit_value = 4;
goto remove_tmp; goto remove_tmp;
} }
}
# Update config.cache file if using. # Update config.cache file if using.
if (!$ignore_cache) { if (!$ignore_cache) {
@@ -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
CONFIGURE_OPTS=
while test $# != 0; do
case "$1" in case "$1" in
--cache-file)
CONFIGURE_OPTS="--cache-file=../$2"
shift 2
;;
--osversion) --osversion)
osversion="$2" osversion="$2"
shift 2 shift 2
;; ;;
*)
break
;;
esac 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