Opened 9 years ago

Closed 9 years ago

#33847 closed defect (fixed)

clang-2.9, clang-3.0, clang3.1: /opt/local/libexec/llvm-*/bin/ld already exists and does not belong to a registered port

Reported by: ryandesign (Ryan Schmidt) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.0.4
Keywords: Cc:
Port: clang-2.9, clang-3.0, clang-3.1

Description

The buildbot reports that clang-2.9, clang-3.0 and clang-3.1 fail activation because of the presence of unregistered files /opt/local/libexec/llvm-*/bin/ld:

clang-2.9:

Error: Target org.macports.activate returned: Image error: /opt/local/libexec/llvm-2.9/bin/ld already exists and does not belong to a registered port. Unable to activate port clang-2.9. Use 'port -f activate clang-2.9' to force the activation.

clang-3.0:

Error: Target org.macports.activate returned: Image error: /opt/local/libexec/llvm-3.0/bin/ld already exists and does not belong to a registered port. Unable to activate port clang-3.0. Use 'port -f activate clang-3.0' to force the activation.

clang-3.1:

Error: Target org.macports.activate returned: Image error: /opt/local/libexec/llvm-3.1/bin/ld already exists and does not belong to a registered port. Unable to activate port clang-3.1. Use 'port -f activate clang-3.1' to force the activation.

I have {clang,llvm}-{2.9,3.0} installed on my system (not yet updated to the very latest version), and /opt/local/libexec/llvm-*/bin/ld does not exist on my system. Not sure what caused these files to get installed on the buildbot but not on my system. But it sounds like maybe an older version of the ports inadvertently installed these files directly into ${prefix} bypassing ${destroot}. It would probably be best for the clang ports need to clean up this situation. See the bottom of r38613 for an example of how this can be done.

Change History (4)

comment:1 Changed 9 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Status: newassigned

Yeah, there was a bug in the previous destroot which installed it to ${prefix} rather than ${destroot}${prefix} ... I thought we were sandboxing destroot, but it looks like we're not...

comment:2 Changed 9 years ago by jeremyhu (Jeremy Huddleston Sequoia)

The problem is that a post-activate won't work since this happens during activate ... are you suggesting that we do it pre-activate because that doesn't seem right either in the legitimate case (we'll be replacing ld from a previous version of the port with the new one in this port).

Is there a cleaner way you can think of other than just '-f' or manually removing it?

comment:3 Changed 9 years ago by ryandesign (Ryan Schmidt)

Yes, do it in pre-activate. It should work fine. I've done it in other ports before.

comment:4 Changed 9 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.