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

fix(turborepo): resolve go bin correctly #3226

Merged
merged 3 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions crates/turborepo-lib/src/shim.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[cfg(not(windows))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to also get rid of this now. Windows still needs all of the stuff we import from std

use std::fs::canonicalize as fs_canonicalize;
use std::{
env,
env::current_dir,
Expand All @@ -13,7 +12,6 @@ use std::{

use anyhow::{anyhow, Result};
use chrono::offset::Local;
#[cfg(windows)]
use dunce::canonicalize as fs_canonicalize;
use env_logger::{fmt::Color, Builder, Env, WriteStyle};
use log::{debug, Level, LevelFilter};
Expand Down
1 change: 1 addition & 0 deletions crates/turborepo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pretty_assertions = "1.3.0"
anyhow = { version = "1.0.65", features = ["backtrace"] }
clap = { version = "4.0.22", features = ["derive"] }
clap_complete = "4.0.6"
dunce = "1.0"
predicates = "2.1.1"
serde = { version = "1.0.145", features = ["derive"] }
serde_json = "1.0.86"
Expand Down
4 changes: 3 additions & 1 deletion crates/turborepo/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use std::{env::current_exe, process, process::Stdio};

use anyhow::Result;
use dunce::canonicalize as fs_canonicalize;
use turborepo_lib::{Args, Payload};

fn run_go_binary(args: Args) -> Result<i32> {
let mut go_binary_path = current_exe()?;
// canonicalize the binary path to ensure we can find go-turbo
let mut go_binary_path = fs_canonicalize(current_exe()?)?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?)? feels gross.

go_binary_path.pop();
#[cfg(windows)]
go_binary_path.push("go-turbo.exe");
Expand Down