Skip to content
This repository was archived by the owner on Mar 6, 2020. It is now read-only.
This repository was archived by the owner on Mar 6, 2020. It is now read-only.

gb fails when pwd has a symlink #308

@eparis

Description

@eparis

Below is a reproducer script. You will see gb build work once and fail once. The second time it looks like gb is figuring out the absolute/real path of cwd and then doing ../../../ type operations in relation to the absolute path. But linux is obviously interpreting those in relation to pwd....

#!/bin/bash
set -e

export GOPATH="$HOME/gopath"

# The following should work just fine.
go get k8s.io/kubernetes
cd $GOPATH/src/k8s.io/kubernetes
mkdir -p _output/local/go/src/k8s.io
ln -s $GOPATH/src/k8s.io/kubernetes _output/local/go/src/k8s.io/kubernetes > /dev/null 2>&1 || true
ln -s $GOPATH/src/k8s.io/kubernetes/Godeps/_workspace/ _output/local/go/vendor > /dev/null 2>&1 || true

echo "Setup complete. Now to run the test where pwd does not have a symlink"

# you must explicitly tell it what to build as filepath.Walk() will not follow the src/k8s.io/kubernetes symlink  :-(
cd $GOPATH/src/k8s.io/kubernetes/_output/local/go
gb build k8s.io/kubernetes/cmd/kubelet

echo "YAY! It worked! (I knew it would), now watch it fail because pwd does have a symlink!!!"

# But this will not work  :-(
ln -s $GOPATH/src/k8s.io/kubernetes $HOME/kubernetes > /dev/null 2>&1 || true
cd $HOME/kubernetes/_output/local/go/
gb build k8s.io/kubernetes/cmd/kubelet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions