mikedanese / gazel Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED: use gazelle
License: Apache License 2.0
DEPRECATED: use gazelle
License: Apache License 2.0
e.g. only observe files tracked by git.
Right now gazel is coded to the kubernetes repository. It should be possible to run gazel on other go repos without forking. A json or yaml config file in the repo root might work.
cc @justinsb since you may have already done this. @pjjw since I see you've forked gazel because this feature didn't exist.
Right now the build context is hard coded to linux amd64 so that gazel is stable on all platforms it runs out. We should be able to support generating darwin amd64 BUILD files using select()
statements on the cpu configuration of bazel.
ref
Line 483 in 1e36482
Running gazel removes "go_prefix" from the root BUILD file.
-load("@io_bazel_rules_go//go:def.bzl", "go_prefix")
+load("@io_bazel_rules_go//go:def.bzl")
If a vendored item depends on headers in the repo, it fails with the generated rule like:
ERROR: /home/lincoln.stoll/src/github.com/heroku/vendor/BUILD:2057:1: C++ compilation of rule '//vendor:github.com/erikdubbelboer/gspt_cgo.cgo.dir/gen/_cgo_lib' failed: linux-sandbox failed: error executing command /media/data/.cache/bazel/_bazel_lincoln.stoll/634c69ae0c5fc3015b4adea04323e7ab/execroot/_bin/linux-sandbox ... (remaining 43 argument(s) skipped).
/media/data/.cache/bazel/_bazel_lincoln.stoll/634c69ae0c5fc3015b4adea04323e7ab/bazel-sandbox/6cf18494-01f4-49d6-870b-bb664034f3b5-0/execroot/bazel-out/local-fastbuild/genfiles/vendor/github.com/erikdubbelboer/gspt_cgo.cgo.dir/src/vendor/github.com/erikdubbelboer/gspt/gspt.go:5:26: fatal error: setproctitle.h: No such file or directory
This seems to be because the gcc command runs in the sandbox root, but the header is in the vendor/xxx
path so it isn't found. cgo_library
seems like it would/could fix this by passing in that path as an include path (https://github.com/bazelbuild/rules_go/blob/master/go/def.bzl#L937-L938), but this isn't possible with cgo_genrule
I'm happy to have a go at a fix, but I was wondering what the reason was for switching to cgo_genrule
in the first place?
Currently gazel does not print its version number and help text is sent to stdout.
I wanted to know which version of gazel I am currently using on my CI server to generate my go BUILD files and wasn't able to do so easily. Additionally, it would be nice to have a command that exits with a 0 but doesn't write anywhere except stdout (like --version or --help) for quick smoke tests.
A recursive filegroup only matches files that are not owned by any other package, which means that to create the kubernetes-src
tarball for releases, we either need to do this outside bazel, or we need to autogen a sources
filegroup for each BUILD file.
Any objections to just doing this? It'd be a good chance for me to jump into gazel
.
$ go get -u gopkg.in/mikedanese/gazel.v10/gazel
$ gazel
$ gazel --root "."
$ gazel --root "${PWD}"
wrote "/home/me/go/src/foo/bar/BUILD"
wrote "foo/bar/BUILD"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.