2nd attempt - Re: port doctor patch

Kurt Hindenburg khindenburg at macports.org
Sat Dec 13 18:55:21 PST 2014


On Dec 13, 2014, at 7:07 PM, Clemens Lang <cal at macports.org> wrote:

> Hi,
> 
>> It still works since I’m using sudo.
> 
> Well, MacPorts doesn't, it drops privileges while building. It's possible the
> test should be doing that as well and fails to do it, in which case it should
> be fixed.
> 
I looked at portutil’s dropPrivileges and evaluateToRoot.  The dropPrivileges needed some macports:: added to some variables and the debug line  commented out when called from doctor.tcl.  I wasn’t sure this was the way to do it as I’m not familiar with how the normal “build” works.

>> If I try to use ‘port doctor’ I get
>> "Error: Insufficient privileges to write to MacPorts install prefix.”
>> 
>> I can generate the “cache error” if I do "clang test.c -o main_test “ from the
>> command-line.
>> 
>> I’m not clear on what system setup having this test in doctor is worthwhile.
> 
> See above. The test might be missing a priv drop.
> 
> 
>> It should be using the system *C compiler*, which may or may not be clang.
> 
> The bug is clang-specific. The test can be skipped if the system C compiler isn't
> clang – but that does not mean /usr/bin/clang won't be affected by the problem,
> so I'm all for using /usr/bin/clang for the test if it exists, and skip it
> otherwise.
> 
The attached patch will at least prevent port doctor from crashing.  If we want to skip if no compiler installed, the current output proc would need fixed to allow a SKIP return value.

Kurt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: doctor2.tcl.diff
Type: application/octet-stream
Size: 2830 bytes
Desc: not available
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20141213/148db481/attachment-0001.obj>


More information about the macports-dev mailing list