Giter Site home page Giter Site logo

Comments (7)

ashi009 avatar ashi009 commented on May 30, 2024

I guess this will not come before vgo hits GA?

from bazel-gazelle.

jayconrod avatar jayconrod commented on May 30, 2024

Not sure what you mean by GA. The earliest vgo could possibly become the official Go build system is Go 1.12 (next winter). It will be shipped in the 1.11 SDK as an experimental tool.

I'll get this functionality in as soon as I can, but there are a lot of things going on in parallel right now. We'll probably want more direct support for importing vgo mod files, too.

from bazel-gazelle.

ashi009 avatar ashi009 commented on May 30, 2024

from bazel-gazelle.

clintberry avatar clintberry commented on May 30, 2024

The link to the tool that adds repo rules to WORKSPACE doesn't appear to work anymore. The link is in this comment: bazelbuild/rules_go#295 (comment)

What is the latest and greatest way to update the WORKSPACE with all my external dependencies automagically? :-)

from bazel-gazelle.

linzhp avatar linzhp commented on May 30, 2024

To get the transitive dependencies of an external package, I am thinking about the following:

  1. Create a Go module in TempDir
  2. Convert the existing go_repository rules into the new go.mod file in TempDir.
  3. Run go get import/[email protected] in the TempDir
  4. Add/update existing go_repository rules based on the new go.mod/go.sum files

I don't want to assume go.mod file exists in the main repo, and instead use go_repository rules as the source of truth in Step 2.

@jayconrod What do you think?

from bazel-gazelle.

jayconrod avatar jayconrod commented on May 30, 2024

@linzhp I'm not sure the go command should be involved at all in this process. There may be a number of workspaces declared with http_archive or other repository rules, and go get won't be able to work with those. Gazelle won't be able to update those, but it should still be able to load dependencies from them.

Some more thought also needs to go into making this language agnostic.

from bazel-gazelle.

linzhp avatar linzhp commented on May 30, 2024

I agree that we should make this language agnostic by having each language extension implement how they get their dependencies and resolve the versions. But for Go, I don't see a big issue with the "go get" approach:

  • With close to 1000 external libraries we are using in our Go repo, we don't see any other Go library except Gazelle itself for which we cannot use go_repository. We even use go_repository for some repos that only contain proto files and use them to generate Go code at build time.
  • Gazelle only generates go_repository rules for Go libraries. I think it's a fair assumption that if people decide to use http_archive or other workspace rules to download their Go libraries, they will have to manage those rules themselves.
  • With no public API available, go get seems the only way we can resolve the transitive deps and their version in a consistent way to the Go modules system. Gazelle calls other go subcommands anyway.

from bazel-gazelle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.