Skip to content

wasm-pack still downloads wasm-bindgen from github even if it has already been cargo installed. #1548

@newDINO

Description

@newDINO

Function download_prebuilt_or_cargo_install() checks if there is a globally installed wasm-bindgen using which before doing any downloads. But if wasm-bindgen is installed by wasm-pack using cargo install which is the last resort, it will still try to download it from github.

This may cause the following issues:

  1. There could be two copies of wasm-bindgen of the same version, one from cargo install, the other from github.
  2. In regions where github connection is slow is easy to break while crates.io connection is normal, wasm-pack could be stuck in the download_prebuilt() for a long time due to the slow connection every time wasm-pack build is invoked, even though a wasm-bindgen binary is already installed via cargo install. This however can be resolved using --mode no-install.

A simple solution is just moving the checkcing-if-installed part of cargo_install() function before calling download_prebuilt(). But a better way to do this may be checking both sources before doing any downloads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions