On 6/15/2018 10:02 PM, Cy Schubert wrote:
> In message <201806160436.w5g4axks039...@slippy.cwsent.com>, Cy Schubert 
> writes:
>> In message <201806160035.w5g0zjfd066...@repo.freebsd.org>, Bryan 
>> Drewery writes
>> :
>>> Author: bdrewery
>>> Date: Sat Jun 16 00:35:19 2018
>>> New Revision: 335244
>>> URL: https://svnweb.freebsd.org/changeset/base/335244
>>>
>>> Log:
>>>   Assert that a build is done before an install.
>>>   
>>>   This should also catch cases where the wrong MAKEOBJDIRPREFIX is used for
>>>   install.
>>>   
>>>   MFC after:        2 weeks
>>>   Sponsored by:     Dell EMC
>>>
>>> Modified:
>>>   head/Makefile.inc1
>>>
>>> Modified: head/Makefile.inc1
>>> ===========================================================================
>> ==
>>> =
>>> --- head/Makefile.inc1      Fri Jun 15 23:42:22 2018        (r335243)
>>> +++ head/Makefile.inc1      Sat Jun 16 00:35:19 2018        (r335244)
>>> @@ -89,7 +89,10 @@ MK_GCC_BOOTSTRAP=        no
>>>  .if make(installworld) || make(install) || make(distributeworld) || \
>>>      make(stageworld)
>>>  .-include "${OBJTOP}/compiler-metadata.mk"
>>> +.if !defined(_LOADED_COMPILER_METADATA)
>>> +.error A build is required first.  You may have the wrong MAKEOBJDIRPREFIX
>>  s
>>> et.
>>>  .endif
>>> +.endif
>>>  
>>>  # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from t
>> he
>>>  # tree to be friendlier to foreign OS builds. It's safe to do so unconditi
>> on
>>> ally
>>> @@ -195,6 +198,7 @@ compiler-metadata.mk: .PHONY .META
>>>     @: > ${.TARGET}
>>>     @echo ".info Using cached compiler metadata from build at $$(hostname) 
>>> on $$(date)" \
>>>         > ${.TARGET}
>>> +   @echo "_LOADED_COMPILER_METADATA=t" >> ${.TARGET}
>>>  .for v in ${_COMPILER_METADATA_VARS}
>>>     @echo "${v}=${${v}}" >> ${.TARGET}
>>>  .endfor
>>>
>>
>> Another data point: This also broke the following:
>>
>> cwsys# poudriere jail -c -m src=/opt/src/svn-current -j HEADi386 -a i386
>> [00:00:00] Creating HEADi386 fs at /poudriere/amd64/jails/HEADi386... 
>> done
>> [00:00:01] Copying /opt/src/svn-current to /poudriere/amd64/jails/HEADi3
>> 86/usr/src... done
>> [00:06:01] Starting make installworld
>> --- installworld ---
>> make[1]: "/export/obj/opt/src/svn-current/i386.i386/compiler-metadata.mk
>> " line 1: Using cached compiler metadata from build at cwsys on Fri Jun 
>> 15 18:39:46 PDT 2018
>> make[1]: "/opt/src/svn-current/Makefile.inc1" line 93: A build is 
>> required first.  You may have the wrong MAKEOBJDIRPREFIX set.
>> *** [installworld] Error code 1
>>
>> make: stopped in /opt/src/svn-current
>> 1 error
>>
>> make: stopped in /opt/src/svn-current
>> [00:06:01] Error: Failed to 'make installworld'
>> [00:06:01] Error while creating jail, cleaning up.
>> [00:06:01] Removing HEADi386 jail... done
>> [00:06:03] Cleaning HEADi386 data... done
>> cwsys# 
> 
> Nevermind. I found it. Stupid error on my part.
> 
> 

I'm curious what you did? Did you svn update after a buildworld and then
tried installworld? That would fail 1 time here but not again in the
future.

(Thinking outloud now, I could probably reuse the vcsversion code in
newvers.sh to record the build revision during buildworld and check it
matches at installworld time, but the assumes the same vcs tool is on
the install machine so it probably wouldn't work.)

I'm happy to see it may have caught a subtle mistake for you.

-- 
Regards,
Bryan Drewery

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to