Comments (6)
This is where the request is made:
Line 75 in e7ddb9e
from rules_go.
This is an interesting problem that I think can be solved by introducing an intermediate extension that records the extracted information in the MODULE.bazel.lock
file. I'll give this some more thought and try to implement it.
from rules_go.
@fmeum thank you for looking at this! For us, we cannot source manage MODULE.bazel.lock because we don't use git and the unsupported merge of this huge file (it is 2MB for us) will be incorrect more often than not. So a solution involving direct specification of the inputs in MODULE.bazel or in a separate file would be much better
from rules_go.
@peakschris When you say "don't use Git", what are you using instead and why does that prevent you from checking in MODULE.bazel.lock? Bazel 7.2.0rc1 comes with a revised lockfile format that is much more VCS friendly and less verbose.
Generally speaking, I would like to first find a general solution that works out of the box, but I'm sure we'll find a way to support your use case.
from rules_go.
@fmeum we use a custom VCS layer, with perforce as the backend. The VCS layer was written years ago and is in maintenance mode now, so it's practically impossible to get significant changes made. It does not support custom merge drivers.
We also have a significant problem with contentious files that cause 'MR's to back up in our test pipeline. MODULE.bazel.lock would be a massively contentious file.
So there are two issues:
- MODULE.bazel.lock can't be auto-merged in our system and will be broken often. I can't give a tool to developers to use manually as some merge steps happen in CI via a web UI.
- MODULE.bazel.lock would cause MRs to queue up and retest. We don't have a good merge train like github.
I'm sure this will be an issue for others too, who have similar constraints. I don't have these issues with rules_js, etc, and I like their approach of providing the inputs to the toolchain in the MODULE.bazel file.
We can split up MODULE.bazel via include statements that allow different elements of the build to be specified in smaller files that are not contentious and are obvious to merge graphically.
Thanks again for thinking about this
from rules_go.
I've actually stumbled on a way to avoid these queries:
bazel_dep(name = "rules_go", version = "0.47.1")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(
version = "1.22.3",
# explicitly specify SDK names/checksums to avoid a query which fails in airgapped builds
# get checksums from https://go.dev/dl/?mode=json&include=all
sdks = {
"linux_amd64": ("go1.22.3.linux-amd64.tar.gz", "8920ea521bad8f6b7bc377b4824982e011c19af27df88a815e3586ea895f1b36"),
"windows_arm64": ("go.1.22.3.windows-arm64.tar.gz", "59b76ee22b9b1c3afbf7f50e3cb4edb954d6c0d25e5e029ab5483a6804d61e71"),
},
)
Would it be possible to update documentation (https://github.com/bazelbuild/rules_go/blob/master/go/toolchains.rst#go_download_sdk) to include examples of use with Modules? This is what I was missing.
from rules_go.
Related Issues (20)
- Unable to get io_bazel_rules_go to work with a custom c++ toolchain HOT 1
- Rules_go 0.47.0 downgraded the gomock dependency from 1.7.0-rc1 to 1.6.0, which broke support for generics in mocks HOT 1
- How to test an analysis.Analyzer?
- Differentiate compile actions under go_test
- `GoLink` for Gazelle fails on Go 1.20 or greater HOT 2
- goleak broken by recent timeout changes
- How do I depend on the "bazel" package of rules_go when using MODULE.bazel HOT 3
- [BAZEL CI] rules_go cgo:opts_test is failing with Bazel@HEAD HOT 1
- go_tool_binary / GoToolchainBinaryBuild actions don't always run on the correct platform
- GoStdlib, GoCompilePkg, etc. don't respect exec_compatible_with of the underlying C/C++ toolchain HOT 1
- rules_go + protobufs + experimental_sibling_repository_layout fails to build HOT 2
- How do you use protoc with 0.48.0? HOT 4
- Proposal: Fail protoc code gen on missing expected output files
- Embedding native buildinfo in Bazel binaries
- go_proto_library: Issue/New Feature for output path generation. HOT 1
- How to create go_proto_library automatically HOT 3
- rules_go 0.48.0 inconsistent strict deps behavior between bzlmod enabled and disabled HOT 2
- Cross-compilation to Linux on MacOS sets CGO_ENABLED=0 even though cgo=True in go_library and platform set to linux_amd64_cgo HOT 7
- link: package conflict error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_go.