Ensure ordinals are created during release process
authorMatt Caswell <matt@openssl.org>
Thu, 24 Jun 2021 15:07:03 +0000 (16:07 +0100)
committerPauli <pauli@openssl.org>
Mon, 28 Jun 2021 23:51:30 +0000 (09:51 +1000)
We introduce a new makefile target "make release-update" that forces
ordinal file renumbering, and also does the fips checksum updates. We
then call that  from the release script.

Fixes #15806

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15901)

Configurations/unix-Makefile.tmpl
dev/release.sh
util/mknum.pl

index 8de2b9bd4178ab60c4276aa616818cef2960b30f..b82166f70ae65eadf24f0cd82d980135f136cb4f 100644 (file)
@@ -1310,6 +1310,19 @@ CRYPTOHEADERS={- join(" \\\n" . ' ' x 14,
                       fill_lines(" ", $COLUMNS - 14, sort keys %cryptoheaders)) -}
 SSLHEADERS={- join(" \\\n" . ' ' x 11,
                    fill_lines(" ", $COLUMNS - 11, sort keys %sslheaders)) -}
+
+renumber: build_generated
+       $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION) --no-warnings \
+                --ordinals $(SRCDIR)/util/libcrypto.num \
+                --symhacks $(SRCDIR)/include/openssl/symhacks.h \
+                --renumber \
+                $(CRYPTOHEADERS)
+       $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION) --no-warnings \
+                --ordinals $(SRCDIR)/util/libssl.num \
+                --symhacks $(SRCDIR)/include/openssl/symhacks.h \
+                --renumber \
+                $(SSLHEADERS)
+
 ordinals: build_generated
        $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION) --no-warnings \
                 --ordinals $(SRCDIR)/util/libcrypto.num \
index 14a3d445c601f2668db47d2f31356f49ed4346ea..bf5aa8af35b92905908a041500e38ac7652f5b9b 100755 (executable)
@@ -322,7 +322,12 @@ echo "== Configuring OpenSSL for update and release.  This may take a bit of tim
 $VERBOSE "== Checking source file updates and fips checksums"
 
 make update >&42
-
+# As long as we're doing an alpha release, we can have symbols without specific
+# numbers assigned. In a beta or final release, all symbols MUST have an
+# assigned number.
+if [ "$next_method" != 'alpha' ]; then
+    make renumber >&42
+fi
 make update-fips-checksums >&42
 
 if [ -n "$(git status --porcelain)" ]; then
index 284fe891ef45f24272e88a2b1952af9e2cd425c6..8c978dfe2dc52c2e20f50da8a1f0e94bceb765b7 100644 (file)
@@ -22,6 +22,7 @@ my $symhacks_file = undef;      # a symbol hacking file (optional)
 my $version = undef;            # the version to use for added symbols
 my $checkexist = 0;             # (unsure yet)
 my $warnings = 1;
+my $renumber = 0;
 my $verbose = 0;
 my $debug = 0;
 
@@ -29,6 +30,7 @@ GetOptions('ordinals=s' => \$ordinals_file,
            'symhacks=s' => \$symhacks_file,
            'version=s'  => \$version,
            'exist'      => \$checkexist,
+           'renumber'   => \$renumber,
            'warnings!'  => \$warnings,
            'verbose'    => \$verbose,
            'debug'      => \$debug)
@@ -88,12 +90,7 @@ foreach my $f (($symhacks_file // (), @ARGV)) {
     close IN;
 }
 
-# As long as we're running in development or alpha releases, we can have
-# symbols without specific numbers assigned.  In beta or final release, all
-# symbols MUST have an assigned number.
-if ($version !~ m/^\d+\.\d+\.\d+(?:-alpha|(?:-.*?)?-dev$)/) {
-    $ordinals->renumber();
-}
+$ordinals->renumber() if $renumber;
 
 if ($checkexist) {
     my %new_names = map { $_->name() => 1 }