tech-pkg archive

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

rust, rust-bin, bulk builds



[Several of us have been discussing on pkgsrc-changes about the rust-bin
package.  I'm moving that here because it's seeming more ecomplicated,
and summarizing the previous discussion with background.]

Summary:

  lang/rust doesn't build reliably and this is agreed to be a problem.

  We now have lang/rust-bin which isntalls a binary from the rust
  project (and only works on platforms they support).

  There is a per-platform notion of whether lang/rust (build from binary
  bootstrap and source) or lang/rust-bin (rust project binary) should be
  used.  The point is to make bulk builds reliable so users have
  binaries of things like firefox.

  lang/rust and lang/rust-bin conflict because they both install rustc;
  nobody is surprised by this.

  lang/rust-bin has a PKGNAME of rust, not rust-bin.   The argument for
  this is that binary package users who want a rust compiler could  be
  unaware of this and do "pkgin install rust".  The argument against is
  that we usually use a -bin suffix for wrapped binaries, and that this
  package is different from lang/rust and should appear different, even
  if it installs things intended to be substantially the same.

  Another issue is that rust and rust-bin are marked to only build if
  the per-platform switch selects them, even when explicitly requested,
  and this is mostly about the PKGNAME being the same.  This means that
  bulk builds won't try to build rust (source).

  The consensus seems to be that rust-bin is likely to be with us for a
  long time.  However people would like rust (source) to work, and that
  remains the only option on NetBSD != amd64.

  The previous discussion reached agreemeent to change PKGNAME of
  rust-bin to rust-bin.


I tried to change PKGNAME to rust-bin (patch at end), and while this
worked for cbindgen, librsvg failed because the Makefile hardcodes a
dependency on rust the package name:

  BUILDLINK_API_DEPENDS.rust+=    rust>=1.39.0
  BUILDLINK_DEPMETHOD.rust?=      build
  .include "../../lang/rust/buildlink3.mk"

So, the question is what to do.  I can see multiple paths:

  1) Leave PKGNAME as is, remove the "don't build if not this type" logic,
  and hope the version numbers don't collide.

  2) Set PKGNAME of rust-bin to rust-bin, and add some API/ABI and
  DEPMETHOD variables that gets mapped in bl3 to rust vs rust-bin.

  3) Drop all API/ABI depends that are <= the older of rust and
  rust-bin, as nobody should be using inconsistent trees.  (While I know
  pkgsrc sort of supports building packages while other packages aren't
  up to date, I think that isn't wise and isn't particularly important
  to support, compared to the pain.  But I suspect many disagree wiht me
  on that.)  Set DEPMETHOD default to build.  Exxpect any other packges
  to switch on type.

Option 2 seems best long term to me, unless option 3 results in almost
no packges needing help, and is acceptable to most.

Option 1 also seems like a viable interim approach.



Index: rust/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/rust/Makefile,v
retrieving revision 1.171
diff -u -p -r1.171 Makefile
--- rust/Makefile	3 Jun 2020 10:45:04 -0000	1.171
+++ rust/Makefile	4 Jun 2020 13:24:11 -0000
@@ -20,12 +20,6 @@ USE_TOOLS+=		bash ggrep gmake perl:build
 # build on 7).  Mark earlier versions as broken.
 BROKEN_ON_PLATFORM+=	NetBSD-[1-7].*-*
 
-.include "type.mk"
-
-.if ${RUST_TYPE} != "src"
-PKG_SKIP_REASON+=	"Rust source package, RUST_TYPE is bin"
-.endif
-
 HAS_CONFIGURE=			yes
 PYTHON_FOR_BUILD_ONLY=		yes
 CONFIG_SHELL=			${PYTHONBIN}
Index: rust/buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/rust/buildlink3.mk,v
retrieving revision 1.4
diff -u -p -r1.4 buildlink3.mk
--- rust/buildlink3.mk	18 May 2020 16:17:20 -0000	1.4
+++ rust/buildlink3.mk	4 Jun 2020 13:24:11 -0000
@@ -5,13 +5,14 @@ BUILDLINK_TREE+=	rust
 .if !defined(RUST_BUILDLINK3_MK)
 RUST_BUILDLINK3_MK:=
 
-BUILDLINK_API_DEPENDS.rust+=	rust>=1.20.0
 
 .include "../../lang/rust/type.mk"
 .if ${RUST_TYPE} != "bin"
-BUILDLINK_PKGSRCDIR.rust?=	../../lang/rust
+BUILDLINK_API_DEPENDS.rust+=		rust>=1.20.0
+BUILDLINK_PKGSRCDIR.rust?=		../../lang/rust
 .else
-BUILDLINK_PKGSRCDIR.rust?=	../../lang/rust-bin
+BUILDLINK_API_DEPENDS.rust-bin+=	rust-bin>=1.20.0
+BUILDLINK_PKGSRCDIR.rust-bin?=		./../lang/rust-bin
 .endif
 
 BUILDLINK_PASSTHRU_DIRS+=	${PREFIX}/lib/rustlib
Index: rust/cargo.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/rust/cargo.mk,v
retrieving revision 1.13
diff -u -p -r1.13 cargo.mk
--- rust/cargo.mk	21 May 2020 21:03:44 -0000	1.13
+++ rust/cargo.mk	4 Jun 2020 13:24:11 -0000
@@ -27,7 +27,7 @@ MASTER_SITES?=	-${MASTER_SITE_CRATESIO}$
 .if ${RUST_TYPE} != "bin"
 BUILD_DEPENDS+=	rust-[0-9]*:../../lang/rust
 .else
-BUILD_DEPENDS+=	rust-[0-9]*:../../lang/rust-bin
+BUILD_DEPENDS+=	rust-bin-[0-9]*:../../lang/rust-bin
 .endif
 
 USE_TOOLS+=		bsdtar digest
Index: rust-bin/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/rust-bin/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- rust-bin/Makefile	3 Jun 2020 10:45:04 -0000	1.7
+++ rust-bin/Makefile	4 Jun 2020 13:24:11 -0000
@@ -1,21 +1,16 @@
 # $NetBSD: Makefile,v 1.7 2020/06/03 10:45:04 nia Exp $
 
-DISTNAME=	rust-1.42.0
+VERSION=	1.42.0
+DISTNAME=	rust-${VERSION}
+PKGNAME=	rust-bin-${VERSION}
 CATEGORIES=	lang
 MASTER_SITES=	https://static.rust-lang.org/dist/
-PKGREVISION=	1
 
 MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=	https://rust-lang.org/
 COMMENT=	Safe, concurrent, practical language (official binaries)
 LICENSE=	mit OR apache-2.0
 
-.include "../../lang/rust/type.mk"
-
-.if ${RUST_TYPE} != "bin"
-PKG_SKIP_REASON+=	"Rust binary package, RUST_TYPE is src"
-.endif
-
 ONLY_FOR_PLATFORM+=	Darwin-*-x86_64
 ONLY_FOR_PLATFORM+=	FreeBSD-*-i386
 ONLY_FOR_PLATFORM+=	FreeBSD-*-x86_64


Home | Main Index | Thread Index | Old Index