Skip to content

Commit

Permalink
Revert "Run cargo update before attempting to build the Rust program. (
Browse files Browse the repository at this point in the history
…#179)"

This reverts commit 8154752.
  • Loading branch information
Integralist committed Mar 17, 2021
1 parent 1b41384 commit bc5fcf0
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions pkg/compute/rust.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,6 @@ func (r Rust) Initialize(out io.Writer) error { return nil }
// Build implements the Toolchain interface and attempts to compile the package
// Rust source to a Wasm binary.
func (r Rust) Build(out io.Writer, verbose bool) error {
args := []string{"update"}
if verbose {
args = append(args, "--verbose")
}
// Execute `cargo update` command, to ensure we are using latest version
// of fastly-sys transient dependency and avoid misleading/confusing
// compiler error messages.
cmd := common.NewStreamingExec("cargo", args, os.Environ(), verbose, out)
if err := cmd.Exec(); err != nil {
return err
}

// Get binary name from Cargo.toml.
var m CargoManifest
if err := m.Read("Cargo.toml"); err != nil {
Expand All @@ -301,7 +289,7 @@ func (r Rust) Build(out io.Writer, verbose bool) error {
// Specify the toolchain using the `cargo +<version>` syntax.
toolchain := fmt.Sprintf("+%s", r.config.File.Language.Rust.ToolchainVersion)

args = []string{
args := []string{
toolchain,
"build",
"--bin",
Expand All @@ -321,7 +309,7 @@ func (r Rust) Build(out io.Writer, verbose bool) error {

// Execute the `cargo build` commands with the Wasm WASI target, release
// flags and env vars.
cmd = common.NewStreamingExec("cargo", args, env, verbose, out)
cmd := common.NewStreamingExec("cargo", args, env, verbose, out)
if err := cmd.Exec(); err != nil {
return err
}
Expand Down

0 comments on commit bc5fcf0

Please sign in to comment.