Repository: rustwasm/wasm-pack
Pull request #263 (2018-08-23 18:15:20)

Specify output directory with CLI
This PR addresses #235 

There is a new command line flag for the build command: `--out-dir` and `-d`. Supply a relative path and put your wasm somewhere else! Default is `pkg`. 

---

Make sure these boxes are checked! 📦✅

- [x] You have the latest version of `rustfmt` installed and have your 
      cloned directory set to nightly
```bash
$ rustup override set nightly
$ rustup component add rustfmt-preview --toolchain nightly
```
- [x] You ran `rustfmt` on the code base before submitting
- [x] You reference which issue is being closed in the PR text

✨✨ 😄 Thanks so much for contributing to wasm-pack! 😄 ✨✨


xmclark: I would mark this WIP, until there is some feedback 😄 
xmclark: This solution still has a few issues and I am working through them. 
data-pup: ++, thanks for taking care of this @xmclark :smile_cat: 
xmclark: @mgattozzi hi! It is pretty much done. I was able to test locally. I did have some questIons that I had posted in the issue, but if it is better to keep conversation here, I am happy to discuss it. 

We use the term “pkg” to rerference the generates directory in a couple different places. Now that there is a custom out dir, that is not totally accurate. I was wondering if anybody had input on this. 
data-pup: Tested this locally, ran into these two errors:

```
---- readme::it_copies_a_readme_default_path stdout ----
wasm-pack: copying test fixture '/home/user/Github/wasm-pack' to temporary directory '/tmp/.tmpUqvE1a/wasm-pack'
thread 'readme::it_copies_a_readme_default_path' panicked at 'should create pkg directory OK: Os { code: 17, kind: AlreadyExists, message: "File exists" }', libcore/result.rs:983:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- readme::it_creates_a_package_json_provided_path stdout ----
wasm-pack: copying test fixture '/home/user/Github/wasm-pack/tests/fixtures/js-hello-world' to temporary directory '/tmp/.tmpohMt6R/wasm-pack'
thread 'readme::it_creates_a_package_json_provided_path' panicked at 'should create pkg directory OK: Os { code: 17, kind: AlreadyExists, message: "File exists" }', libcore/result.rs:983:5


failures:
    readme::it_copies_a_readme_default_path
    readme::it_creates_a_package_json_provided_path

test result: FAILED. 15 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out
```

This seems like a good start though! I think once these are fixed, and the branch is rebased to pass CI, this should be good to go. 
xmclark: I did the rebase and am having some issues getting the wasm-pack to finish building my local test app. I am getting output that suggests I am getting stuck part way through wasm-packing building a project. See my comments on this [PR](https://github.com/rustwasm/wasm-pack/pull/244/files#r212832458). 
xmclark: After the underscore/hyphens issue was resolved, I rebased and squashed again. I tested using a local test app and it works as expected. The canonical path is printed. 
fitzgen: It... looks like the travis ci vm ran out of disk space? https://travis-ci.org/rustwasm/wasm-pack/jobs/421425086#L809

```
---- manifest::it_creates_a_package_json_with_correct_keys_when_types_are_skipped stdout ----
wasm-pack: copying test fixture '/home/travis/build/rustwasm/wasm-pack' to temporary directory '/tmp/.tmpRkw5Nz/wasm-pack'
thread 'manifest::it_creates_a_package_json_with_correct_keys_when_types_are_skipped' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 28, kind: Other, message: "No space left on device" })', libcore/result.rs:983:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:221
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:477
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:391
   6: rust_begin_unwind
             at libstd/panicking.rs:326
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   8: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:26
   9: <core::result::Result<T, E>>::unwrap
             at /checkout/src/libcore/result.rs:782
  10: all::manifest::it_creates_a_package_json_with_correct_keys_when_types_are_skipped
             at tests/all/manifest.rs:200
  11: all::__test::TESTS::{{closure}}
             at tests/all/manifest.rs:196
  12: core::ops::function::FnOnce::call_once
             at /checkout/src/libcore/ops/function.rs:238
  13: <F as alloc::boxed::FnBox<A>>::call_box
             at libtest/lib.rs:1460
             at /checkout/src/libcore/ops/function.rs:238
             at /checkout/src/liballoc/boxed.rs:644
  14: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:103
```

I'll retrigger the job and see if that was a one off failure...
xmclark: Looks like @fitzgen re-ran the job because the timestamps match up (thank you!). When I first saw this failure, I thought it was very bizarre and assumed it was a one-off. Now that it has been repeated...I have to figure out why...oh boy.

Patch:
diff --git a/.travis.yml b/.travis.yml
index 771cf1a..963d760 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,5 @@
 language: rust
 sudo: false
-cache: cargo
 
 DEPLOY_TO_GITHUB: &DEPLOY_TO_GITHUB
   before_deploy:
@@ -57,7 +56,7 @@ matrix:
   - env: JOB=dist-linux TARGET=x86_64-unknown-linux-musl DEPLOY=1
     rust: nightly
     before_script: rustup target add $TARGET
-    script: cargo build --release --target $TARGET --locked --features vendored-openssl
+    script: cargo build --release --target $TARGET --locked
     addons:
       apt:
         packages:
diff --git a/Cargo.lock b/Cargo.lock
index 65e0e13..d919a76 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -41,7 +41,7 @@ name = "backtrace-sys"
 version = "0.1.24"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "cc 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -57,7 +57,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "cc"
-version = "1.0.23"
+version = "1.0.22"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -116,7 +116,7 @@ dependencies = [
  "clicolors-control 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "termios 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -131,35 +131,6 @@ dependencies = [
  "walkdir 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "curl"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "curl-sys 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.9.35 (registry+https://github.com/rust-lang/crates.io-index)",
- "schannel 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
- "socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "curl-sys"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cc 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "libz-sys 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.9.35 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "failure"
 version = "0.1.2"
@@ -174,44 +145,12 @@ name = "failure_derive"
 version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "proc-macro2 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "filetime"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "flate2"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "foreign-types"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "foreign-types-shared"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "fuchsia-zircon"
 version = "0.3.3"
@@ -249,7 +188,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "console 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -295,17 +234,6 @@ name = "libc"
 version = "0.2.43"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "libz-sys"
-version = "1.0.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cc 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "lock_api"
 version = "0.1.3"
@@ -323,15 +251,6 @@ dependencies = [
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "miniz-sys"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cc 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "num-integer"
 version = "0.1.39"
@@ -345,44 +264,6 @@ name = "num-traits"
 version = "0.2.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "openssl"
-version = "0.10.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.9.35 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "openssl-probe"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "openssl-src"
-version = "110.0.7+1.1.0i"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cc 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "openssl-sys"
-version = "0.9.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cc 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-src 110.0.7+1.1.0i (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "os_type"
 version = "2.0.0"
@@ -401,32 +282,27 @@ dependencies = [
 
 [[package]]
 name = "parking_lot"
-version = "0.6.4"
+version = "0.6.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "parking_lot_core"
-version = "0.3.0"
+version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "pkg-config"
-version = "0.3.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "proc-macro2"
-version = "0.4.15"
+version = "0.4.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -437,7 +313,7 @@ name = "quote"
 version = "0.6.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "proc-macro2 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -518,15 +394,6 @@ name = "ryu"
 version = "0.2.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "schannel"
-version = "0.1.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "scopeguard"
 version = "0.3.3"
@@ -542,7 +409,7 @@ name = "serde_derive"
 version = "1.0.75"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "proc-macro2 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -559,7 +426,7 @@ dependencies = [
 
 [[package]]
 name = "slog"
-version = "2.3.3"
+version = "2.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -567,7 +434,7 @@ name = "slog-async"
 version = "2.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "slog 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "slog 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -579,7 +446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "isatty 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "slog 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "slog 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -592,17 +459,6 @@ dependencies = [
  "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "socket2"
-version = "0.3.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "stable_deref_trait"
 version = "1.1.1"
@@ -627,7 +483,7 @@ name = "structopt-derive"
 version = "0.2.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "proc-macro2 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -637,7 +493,7 @@ name = "syn"
 version = "0.14.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "proc-macro2 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -647,7 +503,7 @@ name = "synstructure"
 version = "0.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "proc-macro2 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -658,17 +514,6 @@ name = "take_mut"
 version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "tar"
-version = "0.4.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "tempdir"
 version = "0.3.7"
@@ -796,11 +641,6 @@ dependencies = [
  "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "vcpkg"
-version = "0.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "vec_map"
 version = "0.8.1"
@@ -831,22 +671,18 @@ version = "0.4.2"
 dependencies = [
  "console 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "copy_dir 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "curl 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "human-panic 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "indicatif 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl 0.10.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)",
- "slog 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "slog 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "slog-term 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "structopt 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "tar 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)",
  "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "which 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -898,14 +734,6 @@ dependencies = [
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "xattr"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [metadata]
 "checksum aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "68f56c7353e5a9547cbd76ed90f7bb5ffc3ba09d4ea9bd1d8c06c8b1142eeb5a"
 "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
@@ -914,7 +742,7 @@ dependencies = [
 "checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"
 "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
 "checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781"
-"checksum cc 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)" = "c37f0efaa4b9b001fa6f02d4b644dee4af97d3414df07c51e3e4f015f3a3e131"
+"checksum cc 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)" = "4a6007c146fdd28d4512a794b07ffe9d8e89e6bf86e2e0c4ddff2e1fb54a0007"
 "checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3"
 "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878"
 "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
@@ -922,14 +750,8 @@ dependencies = [
 "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
 "checksum console 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7649ca90478264b9686aac8d269fcb014f14c2bed7c79a7e51b9f6afd4d783eb"
 "checksum copy_dir 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e4281031634644843bd2f5aa9c48cf98fc48d6b083bd90bb11becf10deaf8b0"
-"checksum curl 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)" = "444c2f9e71458b34e75471ed8d756947a0bb920b8b8b9bfc56dfcc4fc6819a13"
-"checksum curl-sys 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "981bd902fcd8b8b999cf71b81447e27d66c3493a7f62f1372866fd32986c0c82"
 "checksum failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7efb22686e4a466b1ec1a15c2898f91fa9cb340452496dca654032de20ff95b9"
 "checksum failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "946d0e98a50d9831f5d589038d2ca7f8f455b1c21028c0db0e84116a12696426"
-"checksum filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "da4b9849e77b13195302c174324b5ba73eec9b236b24c221a61000daefb95c5f"
-"checksum flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "37847f133aae7acf82bb9577ccd8bda241df836787642654286e79679826a54b"
-"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
-"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
 "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
 "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
 "checksum human-panic 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "21638c5955a6daf3ecc42cae702335fc37a72a4abcc6959ce457b31a7d43bbdd"
@@ -940,22 +762,15 @@ dependencies = [
 "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
 "checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7"
 "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
-"checksum libz-sys 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "f5f9aba969b3c45fe9c94bec65895868a9ceca9a600699f4054b75747a19c7c6"
 "checksum lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "949826a5ccf18c1b3a7c3d57692778d21768b79e46eb9dd07bfc4c2160036c54"
 "checksum memchr 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a3b4142ab8738a78c51896f704f83c11df047ff1bda9a92a661aa6361552d93d"
-"checksum miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "609ce024854aeb19a0ef7567d348aaa5a746b32fb72e336df7fcc16869d7e2b4"
 "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea"
 "checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe"
-"checksum openssl 0.10.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6c24d3508b4fb6da175c10baac54c578b33f09c89ae90c6fe9788b3b4768efdc"
-"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
-"checksum openssl-src 110.0.7+1.1.0i (registry+https://github.com/rust-lang/crates.io-index)" = "c02d15268b7d1b3f0c83a2358f3d981139b54079440f1e2a29c60c1818ad5516"
-"checksum openssl-sys 0.9.35 (registry+https://github.com/rust-lang/crates.io-index)" = "912f301a749394e1025d9dcddef6106ddee9252620e6d0a0e5f8d0681de9b129"
 "checksum os_type 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "081f0539f57611638feee0d72fe98ad0b685e99da117be6b254bd1dfd7421609"
 "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
-"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5"
-"checksum parking_lot_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06a2b6aae052309c2fd2161ef58f5067bc17bb758377a0de9d4b279d603fdd8a"
-"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
-"checksum proc-macro2 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)" = "295af93acfb1d5be29c16ca5b3f82d863836efd9cb0c14fd83811eb9a110e452"
+"checksum parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "69376b761943787ebd5cc85a5bc95958651a22609c5c1c2b65de21786baec72b"
+"checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa"
+"checksum proc-macro2 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "ee5697238f0d893c7f0ecc59c0999f18d2af85e424de441178bcacc9f9e6cf67"
 "checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5"
 "checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
 "checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
@@ -967,16 +782,14 @@ dependencies = [
 "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
 "checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395"
 "checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7"
-"checksum schannel 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "dc1fabf2a7b6483a141426e1afd09ad543520a77ac49bd03c286e7696ccfd77f"
 "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
 "checksum serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)" = "22d340507cea0b7e6632900a176101fea959c7065d93ba555072da90aaaafc87"
 "checksum serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)" = "234fc8b737737b148ccd625175fc6390f5e4dacfdaa543cb93a3430d984a9119"
 "checksum serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "44dd2cfde475037451fa99b7e5df77aa3cfd1536575fa8e7a538ab36dcde49ae"
-"checksum slog 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "09e4f1d0276ac7d448d98db16f0dab0220c24d4842d88ce4dad4b306fa234f1d"
+"checksum slog 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b3253057a9e9e291d19fa9c7645290ab61aff1d009b77b0065fff8accd833c04"
 "checksum slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e544d16c6b230d84c866662fe55e31aacfca6ae71e6fc49ae9a311cb379bfc2f"
 "checksum slog-term 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5951a808c40f419922ee014c15b6ae1cd34d963538b57d8a4778b9ca3fff1e0b"
 "checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d"
-"checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7"
 "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
 "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
 "checksum structopt 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8e9ad6a11096cbecdcca0cc6aa403fdfdbaeda2fb3323a39c98e6a166a1e45a"
@@ -984,7 +797,6 @@ dependencies = [
 "checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741"
 "checksum synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb9b7550d063ea184027c9b8c20ac167cd36d3e06b3a40bceb9d746dc1a7b7"
 "checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
-"checksum tar 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)" = "e8f41ca4a5689f06998f0247fcb60da6c760f1950cc9df2a10d71575ad0b062a"
 "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
 "checksum tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c4b103c6d08d323b92ff42c8ce62abcd83ca8efa7fd5bf7927efefec75f58c76"
 "checksum term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5e6b677dd1e8214ea1ef4297f85dbcbed8e8cdddb561040cc998ca2551c37561"
@@ -1001,7 +813,6 @@ dependencies = [
 "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
 "checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4"
 "checksum uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e1436e58182935dcd9ce0add9ea0b558e8a87befe01c1a301e6020aeb0876363"
-"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d"
 "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
 "checksum version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7716c242968ee87e5542f8021178248f267f295a5c4803beae8b8b7fd9bc6051"
 "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
@@ -1013,4 +824,3 @@ dependencies = [
 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
 "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
 "checksum wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767"
-"checksum xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c"
diff --git a/Cargo.toml b/Cargo.toml
index 77eac9a..9657eef 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,13 +10,10 @@ categories = ["wasm"]
 
 [dependencies]
 console = "0.6.1"
-curl = "0.4.13"
 failure = "0.1.2"
-flate2 = "1.0.2"
 human-panic = "1.0.1"
 indicatif = "0.9.0"
 lazy_static = "1.1.0"
-openssl = { version = '0.10.11', optional = true }
 parking_lot = "0.6"
 serde = "1.0.74"
 serde_derive = "1.0.74"
@@ -25,13 +22,9 @@ slog = "2.3"
 slog-term = "2.4"
 slog-async = "2.3"
 structopt = "0.2"
-tar = "0.4.16"
 toml = "0.4"
 which = "2.0.0"
 
 [dev-dependencies]
 copy_dir = "0.1.2"
 tempfile = "3"
-
-[features]
-vendored-openssl = ['openssl/vendored']
diff --git a/src/bindgen.rs b/src/bindgen.rs
index 4166aa2..34547f2 100644
--- a/src/bindgen.rs
+++ b/src/bindgen.rs
@@ -1,35 +1,22 @@
 //! Functionality related to installing and running `wasm-bindgen`.
 
-use curl;
 use emoji;
 use error::Error;
-use failure;
-use flate2;
 use progressbar::Step;
-use slog::Logger;
-use std::ffi;
-use std::fs;
 use std::path::{Path, PathBuf};
 use std::process::Command;
-use tar;
 use which::which;
 use PBAR;
 
-/// Install the `wasm-bindgen` CLI.
-///
-/// Prefers an existing local install, if any exists. Then checks if there is a
-/// global install on `$PATH` that fits the bill. Then attempts to download a
-/// tarball from the GitHub releases page, if this target has prebuilt
-/// binaries. Finally, falls back to `cargo install`.
-pub fn install_wasm_bindgen(
-    root_path: &Path,
+/// Install the `wasm-bindgen` CLI with `cargo install`.
+pub fn cargo_install_wasm_bindgen(
+    path: &Path,
     version: &str,
     install_permitted: bool,
     step: &Step,
-    log: &Logger,
 ) -> Result<(), Error> {
     // If the `wasm-bindgen` dependency is already met, print a message and return.
-    if wasm_bindgen_path(root_path)
+    if wasm_bindgen_path(path)
         .map(|bindgen_path| wasm_bindgen_version_check(&bindgen_path, version))
         .unwrap_or(false)
     {
@@ -47,115 +34,6 @@ pub fn install_wasm_bindgen(
 
     let msg = format!("{}Installing wasm-bindgen...", emoji::DOWN_ARROW);
     PBAR.step(step, &msg);
-
-    download_prebuilt_wasm_bindgen(root_path, version).or_else(|e| {
-        warn!(
-            log,
-            "could not download pre-built `wasm-bindgen`: {}. Falling back to `cargo install`.", e
-        );
-        cargo_install_wasm_bindgen(root_path, version)
-    })
-}
-
-fn curl(url: &str) -> Result<Vec<u8>, failure::Error> {
-    let mut data = Vec::new();
-
-    fn with_url_context<T, E>(url: &str, r: Result<T, E>) -> Result<T, impl failure::Fail>
-    where
-        Result<T, E>: failure::ResultExt<T, E>,
-    {
-        use failure::ResultExt;
-        r.with_context(|_| format!("when requesting {}", url))
-    }
-
-    let mut easy = curl::easy::Easy::new();
-    with_url_context(url, easy.follow_location(true))?;
-    with_url_context(url, easy.url(url))?;
-
-    {
-        let mut transfer = easy.transfer();
-        with_url_context(
-            url,
-            transfer.write_function(|part| {
-                data.extend_from_slice(part);
-                Ok(part.len())
-            }),
-        )?;
-        with_url_context(url, transfer.perform())?;
-    }
-
-    let code = with_url_context(url, easy.response_code())?;
-    if 200 <= code && code < 300 {
-        Ok(data)
-    } else {
-        Err(Error::http(&format!(
-            "received a bad HTTP status code ({}) when requesting {}",
-            code, url
-        )).into())
-    }
-}
-
-/// Download a tarball containing a pre-built `wasm-bindgen` binary.
-pub fn download_prebuilt_wasm_bindgen(root_path: &Path, version: &str) -> Result<(), Error> {
-    let linux = cfg!(target_os = "linux");
-    let macos = cfg!(target_os = "macos");
-    let x86_64 = cfg!(target_arch = "x86_64");
-
-    let target = if linux && x86_64 {
-        "x86_64-unknown-linux-musl"
-    } else if macos && x86_64 {
-        "x86_64-apple-darwin"
-    } else {
-        return Err(Error::unsupported(
-            "there are no pre-built `wasm-bindgen` binaries for this target",
-        ));
-    };
-
-    let url = format!(
-        "https://github.com/rustwasm/wasm-bindgen/releases/download/{0}/wasm-bindgen-{0}-{1}.tar.gz",
-        version,
-        target
-    );
-
-    let tarball = curl(&url).map_err(|e| Error::http(&e.to_string()))?;
-    let mut archive = tar::Archive::new(flate2::read::GzDecoder::new(&tarball[..]));
-
-    let bin = root_path.join("bin");
-    fs::create_dir_all(&bin)?;
-
-    let mut found_wasm_bindgen = false;
-    let mut found_test_runner = false;
-
-    for entry in archive.entries()? {
-        let mut entry = entry?;
-
-        let dest = match entry.path()?.file_stem() {
-            Some(f) if f == ffi::OsStr::new("wasm-bindgen") => {
-                found_wasm_bindgen = true;
-                bin.join(entry.path()?.file_name().unwrap())
-            }
-            Some(f) if f == ffi::OsStr::new("wasm-bindgen-test-runner") => {
-                found_test_runner = true;
-                bin.join(entry.path()?.file_name().unwrap())
-            }
-            _ => continue,
-        };
-
-        entry.unpack(dest)?;
-    }
-
-    if found_wasm_bindgen && found_test_runner {
-        Ok(())
-    } else {
-        Err(Error::archive(
-            "the wasm-bindgen tarball was missing expected executables",
-        ))
-    }
-}
-
-/// Use `cargo install` to install the `wasm-bindgen` CLI to the given root
-/// path.
-pub fn cargo_install_wasm_bindgen(root_path: &Path, version: &str) -> Result<(), Error> {
     let output = Command::new("cargo")
         .arg("install")
         .arg("--force")
@@ -163,7 +41,7 @@ pub fn cargo_install_wasm_bindgen(root_path: &Path, version: &str) -> Result<(),
         .arg("--version")
         .arg(version)
         .arg("--root")
-        .arg(root_path)
+        .arg(path)
         .output()?;
     if !output.status.success() {
         let message = "Installing wasm-bindgen failed".to_string();
@@ -173,11 +51,6 @@ pub fn cargo_install_wasm_bindgen(root_path: &Path, version: &str) -> Result<(),
             stderr: s.to_string(),
         })
     } else {
-        if cfg!(target_os = "windows") {
-            assert!(root_path.join("bin").join("wasm-bindgen.exe").is_file());
-        } else {
-            assert!(root_path.join("bin").join("wasm-bindgen").is_file());
-        }
         Ok(())
     }
 }
@@ -186,6 +59,7 @@ pub fn cargo_install_wasm_bindgen(root_path: &Path, version: &str) -> Result<(),
 /// `.wasm`.
 pub fn wasm_bindgen_build(
     path: &Path,
+    out_dir: &Path,
     name: &str,
     disable_dts: bool,
     target: &str,
@@ -194,10 +68,11 @@ pub fn wasm_bindgen_build(
 ) -> Result<(), Error> {
     let msg = format!("{}Running WASM-bindgen...", emoji::RUNNER);
     PBAR.step(step, &msg);
-
     let binary_name = name.replace("-", "_");
     let release_or_debug = if debug { "debug" } else { "release" };
 
+    let out_dir = out_dir.to_str().unwrap();
+
     if let Some(wasm_bindgen_path) = wasm_bindgen_path(path) {
         let wasm_path = format!(
             "target/wasm32-unknown-unknown/{}/{}.wasm",
@@ -217,7 +92,7 @@ pub fn wasm_bindgen_build(
             .current_dir(path)
             .arg(&wasm_path)
             .arg("--out-dir")
-            .arg("./pkg")
+            .arg(out_dir)
             .arg(dts_arg)
             .arg(target_arg)
             .output()?;
@@ -256,11 +131,7 @@ fn wasm_bindgen_path(crate_path: &Path) -> Option<PathBuf> {
     let local_bindgen_path = |crate_path: &Path| -> Option<PathBuf> {
         let mut p = crate_path.to_path_buf();
         p.push("bin");
-        if cfg!(target_os = "windows") {
-            p.push("wasm-bindgen.exe");
-        } else {
-            p.push("wasm-bindgen");
-        }
+        p.push("wasm-bindgen");
         if p.is_file() {
             Some(p)
         } else {
diff --git a/src/command/build.rs b/src/command/build.rs
index 343d772..dbf1a19 100644
--- a/src/command/build.rs
+++ b/src/command/build.rs
@@ -22,6 +22,7 @@ pub(crate) struct Build {
     pub mode: BuildMode,
     // build_config: Option<BuildConfig>,
     pub crate_name: String,
+    pub out_dir: PathBuf,
 }
 
 /// The `BuildMode` determines which mode of initialization we are running, and
@@ -63,6 +64,9 @@ pub struct BuildOptions {
     debug: bool,
     // build config from manifest
     // build_config: Option<BuildConfig>,
+    #[structopt(long = "out-dir", short = "d", default_value = "pkg")]
+    /// Sets the output directory with a relative path.
+    pub out_dir: String,
 }
 
 type BuildStep = fn(&mut Build, &Step, &Logger) -> Result<(), Error>;
@@ -72,6 +76,7 @@ impl Build {
     pub fn try_from_opts(build_opts: BuildOptions) -> Result<Self, Error> {
         let crate_path = set_crate_path(build_opts.path);
         let crate_name = manifest::get_crate_name(&crate_path)?;
+        let out_dir = crate_path.join(PathBuf::from(build_opts.out_dir));
         let mode = match build_opts.mode.as_str() {
             "no-install" => BuildMode::Noinstall,
             _ => BuildMode::Normal,
@@ -86,6 +91,7 @@ impl Build {
             mode,
             // build_config,
             crate_name,
+            out_dir,
         })
     }
 
@@ -106,8 +112,7 @@ impl Build {
         info!(&log, "Done in {}.", &duration);
         info!(
             &log,
-            "Your wasm pkg is ready to publish at {:#?}.",
-            &self.crate_path.join("pkg")
+            "Your wasm pkg is ready to publish at {:#?}.", &self.out_dir
         );
 
         PBAR.message(&format!("{} Done in {}", emoji::SPARKLE, &duration));
@@ -115,7 +120,7 @@ impl Build {
         PBAR.message(&format!(
             "{} Your wasm pkg is ready to publish at {:#?}.",
             emoji::PACKAGE,
-            &self.crate_path.join("pkg")
+            self.out_dir.canonicalize().unwrap_or(self.out_dir.clone())
         ));
         Ok(())
     }
@@ -185,7 +190,7 @@ impl Build {
 
     fn step_create_dir(&mut self, step: &Step, log: &Logger) -> Result<(), Error> {
         info!(&log, "Creating a pkg directory...");
-        create_pkg_dir(&self.crate_path, step)?;
+        create_pkg_dir(&self.out_dir, step)?;
         info!(&log, "Created a pkg directory at {:#?}.", &self.crate_path);
         Ok(())
     }
@@ -194,6 +199,7 @@ impl Build {
         info!(&log, "Writing a package.json...");
         manifest::write_package_json(
             &self.crate_path,
+            &self.out_dir,
             &self.scope,
             self.disable_dts,
             &self.target,
@@ -202,19 +208,15 @@ impl Build {
         info!(
             &log,
             "Wrote a package.json at {:#?}.",
-            &self.crate_path.join("pkg").join("package.json")
+            &self.out_dir.join("package.json")
         );
         Ok(())
     }
 
     fn step_copy_readme(&mut self, step: &Step, log: &Logger) -> Result<(), Error> {
         info!(&log, "Copying readme from crate...");
-        readme::copy_from_crate(&self.crate_path, step)?;
-        info!(
-            &log,
-            "Copied readme from crate to {:#?}.",
-            &self.crate_path.join("pkg")
-        );
+        readme::copy_from_crate(&self.crate_path, &self.out_dir, step)?;
+        info!(&log, "Copied readme from crate to {:#?}.", &self.out_dir);
         Ok(())
     }
 
@@ -226,12 +228,11 @@ impl Build {
             BuildMode::Normal => true,
             BuildMode::Noinstall => false,
         };
-        bindgen::install_wasm_bindgen(
+        bindgen::cargo_install_wasm_bindgen(
             &self.crate_path,
             &bindgen_version,
             install_permitted,
             step,
-            log,
         )?;
         info!(&log, "Installing wasm-bindgen-cli was successful.");
 
@@ -250,17 +251,14 @@ impl Build {
         info!(&log, "Building the wasm bindings...");
         bindgen::wasm_bindgen_build(
             &self.crate_path,
+            &self.out_dir,
             &self.crate_name,
             self.disable_dts,
             &self.target,
             self.debug,
             step,
         )?;
-        info!(
-            &log,
-            "wasm bindings were built at {:#?}.",
-            &self.crate_path.join("pkg")
-        );
+        info!(&log, "wasm bindings were built at {:#?}.", &self.out_dir);
         Ok(())
     }
 }
diff --git a/src/command/utils.rs b/src/command/utils.rs
index c66b089..4ab70f3 100644
--- a/src/command/utils.rs
+++ b/src/command/utils.rs
@@ -19,11 +19,10 @@ pub fn set_crate_path(path: Option<PathBuf>) -> PathBuf {
 }
 
 /// Construct our `pkg` directory in the crate.
-pub fn create_pkg_dir(path: &Path, step: &Step) -> Result<(), Error> {
+pub fn create_pkg_dir(out_dir: &Path, step: &Step) -> Result<(), Error> {
     let msg = format!("{}Creating a pkg directory...", emoji::FOLDER);
     PBAR.step(step, &msg);
-    let pkg_dir_path = path.join("pkg");
-    fs::create_dir_all(pkg_dir_path)?;
+    fs::create_dir_all(&out_dir)?;
     Ok(())
 }
 
diff --git a/src/error.rs b/src/error.rs
index 597211f..960cb13 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,5 +1,4 @@
 //! Code related to error handling for wasm-pack
-use curl;
 use serde_json;
 use std::borrow::Cow;
 use std::io;
@@ -20,10 +19,6 @@ pub enum Error {
     #[fail(display = "{}", _0)]
     SerdeToml(#[cause] toml::de::Error),
 
-    #[fail(display = "{}", _0)]
-    /// A curl error.
-    Curl(#[cause] curl::Error),
-
     /// An error invoking another CLI tool.
     #[fail(display = "{}. stderr:\n\n{}", message, stderr)]
     Cli {
@@ -39,35 +34,12 @@ pub enum Error {
         /// A message describing the configuration error.
         message: String,
     },
-
     #[fail(display = "{}", message)]
     /// Error when the 'pkg' directory is not found.
     PkgNotFound {
         /// Message describing the error.
         message: String,
     },
-
-    #[fail(display = "{}", message)]
-    /// An error related to an archive that we downloaded.
-    Archive {
-        /// Error message.
-        message: String,
-    },
-
-    #[fail(display = "{}", message)]
-    /// Error when some operation or feature is unsupported for the current
-    /// target or environment.
-    Unsupported {
-        /// Error message.
-        message: String,
-    },
-
-    #[fail(display = "{}", message)]
-    /// Error related to some HTTP request.
-    Http {
-        /// Error message.
-        message: String,
-    },
 }
 
 impl Error {
@@ -86,27 +58,6 @@ impl Error {
         })
     }
 
-    /// Construct an archive error.
-    pub fn archive(message: &str) -> Self {
-        Error::Archive {
-            message: message.to_string(),
-        }
-    }
-
-    /// Construct an unsupported error.
-    pub fn unsupported(message: &str) -> Self {
-        Error::Unsupported {
-            message: message.to_string(),
-        }
-    }
-
-    /// Construct an http error.
-    pub fn http(message: &str) -> Self {
-        Error::Http {
-            message: message.to_string(),
-        }
-    }
-
     /// Get a string description of this error's type.
     pub fn error_type(&self) -> String {
         match self {
@@ -123,10 +74,6 @@ impl Error {
             Error::PkgNotFound {
                 message: _,
             } => "Unable to find the 'pkg' directory at the path, set the path as the parent of the 'pkg' directory \n\n",
-            Error::Curl(_) => "There was an error making an HTTP request with curl. Details:\n\n",
-            Error::Archive {..} => "There was an error related to an archive file. Details:\n\n",
-            Error::Unsupported {..} => "There was an unsupported operation attempted. Details:\n\n",
-            Error::Http {..} => "There wasn an HTTP error. Details:\n\n",
         }.to_string()
     }
 }
@@ -137,12 +84,6 @@ impl From<io::Error> for Error {
     }
 }
 
-impl From<curl::Error> for Error {
-    fn from(e: curl::Error) -> Self {
-        Error::Curl(e)
-    }
-}
-
 impl From<serde_json::Error> for Error {
     fn from(e: serde_json::Error) -> Self {
         Error::SerdeJson(e)
diff --git a/src/lib.rs b/src/lib.rs
index 5873494..8f01d36 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,10 +3,8 @@
 #![deny(missing_docs)]
 
 extern crate console;
-extern crate curl;
 #[macro_use]
 extern crate failure;
-extern crate flate2;
 extern crate indicatif;
 #[macro_use]
 extern crate lazy_static;
@@ -20,7 +18,6 @@ extern crate structopt;
 extern crate slog;
 extern crate slog_async;
 extern crate slog_term;
-extern crate tar;
 extern crate toml;
 extern crate which;
 
diff --git a/src/manifest.rs b/src/manifest.rs
index 70c92fa..e62d1fb 100644
--- a/src/manifest.rs
+++ b/src/manifest.rs
@@ -146,6 +146,7 @@ impl CargoManifest {
 /// Generate a package.json file inside in `./pkg`.
 pub fn write_package_json(
     path: &Path,
+    out_dir: &Path,
     scope: &Option<String>,
     disable_dts: bool,
     target: &str,
@@ -161,7 +162,7 @@ pub fn write_package_json(
     };
 
     PBAR.step(step, &msg);
-    let pkg_file_path = path.join("pkg").join("package.json");
+    let pkg_file_path = out_dir.join("package.json");
     let mut pkg_file = File::create(pkg_file_path)?;
     let crate_data = read_cargo_toml(path)?;
     let npm_data = crate_data.into_npm(scope, disable_dts, target);
diff --git a/src/readme.rs b/src/readme.rs
index 3af95b2..2c34a2e 100644
--- a/src/readme.rs
+++ b/src/readme.rs
@@ -9,22 +9,20 @@ use progressbar::Step;
 use PBAR;
 
 /// Copy the crate's README into the `pkg` directory.
-pub fn copy_from_crate(path: &Path, step: &Step) -> Result<(), Error> {
+pub fn copy_from_crate(path: &Path, out_dir: &Path, step: &Step) -> Result<(), Error> {
     assert!(
         fs::metadata(path).ok().map_or(false, |m| m.is_dir()),
         "crate directory should exist"
     );
     assert!(
-        fs::metadata(path.join("pkg"))
-            .ok()
-            .map_or(false, |m| m.is_dir()),
+        fs::metadata(&out_dir).ok().map_or(false, |m| m.is_dir()),
         "crate's pkg directory should exist"
     );
 
     let msg = format!("{}Copying over your README...", emoji::DANCERS);
     PBAR.step(step, &msg);
     let crate_readme_path = path.join("README.md");
-    let new_readme_path = path.join("pkg").join("README.md");
+    let new_readme_path = out_dir.join("README.md");
     if let Err(_) = fs::copy(&crate_readme_path, &new_readme_path) {
         PBAR.warn("origin crate has no README");
     };


Test patch:
diff --git a/tests/all/bindgen.rs b/tests/all/bindgen.rs
deleted file mode 100644
index add5838..0000000
--- a/tests/all/bindgen.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-use tempfile;
-use wasm_pack::bindgen;
-
-#[test]
-#[cfg(any(
-    all(target_os = "linux", target_arch = "x86_64"),
-    all(target_os = "macos", target_arch = "x86_64")
-))]
-fn can_download_prebuilt_wasm_bindgen() {
-    let dir = tempfile::TempDir::new().unwrap();
-    bindgen::download_prebuilt_wasm_bindgen(dir.path(), "0.2.19").unwrap();
-    assert!(dir.path().join("bin").join("wasm-bindgen").is_file());
-    assert!(
-        dir.path()
-            .join("bin")
-            .join("wasm-bindgen-test-runner")
-            .is_file()
-    );
-}
-
-#[test]
-#[cfg(any(
-    all(target_os = "linux", target_arch = "x86_64"),
-    all(target_os = "macos", target_arch = "x86_64")
-))]
-fn downloading_prebuilt_wasm_bindgen_handles_http_errors() {
-    let dir = tempfile::TempDir::new().unwrap();
-    let bad_version = "0.2.19-some-trailing-version-stuff-that-does-not-exist";
-    let result = bindgen::download_prebuilt_wasm_bindgen(dir.path(), bad_version);
-    assert!(result.is_err());
-    let error_msg = result.unwrap_err().to_string();
-    assert!(error_msg.contains("404"));
-    assert!(error_msg.contains(bad_version));
-}
diff --git a/tests/all/main.rs b/tests/all/main.rs
index 5699894..57f8885 100644
--- a/tests/all/main.rs
+++ b/tests/all/main.rs
@@ -6,10 +6,7 @@ extern crate serde_json;
 extern crate structopt;
 extern crate tempfile;
 extern crate wasm_pack;
-#[macro_use]
-extern crate lazy_static;
 
-mod bindgen;
 mod build;
 mod manifest;
 mod readme;
diff --git a/tests/all/manifest.rs b/tests/all/manifest.rs
index a709b42..668e112 100644
--- a/tests/all/manifest.rs
+++ b/tests/all/manifest.rs
@@ -54,13 +54,14 @@ fn it_recognizes_a_map_during_depcheck() {
 #[test]
 fn it_creates_a_package_json_default_path() {
     let fixture = fixture::fixture(".");
+    let out_dir = fixture.path.join("pkg");
     let step = wasm_pack::progressbar::Step::new(1);
-    wasm_pack::command::utils::create_pkg_dir(&fixture.path, &step).unwrap();
-    assert!(manifest::write_package_json(&fixture.path, &None, false, "", &step).is_ok());
+    wasm_pack::command::utils::create_pkg_dir(&out_dir, &step).unwrap();
+    assert!(manifest::write_package_json(&fixture.path, &out_dir, &None, false, "", &step).is_ok());
     let package_json_path = &fixture.path.join("pkg").join("package.json");
     assert!(fs::metadata(package_json_path).is_ok());
-    assert!(utils::manifest::read_package_json(&fixture.path).is_ok());
-    let pkg = utils::manifest::read_package_json(&fixture.path).unwrap();
+    assert!(utils::manifest::read_package_json(&fixture.path, &out_dir).is_ok());
+    let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap();
     assert_eq!(pkg.name, "wasm-pack");
     assert_eq!(pkg.repository.ty, "git");
     assert_eq!(
@@ -82,13 +83,14 @@ fn it_creates_a_package_json_default_path() {
 #[test]
 fn it_creates_a_package_json_provided_path() {
     let fixture = fixture::fixture("tests/fixtures/js-hello-world");
+    let out_dir = fixture.path.join("pkg");
     let step = wasm_pack::progressbar::Step::new(1);
-    wasm_pack::command::utils::create_pkg_dir(&fixture.path, &step).unwrap();
-    assert!(manifest::write_package_json(&fixture.path, &None, false, "", &step).is_ok());
+    wasm_pack::command::utils::create_pkg_dir(&out_dir, &step).unwrap();
+    assert!(manifest::write_package_json(&fixture.path, &out_dir, &None, false, "", &step).is_ok());
     let package_json_path = &fixture.path.join("pkg").join("package.json");
     assert!(fs::metadata(package_json_path).is_ok());
-    assert!(utils::manifest::read_package_json(&fixture.path).is_ok());
-    let pkg = utils::manifest::read_package_json(&fixture.path).unwrap();
+    assert!(utils::manifest::read_package_json(&fixture.path, &out_dir).is_ok());
+    let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap();
     assert_eq!(pkg.name, "js-hello-world");
     assert_eq!(pkg.main, "js_hello_world.js");
 
@@ -103,16 +105,23 @@ fn it_creates_a_package_json_provided_path() {
 #[test]
 fn it_creates_a_package_json_provided_path_with_scope() {
     let fixture = fixture::fixture("tests/fixtures/scopes");
+    let out_dir = fixture.path.join("pkg");
     let step = wasm_pack::progressbar::Step::new(1);
-    wasm_pack::command::utils::create_pkg_dir(&fixture.path, &step).unwrap();
+    wasm_pack::command::utils::create_pkg_dir(&out_dir, &step).unwrap();
     assert!(
-        manifest::write_package_json(&fixture.path, &Some("test".to_string()), false, "", &step)
-            .is_ok()
+        manifest::write_package_json(
+            &fixture.path,
+            &out_dir,
+            &Some("test".to_string()),
+            false,
+            "",
+            &step
+        ).is_ok()
     );
     let package_json_path = &fixture.path.join("pkg").join("package.json");
     assert!(fs::metadata(package_json_path).is_ok());
-    assert!(utils::manifest::read_package_json(&fixture.path).is_ok());
-    let pkg = utils::manifest::read_package_json(&fixture.path).unwrap();
+    assert!(utils::manifest::read_package_json(&fixture.path, &out_dir).is_ok());
+    let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap();
     assert_eq!(pkg.name, "@test/scopes-hello-world");
     assert_eq!(pkg.main, "scopes_hello_world.js");
 
@@ -127,13 +136,17 @@ fn it_creates_a_package_json_provided_path_with_scope() {
 #[test]
 fn it_creates_a_pkg_json_with_correct_files_on_node() {
     let fixture = fixture::fixture(".");
+    let out_dir = fixture.path.join("pkg");
     let step = wasm_pack::progressbar::Step::new(1);
-    wasm_pack::command::utils::create_pkg_dir(&fixture.path, &step).unwrap();
-    assert!(manifest::write_package_json(&fixture.path, &None, false, "nodejs", &step).is_ok());
-    let package_json_path = &fixture.path.join("pkg").join("package.json");
+    wasm_pack::command::utils::create_pkg_dir(&out_dir, &step).unwrap();
+    assert!(
+        manifest::write_package_json(&fixture.path, &out_dir, &None, false, "nodejs", &step)
+            .is_ok()
+    );
+    let package_json_path = &out_dir.join("package.json");
     assert!(fs::metadata(package_json_path).is_ok());
-    assert!(utils::manifest::read_package_json(&fixture.path).is_ok());
-    let pkg = utils::manifest::read_package_json(&fixture.path).unwrap();
+    assert!(utils::manifest::read_package_json(&fixture.path, &out_dir).is_ok());
+    let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap();
     assert_eq!(pkg.name, "wasm-pack");
     assert_eq!(pkg.repository.ty, "git");
     assert_eq!(
@@ -153,16 +166,43 @@ fn it_creates_a_pkg_json_with_correct_files_on_node() {
     assert_eq!(actual_files, expected_files);
 }
 
+#[test]
+fn it_creates_a_pkg_json_in_out_dir() {
+    let fixture = fixture::fixture("tests/fixtures/js-hello-world");
+    let out_dir = fixture.path.join("./custom/out");
+    let step = wasm_pack::progressbar::Step::new(1);
+    wasm_pack::command::utils::create_pkg_dir(&out_dir, &step).unwrap();
+    assert!(manifest::write_package_json(&fixture.path, &out_dir, &None, false, "", &step).is_ok());
+
+    let package_json_path = &fixture.path.join(&out_dir).join("package.json");
+    assert!(fs::metadata(package_json_path).is_ok());
+    assert!(utils::manifest::read_package_json(&fixture.path, &out_dir).is_ok());
+
+    let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap();
+    assert_eq!(pkg.name, "js-hello-world");
+    assert_eq!(pkg.main, "js_hello_world.js");
+
+    let actual_files: HashSet<String> = pkg.files.into_iter().collect();
+
+    let expected_files: HashSet<String> = ["js_hello_world_bg.wasm", "js_hello_world.d.ts"]
+        .iter()
+        .map(|&s| String::from(s))
+        .collect();
+
+    assert_eq!(actual_files, expected_files);
+}
+
 #[test]
 fn it_creates_a_package_json_with_correct_keys_when_types_are_skipped() {
     let fixture = fixture::fixture(".");
+    let out_dir = fixture.path.join("pkg");
     let step = wasm_pack::progressbar::Step::new(1);
-    wasm_pack::command::utils::create_pkg_dir(&fixture.path, &step).unwrap();
-    assert!(manifest::write_package_json(&fixture.path, &None, true, "", &step).is_ok());
-    let package_json_path = &fixture.path.join("pkg").join("package.json");
+    wasm_pack::command::utils::create_pkg_dir(&out_dir, &step).unwrap();
+    assert!(manifest::write_package_json(&fixture.path, &out_dir, &None, true, "", &step).is_ok());
+    let package_json_path = &out_dir.join("package.json");
     assert!(fs::metadata(package_json_path).is_ok());
-    assert!(utils::manifest::read_package_json(&fixture.path).is_ok());
-    let pkg = utils::manifest::read_package_json(&fixture.path).unwrap();
+    assert!(utils::manifest::read_package_json(&fixture.path, &out_dir).is_ok());
+    let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap();
     assert_eq!(pkg.name, "wasm-pack");
     assert_eq!(pkg.repository.ty, "git");
     assert_eq!(
diff --git a/tests/all/readme.rs b/tests/all/readme.rs
index 9bb88b1..e8d124f 100644
--- a/tests/all/readme.rs
+++ b/tests/all/readme.rs
@@ -9,13 +9,14 @@ use wasm_pack::readme;
 #[test]
 fn it_copies_a_readme_default_path() {
     let fixture = fixture::fixture(".");
-    fs::create_dir(fixture.path.join("pkg")).expect("should create pkg directory OK");
+    let out_dir = fixture.path.join("pkg");
+    fs::create_dir(&out_dir).expect("should create pkg directory OK");
 
     let step = wasm_pack::progressbar::Step::new(1);
-    assert!(readme::copy_from_crate(&fixture.path, &step).is_ok());
+    assert!(readme::copy_from_crate(&fixture.path, &out_dir, &step).is_ok());
 
     let crate_readme_path = fixture.path.join("README.md");
-    let pkg_readme_path = fixture.path.join("pkg").join("README.md");
+    let pkg_readme_path = out_dir.join("README.md");
     println!(
         "wasm-pack: should have copied README.md from '{}' to '{}'",
         crate_readme_path.display(),
@@ -33,12 +34,13 @@ fn it_copies_a_readme_default_path() {
 #[test]
 fn it_creates_a_package_json_provided_path() {
     let fixture = fixture::fixture("tests/fixtures/js-hello-world");
-    fs::create_dir(fixture.path.join("pkg")).expect("should create pkg directory OK");
+    let out_dir = fixture.path.join("pkg");
+    fs::create_dir(&out_dir).expect("should create pkg directory OK");
 
     let step = wasm_pack::progressbar::Step::new(1);
-    assert!(readme::copy_from_crate(&fixture.path, &step).is_ok());
+    assert!(readme::copy_from_crate(&fixture.path, &out_dir, &step).is_ok());
     let crate_readme_path = fixture.path.join("README.md");
-    let pkg_readme_path = fixture.path.join("pkg").join("README.md");
+    let pkg_readme_path = out_dir.join("README.md");
     println!(
         "wasm-pack: should have copied README.md from '{}' to '{}'",
         crate_readme_path.display(),
diff --git a/tests/all/utils/fixture.rs b/tests/all/utils/fixture.rs
index 3122936..e40b9c1 100644
--- a/tests/all/utils/fixture.rs
+++ b/tests/all/utils/fixture.rs
@@ -28,19 +28,6 @@ where
         fixture.display(),
         path.display()
     );
-
-    {
-        // Copying too many things in parallel totally kills my machine(??!!?!),
-        // so make sure we are only doing one `copy_dir` at a time...
-        use std::sync::Mutex;
-        lazy_static! {
-            static ref ONE_AT_A_TIME: Mutex<()> = Mutex::new(());
-        }
-        let _locked = ONE_AT_A_TIME.lock();
-
-        copy_dir(fixture, &path)
-            .expect("should copy fixture directory into temporary directory OK");
-    }
-
+    copy_dir(fixture, &path).expect("should copy fixture directory into temporary directory OK");
     Fixture { dir, path }
 }
diff --git a/tests/all/utils/manifest.rs b/tests/all/utils/manifest.rs
index cc3d609..8c8b008 100644
--- a/tests/all/utils/manifest.rs
+++ b/tests/all/utils/manifest.rs
@@ -24,8 +24,8 @@ pub struct Repository {
     pub url: String,
 }
 
-pub fn read_package_json(path: &Path) -> Result<NpmPackage, Error> {
-    let manifest_path = path.join("pkg").join("package.json");
+pub fn read_package_json(path: &Path, out_dir: &Path) -> Result<NpmPackage, Error> {
+    let manifest_path = path.join(out_dir).join("package.json");
     let mut pkg_file = File::open(manifest_path)?;
     let mut pkg_contents = String::new();
     pkg_file.read_to_string(&mut pkg_contents)?;