tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rust and NetBSD/sparc64: proposed short-term fix for review



I have looked into the NetBSD rust sparc64 issues.

First, there is an issue with openssl on sparc64 and other arches that
use m4, but that's a separate issue and being addressed separately.

To start from the recent begininng, so that all the previous messages
can be ignored:

A while ago I found that rust did not build on NetBSD/9, because the
1.44.1 bootstrap, which was built for NetBSD 8, depended on pkgsrc
openssl.  This is correct, because pkgsrc has required openssl 1.1 since
January, and 8 does not have 1.1 in base.

Thus, when building on 9, the 8 bootstrap fails to run because the 8
pkgsrc libs are not present.  It also would fail to run because of base
system libs not being present, but there has been a dependency on
compat80 for a while.

SmartOS addresses this by bundling the pkg libs in the bootstrap.

I addressed this by adding DEPENDS on openssl in rust, so that pkgsrc
openssl would be present.  It has to be DEPENDS, not BUILD_DEPENDS,
because the cargo that is built also links against these libs.

The sparc64 and powerpc arches has the same requirement for compat80.  I
assumed their bootstraps were built similarly and thus added the openssl
dependency.

Martin pointed out that rust no longer built on sparc64 (noticed because
openssl failed).  We looked at the bootstrap and it is linked against
base openssl, not pkgsrc.  I then looked at the powerpc bootstrap and it
is similarly linked against base not pkgsrc.  So there is no need to
depend on pkgsrc openssl for these arches.

(I looked at the x86_64 bootstrap and that cargo does not link against
openssl at all, but that's an side comment not relevant to the present
discussion.)

Therefore I have prepared a patch to lang/rust/Makefile to limit the
openssl DEPENDS to just i386.  It seems to be working on my NetBSD
9/i386 test box, but it will take overnight to finish -- it's a 2006
MacBook.

Please review the diff.  Unless someone can point out that it's wrong,
I'll commit tomorrow no earlier than 16ZZ and request a pullup.  I'm
happy to wait a bit if there's a reason -- but this is holding up larger
updates to rust in pkgsrc HEAD.

The patch basically duplicates the "if NetBSD >=9 and these arches"
ifdef, puts compat80 under the first copy exactly as before, and puts
the openssl line under the second copy, now i386 only.  I chose clearly
correct over pretty and elegant, as this is all going away or changing
with new bootstraps anyway.  I know there are double parens around the
arch, all part of minimal changes and minimal future chagnes if we have
to add an arch to the second if.

I left PKGREVISION++ out because rust did not build on sparc64
previously, because of this, and there is no evidence of anyone trying
to build on powerpc, and I'd rather risk not bumping on those than
torque around lots of users, especially on the branch.


Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/rust/Makefile,v
retrieving revision 1.195
diff -u -p -r1.195 Makefile
--- Makefile	25 Sep 2020 12:21:02 -0000	1.195
+++ Makefile	28 Sep 2020 23:41:16 -0000
@@ -525,10 +525,16 @@ stage0-bootstrap: install
 # \todo Explain why this is limited to a small list of architectures,
 # and in particular why not x86_64.
 DEPENDS+=	compat80>=0:../../emulators/compat80
+.endif
+
+.if (${OPSYS} == "NetBSD") && \
+		((${MACHINE_ARCH} == "i386")) \
+	&& (empty(OS_VERSION:M[012345678].*) || \
+	    !empty(OS_VERSION:M8.99.*))
 # Bootstrap kits use openssl, which on NetBSD 8 comes from pkgsrc.
 # Therefore the pkgsrc openssl libs need to be present as well.
-# (Observed on i386, and presumed true on the other
-# bootstrap-built-for-8 systems.)  Then, when the package is built,
+# The 1.44.1 i686 bootstrap links with pkgsrc openssl.  The others do
+# not.  When the package is built,
 # cargo links against pkgsrc openssl, so it must be a run-time
 # dependency as well.  Forcing USE_BUILTIN.openssl=no results in a
 # mysterious heimdal error, but straight DEPENDS seems to result in a

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index