-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
76274: backup: redact incremental storage URIs r=dt a=dt Release note: none. 76320: dev: various improvements to `--cross` compilation r=rail a=rickystewart 1. We bind-mount an empty file over `.bazelrc.user` so that user configuration doesn't interfere with or break cross builds. 2. Add a new `whereis` executable. It's basically just `realpath` except portable. 3. Update how `dev cache` finds the location of the `bazel-remote` binary: now we use `bazel run --run_under=whereis`, which doesn't require doing any funny stuff with `cquery`. 4. Allow cross-building `cmake` and `go_test` targets, using `realpath` to find where test and binary targets are placed. Closes #76094. Closes #76260. Release note: None Co-authored-by: David Taylor <[email protected]> Co-authored-by: Ricky Stewart <[email protected]>
- Loading branch information
Showing
11 changed files
with
122 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# intentionally empty (this file is mounted as .bazelrc.user for cross builds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") | ||
|
||
go_library( | ||
name = "whereis_lib", | ||
srcs = ["main.go"], | ||
importpath = "github.com/cockroachdb/cockroach/build/bazelutil/whereis", | ||
visibility = ["//visibility:private"], | ||
) | ||
|
||
go_binary( | ||
name = "whereis", | ||
embed = [":whereis_lib"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2022 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
// whereis is a helper executable that is basically just `realpath`. It's meant | ||
// to be used like: | ||
// bazel run ... --run_under //build/bazelutil/whereis | ||
// ... which will print the location of the binary you're running. Useful | ||
// because Bazel can be a little unclear about where exactly to find any given | ||
// executable. | ||
func main() { | ||
if len(os.Args) != 2 { | ||
panic("expected a single argument") | ||
} | ||
abs, err := filepath.Abs(os.Args[1]) | ||
if err != nil { | ||
panic(err) | ||
} | ||
fmt.Printf("%s\n", abs) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.