5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Windowsにcargo install wasm-packしようとするとopenssl-sysのインストールでエラーになる件

Last updated at Posted at 2022-09-01

前提:OpenSSLのインストール

こちらの記事にもあるようにcargo install wasm-packするにはOpenSSLが必要なので事前にインストールしてあります。

OpenSSLをインストールする上での注意点としては以下2点です。

  • サポートされているのは OpenSSL 1.0.1 ~ 1.1.1LibreSSL 2.5 ~ 3.4.1
  • 環境変数OPENSSL_DIR(+OPENSSL_LIB_DIROPENSSL_INCLUDE_DIR)を設定する

これらはopensslのドキュメントに記載されています。

私の環境ではOpenSSL 3.0 and 1.1.1 Binary Distributions for Microsoft WindowsのページからOpenSSL 1.1.1qをダウンロードして使用しています。

エラー内容

以下のチュートリアルに従ってRustでWebAssemblyを試そうとしている際にcargo install wasm-packでエラーが発生。

エラー内容は以下、

~略~
   Compiling autocfg v1.1.0
   Compiling openssl-sys v0.9.75 (C:\Users\winuser\.cargo\git\checkouts\rust-openssl-41da9d20ce19f5aa\8156ba2\openssl-sys)
   Compiling rustc_version v0.4.0
error: failed to run custom build command for `openssl-sys v0.9.75 (C:\Users\winuser\.cargo\git\checkouts\rust-openssl-41da9d20ce19f5aa\8156ba2\openssl-sys)`

Caused by:
  process didn't exit successfully: `C:\Users\WINUSE~1\AppData\Local\Temp\cargo-installOlbaML\release\build\openssl-sys-d4440e8e80608f66\build-script-main` (exit code: 101)
  --- stdout
  cargo:rustc-cfg=const_fn
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_LIB_DIR
  X86_64_PC_WINDOWS_GNU_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_INCLUDE_DIR
  X86_64_PC_WINDOWS_GNU_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_DIR
  X86_64_PC_WINDOWS_GNU_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR = D:\Tools\utils\OpenSSL-Win64
  cargo:rustc-link-search=native=D:\Tools\utils\OpenSSL-Win64\lib
  cargo:include=D:\Tools\utils\OpenSSL-Win64\include
  cargo:rerun-if-changed=build/expando.c
  OPT_LEVEL = Some("3")
  TARGET = Some("x86_64-pc-windows-gnu")
  HOST = Some("x86_64-pc-windows-gnu")
  CC_x86_64-pc-windows-gnu = None
  CC_x86_64_pc_windows_gnu = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-pc-windows-gnu = None
  CFLAGS_x86_64_pc_windows_gnu = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "D:\\Tools\\utils\\OpenSSL-Win64\\include" "-Wall" "-Wextra" "-E" "build/expando.c"
  exit code: 0
  version: 3_0_5
  cargo:rustc-cfg=osslconf="OPENSSL_NO_SSL3_METHOD"
  cargo:conf=OPENSSL_NO_SSL3_METHOD
  cargo:rustc-cfg=ossl300
  cargo:rustc-cfg=ossl101
  cargo:rustc-cfg=ossl102
  cargo:rustc-cfg=ossl102f
  cargo:rustc-cfg=ossl102h
  cargo:rustc-cfg=ossl110
  cargo:rustc-cfg=ossl110f
  cargo:rustc-cfg=ossl110g
  cargo:rustc-cfg=ossl110h
  cargo:rustc-cfg=ossl111
  cargo:rustc-cfg=ossl111b
  cargo:rustc-cfg=ossl111c
  cargo:version_number=30000050
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_LIBS
  X86_64_PC_WINDOWS_GNU_OPENSSL_LIBS unset
  cargo:rerun-if-env-changed=OPENSSL_LIBS
  OPENSSL_LIBS unset
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_STATIC
  X86_64_PC_WINDOWS_GNU_OPENSSL_STATIC unset
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  OPENSSL_STATIC unset

  --- stderr
  thread 'main' panicked at 'OpenSSL libdir at `["D:\\Tools\\utils\\OpenSSL-Win64\\lib"]` does not contain the required files to either statically or dynamically link OpenSSL', openssl-sys\build/main.rs:386:13
  stack backtrace:
     0:     0x7ff79ecbc4f0 - std::backtrace_rs::backtrace::dbghelp::trace::h003a955f60e3d6e9
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\..\..\backtrace\src\backtrace/dbghelp.rs:98:5
     1:     0x7ff79ecbc4f0 - std::backtrace_rs::backtrace::trace_unsynchronized::h586f9c010f453021
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\..\..\backtrace\src\backtrace/mod.rs:66:5
     2:     0x7ff79ecbc4f0 - std::sys_common::backtrace::_print_fmt::h9b798bd53fc60d8c
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common/backtrace.rs:66:5
     3:     0x7ff79ecbc4f0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0e7af073bc6919f3
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common/backtrace.rs:45:22
     4:     0x7ff79ed168ba - core::fmt::write::hd0ad962bec6757e9
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\fmt/mod.rs:1197:17
     5:     0x7ff79ecadf33 - std::io::Write::write_fmt::h1a5c21f727bb7cdf
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\io/mod.rs:1672:15
     6:     0x7ff79ecbf999 - std::sys_common::backtrace::_print::hf6d979708499bb6b
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common/backtrace.rs:48:5
     7:     0x7ff79ecbf999 - std::sys_common::backtrace::print::h767f43ef3a8fdcd1
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common/backtrace.rs:35:9
     8:     0x7ff79ecbf999 - std::panicking::default_hook::{{closure}}::h72cf44e8b522c6cb
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:295:22
     9:     0x7ff79ecbf61d - std::panicking::default_hook::hae9913e0c406f57b
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:314:9
    10:     0x7ff79ecc00b7 - std::panicking::rust_panic_with_hook::h44f43d002e84ac25
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:698:17
    11:     0x7ff79ecbffb5 - std::panicking::begin_panic_handler::{{closure}}::h12b0bfeb36bf7b07
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:588:13
    12:     0x7ff79ecbd187 - std::sys_common::backtrace::__rust_end_short_backtrace::h7fd45be631af61a3
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common/backtrace.rs:138:18
    13:     0x7ff79ecbfce9 - rust_begin_unwind
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:584:5
    14:     0x7ff79ed13165 - core::panicking::panic_fmt::h89f7411dbde2a8ee
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src/panicking.rs:142:14
    15:     0x7ff79eba5232 - build_script_main::determine_mode::haf893cb6214926e2
    16:     0x7ff79eba27da - build_script_main::main::h6ee586d8139fa7bf
    17:     0x7ff79eba7026 - core::ops::function::FnOnce::call_once::hfabfff8b9a184401
    18:     0x7ff79eba7be9 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8aedd95cad073275
    19:     0x7ff79ebad3bc - std::rt::lang_start::{{closure}}::ha10f671dd5b11f43
    20:     0x7ff79ec9e0e7 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h05d0fafe6ffe534a
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\ops/function.rs:280:13
    21:     0x7ff79ec9e0e7 - std::panicking::try::do_call::hdd816fe57184603e
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:492:40
    22:     0x7ff79ec9e0e7 - std::panicking::try::hd304d785f5cc2492
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:456:19
    23:     0x7ff79ec9e0e7 - std::panic::catch_unwind::hd839940d947d77d8
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panic.rs:137:14
    24:     0x7ff79ec9e0e7 - std::rt::lang_start_internal::{{closure}}::hcc4c3116d6937bed
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/rt.rs:128:48
    25:     0x7ff79ec9e0e7 - std::panicking::try::do_call::h44224a7dfd675a2f
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:492:40
    26:     0x7ff79ec9e0e7 - std::panicking::try::h5492899f6ac7dade
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:456:19
    27:     0x7ff79ec9e0e7 - std::panic::catch_unwind::h71f111c31dc6a8c1
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panic.rs:137:14
    28:     0x7ff79ec9e0e7 - std::rt::lang_start_internal::h4cfe0d5731f33151
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/rt.rs:128:20
    29:     0x7ff79ebad3a0 - std::rt::lang_start::h12a0a45c9efd673c
    30:     0x7ff79eba598c - main
    31:     0x7ff79eba1395 - __tmainCRTStartup
    32:     0x7ff79eba14e6 - mainCRTStartup
    33:     0x7fffced57034 - <unknown>
    34:     0x7fffcf2a2651 - <unknown>
warning: build failed, waiting for other jobs to finish...
error: failed to compile `systest v0.1.0 (https://github.com/sfackler/rust-openssl#8156ba23)`, intermediate artifacts can be found at `C:\Users\WINUSE~1\AppData\Local\Temp\cargo-installOlbaML`

必要なライブラリが存在しないと言われてる様子。
何のライブラリなのかまでは書かれていない。

thread 'main' panicked at 'OpenSSL libdir at ["D:\\Tools\\utils\\OpenSSL-Win64\\lib"] does not contain the required files to either statically or dynamically link OpenSSL', openssl-sys\build/main.rs:386:13

少なくとも日本語記事を見る限りはOpenSSLをインストールしてされいればcargo install wasm-packに成功しているっぽいのでもう少し詳細な調査が必要そう。

試したこと① cargo.tomlの[dependency]に書いてみる

以下のページにも記載されている通り、エラーの出ているopensslをcargo.tomlに記載してcargo updateをしてみる。

cargo.toml
[dependencies]
openssl = { version = "0.10", features = ["vendored"] }

適当なhello worldプロジェクトを作成して上記を実行してみると

D:\rust\hello>cargo update
    Updating crates.io index
      Adding autocfg v1.1.0
      Adding bitflags v1.3.2
      Adding cc v1.0.73
      Adding cfg-if v1.0.0
      Adding foreign-types v0.3.2
      Adding foreign-types-shared v0.1.1
      Adding libc v0.2.132
      Adding once_cell v1.13.1
      Adding openssl v0.10.41
      Adding openssl-macros v0.1.0
      Adding openssl-src v111.22.0+1.1.1q
      Adding openssl-sys v0.9.75
      Adding pkg-config v0.3.25
      Adding proc-macro2 v1.0.43
      Adding quote v1.0.21
      Adding syn v1.0.99
      Adding unicode-ident v1.0.3
      Adding vcpkg v0.2.15

Adding openssl-sys v0.9.75となっているので、インストールに成功した。
ここで改めてcargo install wasm-packを試してみる。

~略~
   Compiling http-body v0.1.0
   Compiling h2 v0.1.26
   Compiling mime_guess v2.0.4
error: failed to run custom build command for `openssl-sys v0.9.75`

Caused by:
  process didn't exit successfully: `C:\Users\WINUSEM~1\AppData\Local\Temp\cargo-installNP1X2G\release\build\openssl-sys-5cdae9e0c8677d54\build-script-main` (exit code: 101)
  --- stdout
  cargo:rustc-cfg=const_fn
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_NO_VENDOR
  X86_64_PC_WINDOWS_GNU_OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
  OPENSSL_NO_VENDOR unset
  CC_x86_64-pc-windows-gnu = None
  CC_x86_64_pc_windows_gnu = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-pc-windows-gnu = None
  CFLAGS_x86_64_pc_windows_gnu = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running "perl" "./Configure" "--prefix=/C/Users/WINUSE~1/AppData/Local/Temp/cargo-installNP1X2G/release/build/openssl-sys-628b17887830d7f5/out/openssl-build/install" "--openssldir=SYS$MANAGER:[OPENSSL]" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "mingw64" "-O2" "-ffunction-sections" "-fdata-sections" "-m64" "-Wa,-mbig-obj"

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: NotFound, message: "program not found" }', C:\Users\winuser\.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.22.0+1.1.1q\src\lib.rs:488:39
  stack backtrace:
     0:     0x7ff64ec26f60 - std::backtrace_rs::backtrace::dbghelp::trace::h003a955f60e3d6e9
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\..\..\backtrace\src\backtrace/dbghelp.rs:98:5
     1:     0x7ff64ec26f60 - std::backtrace_rs::backtrace::trace_unsynchronized::h586f9c010f453021
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\..\..\backtrace\src\backtrace/mod.rs:66:5
     2:     0x7ff64ec26f60 - std::sys_common::backtrace::_print_fmt::h9b798bd53fc60d8c
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common/backtrace.rs:66:5
     3:     0x7ff64ec26f60 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0e7af073bc6919f3
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common/backtrace.rs:45:22
     4:     0x7ff64ec8132a - core::fmt::write::hd0ad962bec6757e9
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\fmt/mod.rs:1197:17
     5:     0x7ff64ec189a3 - std::io::Write::write_fmt::h1a5c21f727bb7cdf
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\io/mod.rs:1672:15
     6:     0x7ff64ec2a409 - std::sys_common::backtrace::_print::hf6d979708499bb6b
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common/backtrace.rs:48:5
     7:     0x7ff64ec2a409 - std::sys_common::backtrace::print::h767f43ef3a8fdcd1
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common/backtrace.rs:35:9
     8:     0x7ff64ec2a409 - std::panicking::default_hook::{{closure}}::h72cf44e8b522c6cb
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:295:22
     9:     0x7ff64ec2a08d - std::panicking::default_hook::hae9913e0c406f57b
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:314:9
    10:     0x7ff64ec2ab27 - std::panicking::rust_panic_with_hook::h44f43d002e84ac25
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:698:17
    11:     0x7ff64ec2aa25 - std::panicking::begin_panic_handler::{{closure}}::h12b0bfeb36bf7b07
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:588:13
    12:     0x7ff64ec27bf7 - std::sys_common::backtrace::__rust_end_short_backtrace::h7fd45be631af61a3
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common/backtrace.rs:138:18
    13:     0x7ff64ec2a759 - rust_begin_unwind
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:584:5
    14:     0x7ff64ec7dbd5 - core::panicking::panic_fmt::h89f7411dbde2a8ee
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src/panicking.rs:142:14
    15:     0x7ff64ec7df33 - core::result::unwrap_failed::hbf3164b5b467b3c2
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src/result.rs:1805:5
    16:     0x7ff64eb4510f - core::result::Result<T,E>::unwrap::h4a75ce3bd0d8b863
    17:     0x7ff64eb40eda - openssl_src::Build::run_command::h8705befd46a461db
    18:     0x7ff64eb40185 - openssl_src::Build::build::h11d55a7940f46611
    19:     0x7ff64eb074d9 - build_script_main::find_vendored::get_openssl::h945ccbc4d6b8ae16
    20:     0x7ff64eb01cc6 - build_script_main::find_openssl::h37e59e3ff2f09688
    21:     0x7ff64eb01df6 - build_script_main::main::hc810df4a0760dc17
    22:     0x7ff64eb0ba36 - core::ops::function::FnOnce::call_once::h82dfca98d0665415
    23:     0x7ff64eb08529 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd594ed889ddaeb98
    24:     0x7ff64eb0da6c - std::rt::lang_start::{{closure}}::h7be489e252912849
    25:     0x7ff64ec08b57 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h05d0fafe6ffe534a
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\ops/function.rs:280:13
    26:     0x7ff64ec08b57 - std::panicking::try::do_call::hdd816fe57184603e
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:492:40
    27:     0x7ff64ec08b57 - std::panicking::try::hd304d785f5cc2492
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:456:19
    28:     0x7ff64ec08b57 - std::panic::catch_unwind::hd839940d947d77d8
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panic.rs:137:14
    29:     0x7ff64ec08b57 - std::rt::lang_start_internal::{{closure}}::hcc4c3116d6937bed
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/rt.rs:128:48
    30:     0x7ff64ec08b57 - std::panicking::try::do_call::h44224a7dfd675a2f
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:492:40
    31:     0x7ff64ec08b57 - std::panicking::try::h5492899f6ac7dade
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panicking.rs:456:19
    32:     0x7ff64ec08b57 - std::panic::catch_unwind::h71f111c31dc6a8c1
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/panic.rs:137:14
    33:     0x7ff64ec08b57 - std::rt::lang_start_internal::h4cfe0d5731f33151
                                 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src/rt.rs:128:20
    34:     0x7ff64eb0da50 - std::rt::lang_start::h608e419f0fd18379
    35:     0x7ff64eb05a5c - main
    36:     0x7ff64eb01395 - __tmainCRTStartup
    37:     0x7ff64eb014e6 - mainCRTStartup
    38:     0x7fffced57034 - <unknown>
    39:     0x7fffcf2a2651 - <unknown>
warning: build failed, waiting for other jobs to finish...
error: failed to compile `wasm-pack v0.10.3`, intermediate artifacts can be found at `C:\Users\WINUSE~1\AppData\Local\Temp\cargo-installNP1X2G`

エラー内容が変わりました。
以下のコマンドで失敗している様子。perl使うのか?

running "perl" "./Configure" "--prefix=/C/Users/WINUSE~1/AppData/Local/Temp/cargo-installNP1X2G/release/build/openssl-sys-628b17887830d7f5/out/openssl-build/install" "--openssldir=SYS$MANAGER:[OPENSSL]" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "mingw64" "-O2" "-ffunction-sections" "-fdata-sections" "-m64" "-Wa,-mbig-obj"

「Rust WebAssembly perl」などで検索してみると以下のissueを発見。
コメントにinstall Perl first.と書かれている ← 結局こちらの方法は試しませんでした(試してないこと① perlのインストール

さらに調べると以下のissueを発見、いくつか解決方法が挙げられているので試してみる。

試したこと② --no-default-featuresオプションの使用

こちらのコメントでは--no-default-featuresを指定しています。
結果、ここに書かれている通りcargo install wasm-pack --no-default-featuresでインストールできました。

試してないこと① perlのインストール

こちらのissueではcargo install wasm-pack実行中にperlコマンドでエラーが発生した際、perlをインストールすると書かれている。

試してないこと② バージョン指定でインストール

こちらのissueに対するコメントではバージョン0.9.1だとうまくいったと書かれている。
以下のコマンドを実行すればよいみたい。

cargo install wasm-pack --vers 0.9.1

私の環境だとなぜかセキュリティソフトでブロックされたのでこちらは試せませんでした(会社用PCなのでセキュリティソフトをOFFにできなかった)

試してないこと③ インストーラの使用

こちらのissueに対するコメントではインストーラを使うと書かれている。

なんか簡単そう。

最後に

同様のエラーでつまずいた方、どの方法で解決したか是非コメントください。

参考

5
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?