svn commit: r262660 - projects/release-embedded/release

Glen Barber gjb at FreeBSD.org
Mon Mar 3 15:41:30 UTC 2014


On Mon, Mar 03, 2014 at 09:12:06AM -0500, John Baldwin wrote:
> On Saturday, March 01, 2014 12:44:41 pm Glen Barber wrote:
> > Author: gjb
> > Date: Sat Mar  1 17:44:40 2014
> > New Revision: 262660
> > URL: http://svnweb.freebsd.org/changeset/base/262660
> > 
> > Log:
> >   If building i386/i386 on amd64/amd64, append TARGET=i386 and
> >   TARGET_ARCH=i386 to CHROOT_MAKEENV, ensuring the i386 build
> >   is done within a true i386 build environment.
> >   
> >   Sponsored by:	The FreeBSD Foundation
> > 
> > Modified:
> >   projects/release-embedded/release/release.sh
> > 
> > Modified: projects/release-embedded/release/release.sh
> > ==============================================================================
> > --- projects/release-embedded/release/release.sh	Sat Mar  1 17:36:10 2014	(r262659)
> > +++ projects/release-embedded/release/release.sh	Sat Mar  1 17:44:40 2014	(r262660)
> > @@ -147,6 +147,13 @@ else
> >  	ARCH_FLAGS=
> >  fi
> >  CHROOT_MAKEENV="MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj"
> > +if [ ! -z ${TARGET} ] && [ ! -z ${TARGET_ARCH} ] && \
> > +	[ ${TARGET} = "i386" ] && \
> > +	[ ${TARGET_ARCH} = "i386" ] && \
> > +	[ "$(sysctl -n hw.machine)" = "amd64" ] && \
> > +	[ "$(sysctl -n hw.machine_arch)" = "amd64" ]; then
> > +		CHROOT_MAKEENV="${CHROOT_MAKEENV} TARGET=i386 TARGET_ARCH=i386"
> > +fi
> 
> You can remove the -z checks if you add some quotes:
> 
> if [ "$TARGET" = "i386" -a "$TARGET_ARCH" = "i386" ]
> 
> etc.
> 

Thanks, I'll fix it.

> However, this seems a bit hackish to hardcode this only for i386.  Wouldn't
> this also apply to building powerpc on powerpc64?  Or rather, does this mean
> you don't trust cross-built releases?  cross-built releases should work (and
> if they don't, they should be fixed)
> 

Yes, this would also apply to powerpc on powerpc64.  I'm thinking of
changing this to use kern.supported_archs, but have not yet had a chance
to look if this has been merged to stable/10 or stable/9 yet.

It isn't that I don't trust cross-built releases (in fact, all !x86
releases have been cross-built starting with 9.2-R).  The idea here was
really that because we can run the i386 binaries in the build chroot, it
would be preferable to use i386 userland to build the i386 build.  (The
same can be said for powerpc on powerpc64.)

The "problem" I'm really trying to solve with this is that I want to add
the script that wrap around release.sh for the snapshot builds, but in
order to do that, I needed to add special cases like this to eliminate
any local patches to release.sh to provide truly reproducible builds.

To be perfectly honest though, I really do not want to add this case for
all possible combinations where it would work.  Maybe it needs to go
into the configuration file instead.

Glen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-projects/attachments/20140303/dc8f8ce5/attachment.sig>


More information about the svn-src-projects mailing list