Skip to content

Commit 9bdcd71

Browse files
buildsys: simplify abi-check
1 parent 2f2c243 commit 9bdcd71

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

abi-blacklist

Whitespace-only changes.

abi-check

+24-25
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
#!/usr/bin/perl -w
22

3-
my $flavour = shift;
4-
my $prev_abinum = shift;
5-
my $abinum = shift;
6-
my $prev_abidir = shift;
7-
my $abidir = shift;
3+
my $abinew = shift;
4+
my $abiold = shift;
85
my $skipabi = shift;
96

7+
$abinew =~ /abi-(.*)/;
8+
my $abinum = $1;
9+
1010
my $fail_exit = 1;
1111
my $EE = "EE:";
1212
my $errors = 0;
1313
my $abiskip = 0;
1414

1515
my $count;
1616

17-
print "II: Checking ABI for $flavour...\n";
17+
print "II: Checking ABI...\n";
1818

19-
if (-f "$prev_abidir/ignore"
20-
or -f "$prev_abidir/$flavour.ignore" or "$skipabi" eq "true") {
19+
if ($skipabi) {
2120
print "WW: Explicitly asked to ignore ABI, running in no-fail mode\n";
2221
$fail_exit = 0;
2322
$abiskip = 1;
2423
$EE = "WW:";
2524
}
2625

27-
if ($prev_abinum != $abinum) {
28-
print "II: Different ABI's, running in no-fail mode\n";
29-
$fail_exit = 0;
30-
$EE = "WW:";
31-
}
32-
33-
if (not -f "$abidir/$flavour" or not -f "$prev_abidir/$flavour") {
26+
#if ($prev_abinum != $abinum) {
27+
# print "II: Different ABI's, running in no-fail mode\n";
28+
# $fail_exit = 0;
29+
# $EE = "WW:";
30+
#}
31+
#
32+
if (not -f "$abinew" or not -f "$abiold") {
3433
print "EE: Previous or current ABI file missing!\n";
35-
print " $abidir/$flavour\n" if not -f "$abidir/$flavour";
36-
print " $prev_abidir/$flavour\n" if not -f "$prev_abidir/$flavour";
34+
print " $abinew\n" if not -f "$abinew";
35+
print " $abiold\n" if not -f "$abiold";
3736

3837
# Exit if the ABI files are missing, but return status based on whether
3938
# skip ABI was indicated.
@@ -53,7 +52,7 @@ my %module_syms;
5352
my $ignore = 0;
5453
print " Reading symbols/modules to ignore...";
5554

56-
for $file ("$prev_abidir/../blacklist", "$prev_abidir/../../perm-blacklist") {
55+
for $file ("abi-blacklist") {
5756
if (-f $file) {
5857
open(IGNORE, "< $file") or
5958
die "Could not open $file";
@@ -86,8 +85,8 @@ sub is_ignored($$) {
8685
# Read new syms first
8786
print " Reading new symbols ($abinum)...";
8887
$count = 0;
89-
open(NEW, "< $abidir/$flavour") or
90-
die "Could not open $abidir/$flavour";
88+
open(NEW, "< $abinew") or
89+
die "Could not open $abinew";
9190
while (<NEW>) {
9291
chomp;
9392
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
@@ -101,10 +100,10 @@ close(NEW);
101100
print "read $count symbols.\n";
102101

103102
# Now the old symbols, checking for missing ones
104-
print " Reading old symbols ($prev_abinum)...";
103+
print " Reading old symbols...";
105104
$count = 0;
106-
open(OLD, "< $prev_abidir/$flavour") or
107-
die "Could not open $prev_abidir/$flavour";
105+
open(OLD, "< $abiold") or
106+
die "Could not open $abiold";
108107
while (<OLD>) {
109108
chomp;
110109
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
@@ -146,8 +145,8 @@ foreach $sym (keys(%symbols)) {
146145
}
147146
print " " if $count;
148147
print "found $count new symbols\n";
149-
if ($count and $prev_abinum == $abinum) {
150-
print "WW: Found new symbols within same ABI. Not recommended\n";
148+
if ($count) {
149+
print "WW: Found new symbols. Not recommended unless ABI was bumped\n";
151150
}
152151

153152
print "II: Checking for changes to ABI...\n";

0 commit comments

Comments
 (0)