Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves unnecessary deps out of critical build path #645

Merged
merged 12 commits into from
Aug 26, 2022
28 changes: 21 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"cargo-pgx",
"pgx",
"pgx-macros",
"pgx-pg-config",
"pgx-pg-sys",
"pgx-tests",
"pgx-utils",
Expand Down
2 changes: 2 additions & 0 deletions cargo-pgx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ semver = "1.0.9"
owo-colors = { version = "3.4.0", features = [ "supports-colors" ] }
env_proxy = "0.4.1"
num_cpus = "1.13.1"
pgx-pg-config = { path = "../pgx-pg-config", version = "=0.5.0-beta.0" }
pgx-utils = { path = "../pgx-utils", version = "=0.5.0-beta.0" }
prettyplease = "0.1.10"
proc-macro2 = { version = "1.0.39", features = [ "span-locations" ] }
quote = "1.0.18"
rayon = "1.5.3"
Expand Down
3 changes: 1 addition & 2 deletions cargo-pgx/src/command/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ use crate::{
use cargo_toml::Manifest;
use eyre::{eyre, WrapErr};
use owo_colors::OwoColorize;
use pgx_utils::createdb;
use pgx_utils::pg_config::{PgConfig, Pgx};
use pgx_pg_config::{createdb, PgConfig, Pgx};
use std::path::PathBuf;

/// Connect, via psql, to a Postgres instance
Expand Down
5 changes: 1 addition & 4 deletions cargo-pgx/src/command/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ use crate::command::version::pgx_default;
use crate::CommandExecute;
use eyre::{eyre, WrapErr};
use owo_colors::OwoColorize;
use pgx_utils::{
pg_config::{PgConfig, PgConfigSelector, Pgx},
prefix_path, SUPPORTED_MAJOR_VERSIONS,
};
use pgx_pg_config::{prefix_path, PgConfig, PgConfigSelector, Pgx, SUPPORTED_MAJOR_VERSIONS};
use rayon::prelude::*;

use std::collections::HashMap;
Expand Down
6 changes: 3 additions & 3 deletions cargo-pgx/src/command/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ use crate::{
use cargo_toml::Manifest;
use eyre::{eyre, WrapErr};
use owo_colors::OwoColorize;
use pgx_utils::pg_config::PgConfig;
use pgx_utils::{get_target_dir, versioned_so_name};
use pgx_pg_config::{get_target_dir, PgConfig};
use std::{
io::BufReader,
path::{Path, PathBuf},
Expand Down Expand Up @@ -156,7 +155,8 @@ pub(crate) fn install_extension(
dest.push(&pkgdir);
let so_name = if versioned_so {
let extver = get_version(&package_manifest_path)?;
versioned_so_name(&extname, &extver)
// note: versioned so-name format must agree with pgx-utils
format!("{}-{}", &extname, &extver)
} else {
extname.clone()
};
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgx/src/command/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
};
use cargo_toml::Manifest;
use eyre::{eyre, WrapErr};
use pgx_utils::{get_target_dir, pg_config::PgConfig};
use pgx_pg_config::{get_target_dir, PgConfig};
use std::path::{Path, PathBuf};

/// Create an installation package directory.
Expand Down
5 changes: 1 addition & 4 deletions cargo-pgx/src/command/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ use crate::{
use cargo_toml::Manifest;
use eyre::{eyre, WrapErr};
use owo_colors::OwoColorize;
use pgx_utils::{
createdb,
pg_config::{PgConfig, Pgx},
};
use pgx_pg_config::{createdb, PgConfig, Pgx};
use std::{os::unix::process::CommandExt, path::Path, process::Command};
/// Compile/install extension to a pgx-managed Postgres instance and start psql
#[derive(clap::Args, Debug)]
Expand Down
10 changes: 4 additions & 6 deletions cargo-pgx/src/command/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ use crate::{
get::{find_control_file, get_property},
install::format_display_path,
},
pgx_pg_sys_stub::PgxPgSysStub,
CommandExecute,
};
use cargo_toml::Manifest;
use eyre::{eyre, WrapErr};
use object::Object;
use once_cell::sync::OnceCell;
use owo_colors::OwoColorize;
use pgx_utils::{
pg_config::{PgConfig, Pgx},
sql_entity_graph::{PgxSql, SqlGraphEntity},
PgxPgSysStub,
};
use pgx_pg_config::{get_target_dir, PgConfig, Pgx};
use pgx_utils::sql_entity_graph::{PgxSql, SqlGraphEntity};
use std::{
collections::HashSet,
hash::{Hash, Hasher},
Expand Down Expand Up @@ -178,7 +176,7 @@ pub(crate) fn generate_schema(

let flags = std::env::var("PGX_BUILD_FLAGS").unwrap_or_default();

let mut target_dir_with_profile = pgx_utils::get_target_dir()?;
let mut target_dir_with_profile = get_target_dir()?;
target_dir_with_profile.push(if is_release { "release" } else { "debug" });

// First, build the SQL generator so we can get a look at the symbol table
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgx/src/command/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::CommandExecute;
use cargo_toml::Manifest;
use eyre::{eyre, WrapErr};
use owo_colors::OwoColorize;
use pgx_utils::pg_config::{PgConfig, PgConfigSelector, Pgx};
use pgx_pg_config::{PgConfig, PgConfigSelector, Pgx};
use std::{os::unix::process::CommandExt, path::PathBuf, process::Stdio};

/// Start a pgx-managed Postgres instance
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgx/src/command/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Use of this source code is governed by the MIT license that can be found in the

use eyre::eyre;
use owo_colors::OwoColorize;
use pgx_utils::pg_config::{PgConfig, PgConfigSelector, Pgx};
use pgx_pg_config::{PgConfig, PgConfigSelector, Pgx};
use std::{path::PathBuf, process::Stdio};

use crate::CommandExecute;
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgx/src/command/stop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{command::status::status_postgres, CommandExecute};
use cargo_toml::Manifest;
use eyre::{eyre, WrapErr};
use owo_colors::OwoColorize;
use pgx_utils::pg_config::{PgConfig, PgConfigSelector, Pgx};
use pgx_pg_config::{PgConfig, PgConfigSelector, Pgx};
use std::{path::PathBuf, process::Stdio};

/// Stop a pgx-managed Postgres instance
Expand Down
5 changes: 1 addition & 4 deletions cargo-pgx/src/command/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ Use of this source code is governed by the MIT license that can be found in the

use cargo_toml::Manifest;
use eyre::{eyre, WrapErr};
use pgx_utils::{
get_target_dir,
pg_config::{PgConfig, PgConfigSelector, Pgx},
};
use pgx_pg_config::{get_target_dir, PgConfig, PgConfigSelector, Pgx};
use std::{
path::{Path, PathBuf},
process::{Command, Stdio},
Expand Down
4 changes: 2 additions & 2 deletions cargo-pgx/src/command/version.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use pgx_utils::pg_config::{PgConfig, Pgx};
use pgx_pg_config::{PgConfig, Pgx};

pub(crate) fn pgx_default(supported_major_versions: &[u16]) -> eyre::Result<Pgx> {
let mut pgx = Pgx::new();
Expand All @@ -13,7 +13,7 @@ mod rss {
use env_proxy::for_url_str;
use eyre::WrapErr;
use owo_colors::OwoColorize;
use pgx_utils::pg_config::PgVersion;
use pgx_pg_config::PgVersion;
use serde_derive::Deserialize;
use ureq::{Agent, AgentBuilder, Proxy};
use url::Url;
Expand Down
1 change: 1 addition & 0 deletions cargo-pgx/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Use of this source code is governed by the MIT license that can be found in the
mod command;
mod manifest;
mod metadata;
mod pgx_pg_sys_stub;

use atty::Stream;
use clap::Parser;
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgx/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Use of this source code is governed by the MIT license that can be found in the
use cargo_metadata::Metadata;
use cargo_toml::Manifest;
use eyre::eyre;
use pgx_utils::SUPPORTED_MAJOR_VERSIONS;
use pgx_pg_config::SUPPORTED_MAJOR_VERSIONS;
use std::path::PathBuf;

#[tracing::instrument(skip_all)]
Expand Down
File renamed without changes.
Loading