Skip to content

Commit

Permalink
Rename cli to buck2
Browse files Browse the repository at this point in the history
Summary: The root crate for buck2 really should be named buck2, so that if/when we upload it to crates.io, you can install it with Buck2.

Reviewed By: krallin

Differential Revision: D44093615

fbshipit-source-id: 9217c1e6a60d68e64d933b2f2174d6e05a313595
  • Loading branch information
ndmitchell authored and facebook-github-bot committed Apr 4, 2023
1 parent 77c2c91 commit f7e4776
Show file tree
Hide file tree
Showing 27 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export_file(

alias(
name = "buck2",
actual = "//buck2/cli:buck2",
actual = "//buck2/app/buck2:buck2-bin",
)

# buildifier: disable=no-effect
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"allocative/allocative_derive",
# @oss-disable: "attic/uniplate",
# @oss-disable: "attic/uniplate_derive",
"app/buck2",
"app/buck2_action_impl",
"app/buck2_audit",
"app/buck2_bxl",
Expand Down Expand Up @@ -58,7 +59,6 @@ members = [
"app/buck2_build_api_derive",
"app/buck2_subscription_proto",
"app/buck2_critical_path",
"cli",
"dice/dice",
"dice/dice_examples",
# @oss-disable: "dice/fuzzy_dice",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ To clone, build, and install `buck2`:
```sh
git clone https://github.com/facebook/buck2.git
cd buck2/
cargo install --path=cli
cargo install --path=app/buck2
```

To build and install the latest `buck2` executable:
```sh
rustup install nightly
cargo +nightly install --git https://github.com/facebook/buck2.git cli
cargo +nightly install --git https://github.com/facebook/buck2.git buck2
```

Build uses prebuilt `protoc` binary from
Expand Down
6 changes: 3 additions & 3 deletions cli/BUCK → app/buck2/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ load("@fbsource//tools/build_defs:glob_defs.bzl", "glob")
oncall("build_infra")

rust_library(
name = "cli",
name = "buck2",
srcs = glob([
"src/**/*.rs",
"src/**/*.md",
Expand Down Expand Up @@ -87,16 +87,16 @@ rust_library(
)

buck_rust_binary(
name = "buck2",
name = "buck2-bin",
srcs = ["bin/buck2.rs"],
crate_root = "bin/buck2.rs",
unittests = False,
deps = [
"fbsource//third-party/rust:anyhow",
"//buck2/app/buck2:buck2",
"//buck2/app/buck2_client_ctx:buck2_client_ctx",
"//buck2/app/buck2_core:buck2_core",
"//buck2/app/buck2_events:buck2_events",
"//buck2/cli:cli",
"//common/rust/folly/logging:logging",
"//common/rust/gflags:gflags",
"//common/rust/shed/fbinit:fbinit",
Expand Down
8 changes: 4 additions & 4 deletions cli/Cargo.toml → app/buck2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
description = ""
edition = "2021"
name = "cli"
name = "buck2"
version = "0.1.0"

[dependencies]
Expand All @@ -13,7 +13,7 @@ clap = { workspace = true }
dirs = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
# @oss-disable: hostcaps = { path = "../../common/rust/shed/hostcaps" }
# @oss-disable: hostcaps = { path = "../../../common/rust/shed/hostcaps" }
itertools = { workspace = true }
libc = { workspace = true }
nix = { workspace = true }
Expand All @@ -34,10 +34,10 @@ gazebo = { workspace = true }
dupe = { workspace = true }
gazebo_lint.version = "0.1"
gazebo_lint.optional = true
# @oss-disable: gazebo_lint.path = "../gazebo_lint/gazebo_lint"
# @oss-disable: gazebo_lint.path = "../../gazebo_lint/gazebo_lint"
host_sharing = { workspace = true }
starlark = { workspace = true }
# @oss-disable: user = { path = "../../common/rust/user", optional = true }
# @oss-disable: user = { path = "../../../common/rust/user", optional = true }
allocative = { workspace = true }

buck2_audit = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions cli/bin/buck2.rs → app/buck2/bin/buck2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ use std::fs;
use std::io;
use std::path::PathBuf;

use buck2::exec;
use buck2::panic;
use buck2::TracingLogFile;
use buck2_client_ctx::exit_result::ExitResult;
use buck2_core::fs::working_dir::WorkingDir;
use buck2_core::logging::init_tracing_for_writer;
use buck2_core::logging::LogConfigurationReloadHandle;
use cli::exec;
use cli::panic;
use cli::TracingLogFile;
use fbinit::FacebookInit;

// fbcode likes to set its own allocator in fbcode.default_allocator
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ for arg in "$@"; do
shift
;;
--cargo)
cargo install --path=cli --root=/tmp
cargo install --path=app/buck2 --root=/tmp
BUCK2_COMMAND="/tmp/bin/buck2"
shift
;;
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To get started, first install the `buck2` executable:

```bash
rustup install nightly
cargo +nightly install --git https://github.com/facebook/buck2.git cli
cargo +nightly install --git https://github.com/facebook/buck2.git buck2
```

The above commands install `buck2` into a suitable directory, such as `$HOME/.cargo/bin`, which you should then add to your `$PATH`:
Expand Down
2 changes: 1 addition & 1 deletion examples/prelude/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
From buck2 project root, run the following to build buck2 with cargo

```sh
cargo install --path=cli --root=/tmp
cargo install buck2 --root=/tmp
export BUCK2="/tmp/bin/buck2"
```

Expand Down

0 comments on commit f7e4776

Please sign in to comment.