Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linking submodule of go workspace #27

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

timebertt
Copy link
Contributor

Proposed Changes

  • when linking go src to the vgopath, we skip symlinking directories which contain other submodules

Fixes #26

Example result (using the reproduction steps from the issue):

$ pwd
/tmp/workspace
$ mkdir tmp && vgopath -o tmp
$ tree
.
├── go.mod # example.dev/main
├── go.work # use both example.dev/main and example.dev/main/sub
├── sub
│  └── go.mod # example.dev/main/sub
└── tmp
   ├── bin -> /Users/ebertti/go/bin
   ├── pkg -> /Users/ebertti/go/pkg
   └── src
      └── example.dev
         └── main
            ├── go.mod -> /tmp/workspace/go.mod
            ├── go.work -> /tmp/workspace/go.work
            ├── sub
            │  └── go.mod -> /tmp/workspace/sub/go.mod
            └── tmp -> /tmp/workspace/tmp

Verified with timebertt/kubernetes-controller-sharding#228 and gardener/gardener@abf64b6.

@timebertt timebertt requested a review from a team as a code owner April 24, 2024 06:21
@timebertt
Copy link
Contributor Author

@afritzler I think this scenario used to work (1829a8f#diff-67213f39b84a013e7db04664cd3ad943b7a237d97b9c6e862d10806ac27def28R209-R210) but might have been broken by 2520e6a#diff-b94d4322eb20f9cd90dc342d084155e9a360a54d58e2ee74170a73c80a967d42R108-R109.

This PR is a more general solution that works independently of whether modules have a version assigned.

@afritzler
Copy link
Member

Thanks @timebertt for the PR. I updated here the Golang version and did some other project housekeeping. Lets merge that and rebase this PR with those changes.

/ref #28

@timebertt timebertt force-pushed the workspace-submodules branch from 60a6658 to 9980043 Compare April 24, 2024 10:57
@github-actions github-actions bot added size/L bug Something isn't working labels Apr 24, 2024
@timebertt
Copy link
Contributor Author

Lovely, rebase done :)

@afritzler afritzler merged commit eaaa873 into ironcore-dev:main Apr 24, 2024
5 checks passed
@timebertt timebertt deleted the workspace-submodules branch April 24, 2024 12:17
@timebertt
Copy link
Contributor Author

Thanks for the prompt release @afritzler!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error linking submodule of go workspace
2 participants