Skip to content

Commit 025a1f8

Browse files
Move cargo_pgrx::env to cargo_pgrx::cargo (pgcentralfoundation#2186)
Separate to make the move easy to track relative to later diffs of cargo-pgrx/src/cargo.rs
1 parent bb499e5 commit 025a1f8

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

cargo-pgrx/src/command/cross/pgrx_target.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn make_target_info(cmd: &PgrxTarget, tmp: &Path) -> Result<()> {
8787
);
8888
}
8989

90-
run(crate::env::cargo().args(["init", "--lib", "--name", "temp-crate"]).current_dir(tmp))?;
90+
run(crate::cargo::cargo().args(["init", "--lib", "--name", "temp-crate"]).current_dir(tmp))?;
9191

9292
let cargo_add: Vec<String> = if let Some(pg_sys_path) = &cmd.pg_sys_path {
9393
let abs = pg_sys_path.canonicalize().wrap_err_with(|| {
@@ -99,14 +99,14 @@ fn make_target_info(cmd: &PgrxTarget, tmp: &Path) -> Result<()> {
9999
vec![format!("pgrx-pg-sys@={own_version}")]
100100
};
101101

102-
run(crate::env::cargo()
102+
run(crate::cargo::cargo()
103103
.arg("add")
104104
.args(cargo_add)
105105
.arg("--no-default-features")
106106
.current_dir(tmp))?;
107107

108108
let filename = format!("pg{major_version}_raw_bindings.rs");
109-
run(crate::env::cargo()
109+
run(crate::cargo::cargo()
110110
.current_dir(tmp)
111111
.arg("build")
112112
.arg("--features")

cargo-pgrx/src/command/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub(crate) fn build_extension(
289289
) -> eyre::Result<std::process::Output> {
290290
let flags = std::env::var("PGRX_BUILD_FLAGS").unwrap_or_default();
291291

292-
let mut command = crate::env::cargo();
292+
let mut command = crate::cargo::cargo();
293293
command.arg("build");
294294
command.arg("--lib");
295295

cargo-pgrx/src/command/schema.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ fn first_build(
333333
target: Option<&str>,
334334
package_name: &str,
335335
) -> eyre::Result<()> {
336-
let mut command = crate::env::cargo();
336+
let mut command = crate::cargo::cargo();
337337
command.stdin(Stdio::null());
338338
command.stdout(Stdio::null());
339339
command.stderr(Stdio::inherit());
@@ -500,7 +500,7 @@ fn second_build(
500500
package_name: &str,
501501
manifest: &Manifest,
502502
) -> eyre::Result<()> {
503-
let mut command = crate::env::cargo();
503+
let mut command = crate::cargo::cargo();
504504
command.stdin(Stdio::null());
505505
command.stdout(Stdio::null());
506506
command.stderr(Stdio::inherit());

cargo-pgrx/src/command/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub fn test_extension(
139139
}
140140
let target_dir = get_target_dir()?;
141141

142-
let mut command = crate::env::cargo();
142+
let mut command = crate::cargo::cargo();
143143

144144
let no_default_features_arg = features.no_default_features;
145145
let mut features_arg = features.features.join(" ");

cargo-pgrx/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mod command;
1111
mod manifest;
1212
mod metadata;
1313

14-
pub(crate) mod env;
14+
pub(crate) mod cargo;
1515
pub(crate) mod profile;
1616

1717
use clap::Parser;
@@ -58,7 +58,7 @@ impl CommandExecute for CargoSubcommands {
5858

5959
fn main() -> color_eyre::Result<()> {
6060
let stderr_is_tty = io::stderr().is_terminal();
61-
env::initialize();
61+
cargo::initialize();
6262
color_eyre::config::HookBuilder::default().theme(color_eyre::config::Theme::new()).install()?;
6363

6464
let cargo_cli = CargoCommand::parse();

0 commit comments

Comments
 (0)