Joshua Root <[email protected]> wrote:

> On 24/3/2026 22:18, Nils Breunese wrote:
>> Hello,
>> I noticed that after running `sudo port install kubectx` the kubectl 
>> dependency is missing:
>> ——
>> ❯ kubectx
>> kubectl is not installed
>> ——
>> The Portfile contains this line 
>> (https://github.com/macports/macports-ports/blob/master/sysutils/kubectx/Portfile#L24):
>> ——
>> depends_run         path:${prefix}/bin/kubectl:kubectl-1.27
>> ——
>> ${prefix}/bin/kubectl doesn’t exist on my machine, but MacPorts didn’t 
>> install the kubectl-1.27 port.
>> Shouldn’t MacPorts have installed the kubectl-1.27 port in this case?
> Yes, and it does for me. What does debug output say about the dependency when 
> you install? This is mine:
> 
> --->  Computing dependencies for kubectx
> DEBUG: kubectx has no conflicts
> DEBUG: Searching for dependency: kubectl-1.27
> DEBUG: Didn't find receipt, going to depspec file for: kubectl-1.27

I see this debug logging:

——
---> Computing dependencies for kubectx
DEBUG: kubectx has no conflicts
DEBUG: Found Dependency: path: /opt/local/bin filename: kubectl
DEBUG: Searching for dependency: kubectl-1.27
DEBUG: Didn't find receipt, going to depspec file for: kubectl-1.27
DEBUG: Found Dependency: path: /opt/local/bin filename: kubectl
——

I checked that kubectl wasn’t in my path (which includes /opt/local/bin):

——
❯ which kubectl
kubectl not found
——

However, it turns out that /opt/local/bin/kubectl existed as a symlink pointing 
to a non-existent target:

——
❯ file /opt/local/bin/kubectl
/opt/local/bin/kubectl: broken symbolic link to /opt/local/bin/kubectl1.30
——

After removing that broken symlink and installing kubectx again, things are now 
indeed working as expected.

Thanks!

Nils.

Reply via email to