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

feat(service): emit trace with shuttle dependencies #1498

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions service/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use anyhow::{anyhow, bail, Context};
use cargo_metadata::{Package, Target};
use shuttle_common::constants::{NEXT_NAME, RUNTIME_NAME};
use tokio::io::AsyncBufReadExt;
use tracing::{debug, error, trace};
use tracing::{debug, error, info, trace};

#[derive(Clone, Debug, Eq, PartialEq)]
/// This represents a compiled alpha or shuttle-next service.
Expand Down Expand Up @@ -128,10 +128,25 @@ pub async fn build_workspace(
let mut next_packages = Vec::new();

for member in metadata.workspace_packages() {
if is_next(member) {
let next = is_next(member);
let alpha = is_alpha(member);
if next || alpha {
let mut shuttle_deps = member
.dependencies
.iter()
.filter_map(|d| {
d.name
.starts_with("shuttle-")
.then(|| format!("{} '{}'", d.name, d.req))
})
.collect::<Vec<_>>();
shuttle_deps.sort();
info!(name = member.name, deps = ?shuttle_deps, "Compiled workspace member with shuttle dependencies");
}
if next {
ensure_cdylib(member)?;
next_packages.push(member);
} else if is_alpha(member) {
} else if alpha {
ensure_binary(member)?;
alpha_packages.push(member);
}
Expand Down
5 changes: 2 additions & 3 deletions service/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ pub async fn start(
};

info!(
"Spawning runtime process: {} {}",
runtime_executable.display(),
args.join(" ")
args = %format!("{} {}", runtime_executable.display(), args.join(" ")),
"Spawning runtime process",
);
let runtime = process::Command::new(
dunce::canonicalize(runtime_executable).context("canonicalize path of executable")?,
Expand Down