mirror of
https://github.com/xcat2/xcat-dep.git
synced 2026-09-12 12:36:23 +00:00
fix(genesis): use the build architecture contract
This commit is contained in:
@@ -64,10 +64,16 @@ $xcat_source = abs_path($xcat_source) or die "Cannot resolve xcat-core source\n"
|
||||
for my $path (qw(Version xCAT-genesis-builder/oe/build xCAT-genesis-builder/oe/export)) {
|
||||
die "xcat-core source is missing $path\n" unless -f "$xcat_source/$path";
|
||||
}
|
||||
my $architecture_reporter = "$xcat_source/xCAT-genesis-builder/oe/build";
|
||||
my $supported_output = eval {
|
||||
capture_command($architecture_reporter, '--list-architectures');
|
||||
};
|
||||
die "xcat-core source does not report supported Genesis architectures\n"
|
||||
if !defined($supported_output) || $@;
|
||||
my %supported_architecture = map { $_ => 1 } split(/\s+/, $supported_output);
|
||||
for my $architecture (@requested_architectures) {
|
||||
my $machine = "xCAT-genesis-builder/oe/kas/$architecture.yml";
|
||||
die "xcat-core source does not support Genesis architecture $architecture\n"
|
||||
unless -f "$xcat_source/$machine";
|
||||
unless $supported_architecture{$architecture};
|
||||
}
|
||||
die "xcat-core checkout is not clean\n"
|
||||
if capture_command('git', '-C', $xcat_source, 'status', '--porcelain') ne '';
|
||||
|
||||
+9
-1
@@ -112,6 +112,7 @@ my $skip_tarball = 0;
|
||||
my $genesis_release = '';
|
||||
my $genesis_release_checksums;
|
||||
my @genesis_release_architectures;
|
||||
my $genesis_release_version;
|
||||
my $scrub_all_chroots = 0;
|
||||
my $keep_buildroots = 0; # keep per-step mock chroots after build (default: --scrub=chroot each)
|
||||
my $dry_run = 0;
|
||||
@@ -380,6 +381,7 @@ if ($genesis_release ne '') {
|
||||
unless hashes_equal($checksums_before, $checksums_after);
|
||||
$genesis_release_checksums = $checksums_before;
|
||||
@genesis_release_architectures = split(/,/, $manifest->{architectures});
|
||||
$genesis_release_version = $manifest->{version};
|
||||
}
|
||||
|
||||
# An explicit --target builds just that target; otherwise build the current host
|
||||
@@ -1112,7 +1114,9 @@ sub verify_common_repo {
|
||||
my @supported_names = map { rpm_package_name($_) } architectures();
|
||||
my %supported = map { $_ => 1 } @supported_names;
|
||||
my @manifest_missing = grep { !exists($common{$_}) } @supported_names;
|
||||
my @manifest_unknown = grep { !$supported{$_} } sort keys %common;
|
||||
my @manifest_unknown = grep {
|
||||
/^xCAT-genesis-openembedded-/ && !$supported{$_}
|
||||
} sort keys %common;
|
||||
die "FATAL: [common] is missing supported packages: @manifest_missing\n"
|
||||
if @manifest_missing;
|
||||
die "FATAL: [common] has unsupported packages: @manifest_unknown\n"
|
||||
@@ -1121,6 +1125,10 @@ sub verify_common_repo {
|
||||
die "FATAL: Genesis release has no architectures\n"
|
||||
unless @genesis_release_architectures;
|
||||
my @names = map { rpm_package_name($_) } @genesis_release_architectures;
|
||||
my %release_architecture = map { $_ => 1 } @genesis_release_architectures;
|
||||
my @omitted = grep { !$release_architecture{$_} } architectures();
|
||||
print "WARNING: Genesis release version $genesis_release_version omits current architectures: @omitted\n"
|
||||
if @omitted;
|
||||
my %req = map { $_ => $common{$_} } @names;
|
||||
|
||||
@names = sort @names;
|
||||
|
||||
+11
-1
@@ -101,6 +101,7 @@ my $gpg_home = '';
|
||||
my $genesis_release = ''; # OpenEmbedded Genesis package release to publish alongside
|
||||
my $genesis_release_checksums; # its verified SHA256SUMS, read once at startup
|
||||
my @genesis_release_architectures;
|
||||
my $genesis_release_version;
|
||||
# The OpenEmbedded Genesis debs are published ONCE, in a pool of their own that every suite indexes.
|
||||
# They are Architecture:all and identical for all suites, so a per-suite copy would multiply hundreds
|
||||
# of megabytes by the number of codenames for no gain.
|
||||
@@ -321,6 +322,7 @@ if ($genesis_release ne '') {
|
||||
unless XCAT::BuildUtils::hashes_equal($before, $after);
|
||||
$genesis_release_checksums = $before;
|
||||
@genesis_release_architectures = split(/,/, $release_manifest->{architectures});
|
||||
$genesis_release_version = $release_manifest->{version};
|
||||
# Every suite's Packages index points into the shared Genesis pool, and publishing a release
|
||||
# replaces that pool -- so a run that rebuilt only some suites would leave the others indexing
|
||||
# files that no longer exist. Publish a release for all of them or for none.
|
||||
@@ -1063,7 +1065,9 @@ sub verify_shared_pool {
|
||||
} XCAT::GenesisRelease::architectures();
|
||||
my %supported = map { $_ => 1 } @supported_names;
|
||||
my @manifest_missing = grep { !exists($shared{$_}) } @supported_names;
|
||||
my @manifest_unknown = grep { !$supported{$_} } sort keys %shared;
|
||||
my @manifest_unknown = grep {
|
||||
/^xcat-genesis-openembedded-/ && !$supported{$_}
|
||||
} sort keys %shared;
|
||||
die "FATAL: [shared] is missing supported packages: @manifest_missing\n"
|
||||
if @manifest_missing;
|
||||
die "FATAL: [shared] has unsupported packages: @manifest_unknown\n"
|
||||
@@ -1074,6 +1078,12 @@ sub verify_shared_pool {
|
||||
my @names = map {
|
||||
XCAT::GenesisRelease::deb_package_name($_)
|
||||
} @genesis_release_architectures;
|
||||
my %release_architecture = map { $_ => 1 } @genesis_release_architectures;
|
||||
my @omitted = grep {
|
||||
!$release_architecture{$_}
|
||||
} XCAT::GenesisRelease::architectures();
|
||||
print "WARNING: Genesis release version $genesis_release_version omits current architectures: @omitted\n"
|
||||
if @omitted;
|
||||
my %req = map { $_ => $shared{$_} } @names;
|
||||
@names = sort @names;
|
||||
my %present = map { $_ => deb_version($pool, $_) } @names;
|
||||
|
||||
Reference in New Issue
Block a user