Skip to main content

Web executable launcher

Project description

wrun

wrun downloads, caches, and runs an executable, with the same one command for multiple OS/architectures.

$ wrun --help
wrun downloads, caches, and runs executables.

OS and architecture matcher arguments for URLs to download and (if applicable) executables within archives can be used to construct command lines that work across multiple operating systems and architectures.

The OS and architecture wrun was built for are matched against the given matchers.
OS and architecture parts of the matcher may be globs.
Order of the matcher arguments is significant: the first match of each is chosen.

As a special case, a matcher argument with no matcher part is treated as if it was given with the matcher */*.
On Windows, .exe is automatically appended to any archive exe path resulting from a */ prefixed match.

URL fragments, if present, are treated as hashAlgo-hexDigest strings, and downloads are checked against them.

The first non-flag argument or -- terminates wrun arguments.
Remaining ones are passed to the downloaded executable.

Environment variables:
- WRUN_CACHE_HOME: cache location, defaults to wrun subdir in the user's cache dir
- WRUN_OS_ARCH: override OS/arch for matching
- WRUN_VERBOSE: output verbosity, false decreases, true increases

Usage:
  wrun [flags] -- [executable arguments]
  wrun [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  generate    generate wrun command line arguments for various tools
  help        Help about any command

Flags:
  -p, --archive-exe-path strings   [OS/arch=]path to executable within archive matcher (separator always /, implies archive processing)
  -n, --dry-run                    dry run, skip execution (but do download/set up cache)
  -h, --help                       help for wrun
  -t, --http-timeout duration      HTTP client timeout (default 5m0s)
  -u, --url strings                [OS/arch=]URL matcher (at least one required)
  -v, --version                    version for wrun

Use "wrun [command] --help" for more information about a command.

Installation

Prebuilt binaries are available in project releases, apt and yum package repositories at Packagecloud.

Prebuilt binaries are also available from PyPI, in the wrun-py package, installable for example with pip:

python3 -m pip install wrun-py

To build and install from sources, Go is required.

go install github.com/scop/wrun@latest

URL matching

URLs are matched against the Go toolchain wrun was built with using the OS/architecture= prefix given along with the URLs. Valid values for these come from Go, the list is available by running go tool dist list, or from Go sources.

OS and architecture may contain globs. The special case where the OS/architecture= prefix is left out is treated as if */*= was given.

Order of specifying the URLs is significant; the first matching one is chosen.

Download digests

To verify downloads against known good digests, place a digest in the URL fragment. The fragment format to use is digestAlgo-hexDigest.

For example:

  • #sha256-2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9842

Usage with pre-commit

See .pre-commit-config.yaml examples in .pre-commit-hooks.yaml.

Usage in CI

Cache resides by default in the wrun subdirectory of the user's cache directory. $WRUN_CACHE_HOME overrides it.

pre-commit.ci is not supported, because it disallows network access at runtime.

Generating command line arguments

The generate subcommand can be used to generate wrun command line arguments for various tools.

It supports tools shipped in GitHub releases and PyPI executable wrapper wheels that meet its expectations about asset filenames regarding their OS and architecture.

Some additional tool specific generators are available as well for tools that are not served by the generic GitHub and PyPI generators. See wrun generate --help for more information.

License

SPDX-License-Identifier: Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wrun_py-0.3.0.post1.tar.gz (13.6 kB view hashes)

Uploaded Source

Built Distributions

wrun_py-0.3.0.post1-py3-none-win_amd64.whl (4.4 MB view hashes)

Uploaded Python 3 Windows x86-64

wrun_py-0.3.0.post1-py3-none-win32.whl (4.4 MB view hashes)

Uploaded Python 3 Windows x86

wrun_py-0.3.0.post1-py3-none-musllinux_1_2_x86_64.whl (4.3 MB view hashes)

Uploaded Python 3 musllinux: musl 1.2+ x86-64

wrun_py-0.3.0.post1-py3-none-musllinux_1_2_i686.whl (4.1 MB view hashes)

Uploaded Python 3 musllinux: musl 1.2+ i686

wrun_py-0.3.0.post1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

wrun_py-0.3.0.post1-py3-none-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (4.1 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

wrun_py-0.3.0.post1-py3-none-macosx_11_0_arm64.whl (4.1 MB view hashes)

Uploaded Python 3 macOS 11.0+ ARM64

wrun_py-0.3.0.post1-py3-none-macosx_10_13_x86_64.whl (4.4 MB view hashes)

Uploaded Python 3 macOS 10.13+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page