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

[Golang] Remove redundant dependency tracking for module building #26

Closed
vaastav opened this issue Sep 18, 2023 · 2 comments
Closed

[Golang] Remove redundant dependency tracking for module building #26

vaastav opened this issue Sep 18, 2023 · 2 comments

Comments

@vaastav
Copy link
Contributor

vaastav commented Sep 18, 2023

In GitLab by @JonathanMace on Sep 18, 2023, 20:17

See #6 for a discussion.

When generating Golang modules, we do not need to explicitly keep track of which dependencies are needed for inclusion in the go.mod file. It is enough to use go mod tidy to have Go automatically determine the module dependencies to include.

Currently, the Golang module builder does track modules and explicitly constructs the go.mod file. We can simplify the code by removing this logic.

One caveat is unpublished modules -- a module might depend on a sibling module on the local filesystem that cannot be resolved using its import URL. In this case the go.mod file needs a replace directive to point to the sibling directory. Currently, the Golang workspace builder adds this replace directive. The replace directive will be need before we can invoke go mod tidy. This should be a minor tweak.

This change will also result in some code being removed from plugins, which are currently explicitly adding the required modules to the modulebuilder; now they don't need to do that at all.

@vaastav
Copy link
Contributor Author

vaastav commented Sep 18, 2023

In GitLab by @JonathanMace on Sep 18, 2023, 23:30

mentioned in commit 6a9c3d9cf57fbe4d86f4d062305de6a4983220d6

@vaastav
Copy link
Contributor Author

vaastav commented Sep 18, 2023

In GitLab by @JonathanMace on Sep 18, 2023, 23:32

mentioned in commit 6e33b1a

@vaastav vaastav closed this as completed Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant