tech-pkg archive

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

Re: Building pkgsrc packages reproducibly



On Sun, Nov 12, 2017 at 04:28:12AM +0100, Pierre Pronchery wrote:
> the patch attached here adds initial support for building packages
> reproducibly for pkgsrc.

Very cool! Thank you!

Some comments:

> Index: mk/compiler/gcc.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/mk/compiler/gcc.mk,v
> retrieving revision 1.186
> diff -p -u -r1.186 gcc.mk
> --- mk/compiler/gcc.mk	7 Nov 2017 16:57:58 -0000	1.186
> +++ mk/compiler/gcc.mk	12 Nov 2017 03:18:39 -0000
> @@ -1,4 +1,4 @@
> -# $NetBSD: gcc.mk,v 1.186 2017/11/07 16:57:58 khorben Exp $
> +# $NetBSD: gcc.mk,v 1.185 2017/10/03 09:38:16 jperkin Exp $
>  #
>  # This is the compiler definition for the GNU Compiler Collection.
>  #
> @@ -347,6 +347,17 @@ CWRAPPERS_APPEND.cc+=	${_MKPIE_CFLAGS.gc
>  # CWRAPPERS_APPEND.ld+=	${_MKPIE_LDFLAGS.gcc}
>  .endif
>  
> +.if ${_PKGSRC_MKREPRO} == "yes"
> +.export WRKDIR
> +# XXX the dollar sign should not be expanded by the shell
> +_GCC_CFLAGS+=		-fdebug-prefix-map=$$$$WRKDIR/=
> +.endif

Why is the export needed? Shouldn't ${WRKDIR} be expanded before being
passed to gcc?

(Does 'export' even work in Makefiles like this? Perhaps you mean
".export"?)

> Index: mk/repro/ar
> ===================================================================
> RCS file: mk/repro/ar
> diff -N mk/repro/ar
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ mk/repro/ar	12 Nov 2017 03:18:39 -0000
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +if [ $# -ge 2 ]; then
> +	args="$1"
> +	mod="$2"
> +	shift 2
> +
> +	exec /usr/bin/ar "$mod$args" "$@"
> +else
> +	exec /usr/bin/ar "$@"
> +fi

Is ar(1) in /usr/bin on all systems supported by pkgsrc?

> Index: mk/repro/repro.mk
> ===================================================================
> RCS file: mk/repro/repro.mk
> diff -N mk/repro/repro.mk
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ mk/repro/repro.mk	12 Nov 2017 03:18:39 -0000
> @@ -0,0 +1,15 @@
> +# $NetBSD$
> +#
> +# Infrastructure support for PKGSRC_MKREPRO.
> +#
> +# Keywords: reproducible
> +#
> +
> +.if ${_PKGSRC_MKREPRO} == "yes"
> +
> +# force ar(1) to be deterministic
> +TOOLS_CREATE+=	ar
> +TOOLS_PATH.ar?=	${PKGSRCDIR}/mk/repro/ar
> +TOOLS_ARGS.ar?=	D
> +
> +.endif

Do we need a minimum version of ar(1) to support "D"?
 Thomas


Home | Main Index | Thread Index | Old Index