Skip to content

Commit

Permalink
Removing the Go code for now
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaslyang authored and nicholaslyang committed Aug 29, 2023
1 parent 2579a36 commit bb1f1a4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 29 deletions.
2 changes: 1 addition & 1 deletion cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
github.com/Masterminds/semver v1.5.0
github.com/adrg/xdg v0.3.3
github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f
github.com/bgentry/speakeasy v0.1.0
github.com/briandowns/spinner v1.18.1
github.com/cenkalti/backoff/v4 v4.1.3
github.com/deckarep/golang-set v1.8.0
Expand Down Expand Up @@ -53,6 +52,7 @@ require (
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.1 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand Down
12 changes: 4 additions & 8 deletions cli/internal/lockfile/lockfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ func IsNil(l Lockfile) bool {
// Package Structure representing a possible Pack
type Package struct {
// Key used to lookup a package in the lockfile
Key string `json:"key"`
Key string
// The resolved version of a package as it appears in the lockfile
Version string `json:"version"`
Version string
// Set to true iff Key and Version are set
Found bool `json:"-"`
Found bool
}

// ByKey sort package structures by key
Expand All @@ -50,11 +50,7 @@ func (p ByKey) Swap(i, j int) {
}

func (p ByKey) Less(i, j int) bool {
if p[i].Key == p[j].Key {
return p[i].Version < p[j].Version
}

return p[i].Key < p[j].Key
return p[i].Key+p[i].Version < p[j].Key+p[j].Version
}

var _ (sort.Interface) = (*ByKey)(nil)
Expand Down
7 changes: 0 additions & 7 deletions cli/internal/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,6 @@ func (r *run) run(ctx gocontext.Context, targets []string, executionState *turbo

if globalHash, err := calculateGlobalHashFromHashableInputs(globalHashInputs); err == nil {
r.base.Logger.Debug("global hash", "value", globalHash)
if executionState.GlobalHash != nil {
if *executionState.GlobalHash != globalHash {
return fmt.Errorf("global hash differs between Rust and Go: rust %v go %v", executionState.GlobalHash, globalHash)
}
r.base.Logger.Debug("global hash matches between Rust and Go")
}

g.GlobalHash = globalHash
} else {
return fmt.Errorf("failed to calculate global hash: %v", err)
Expand Down
1 change: 0 additions & 1 deletion cli/internal/turbostate/turbostate.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ type ExecutionState struct {
SpacesAPIClientConfig APIClientConfig `json:"spaces_api_client_config"`
PackageManager string `json:"package_manager"`
CLIArgs ParsedArgsFromRust `json:"cli_args"`
GlobalHash *string `json:"global_hash"`
}

// APIClientConfig holds the authentication and endpoint details for the API client
Expand Down
12 changes: 0 additions & 12 deletions crates/turborepo-lib/src/execution_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::{

#[derive(Debug, Serialize)]
pub struct ExecutionState<'a> {
global_hash: Option<String>,
pub api_client_config: APIClientConfig<'a>,
pub spaces_api_client_config: SpacesAPIClientConfig<'a>,
package_manager: PackageManager,
Expand Down Expand Up @@ -45,16 +44,6 @@ impl<'a> TryFrom<&'a CommandBase> for ExecutionState<'a> {
fn try_from(base: &'a CommandBase) -> Result<Self, Self::Error> {
let run = Run::new((*base).clone());

Check warning on line 45 in crates/turborepo-lib/src/execution_state.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (ubuntu, ubuntu-latest)

unused variable: `run`

let global_hash;
#[cfg(debug_assertions)]
{
global_hash = Some(run.get_global_hash()?);
}
#[cfg(not(debug_assertions))]
{
global_hash = None;
}

let root_package_json =
PackageJson::load(&base.repo_root.join_component("package.json")).ok();

Expand Down Expand Up @@ -86,7 +75,6 @@ impl<'a> TryFrom<&'a CommandBase> for ExecutionState<'a> {
};

Ok(ExecutionState {
global_hash,
api_client_config,
spaces_api_client_config,
package_manager,
Expand Down

0 comments on commit bb1f1a4

Please sign in to comment.