Giter Site home page Giter Site logo

chevdor / srtool-cli Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 8.0 408 KB

This cli utility helps you harness the srtool docker image witout breaking a sweat.

Rust 89.12% Ruby 4.05% Just 6.83%
srtool substrate kusama polkadot runtime blockchain cli rust tooling chevdor

srtool-cli's Introduction

srtool cli

srtool cli 512px

This project is NOT the srtool docker image that is actually used to build Substrate Wasm Runtime. This utility requires docker to be installed and running and will invoke the srtool image to help you build a Substrate runtime.

This project is a cli interface to docker to simplify using the srtool docker image. With this executable, you no longer need to set and maintain a long and complex alias, as currently described in the srtool documentation.

Install

If you previously defined srtool as an alias, you will first need to remove it first.

Clean up

If you used srtool in the past, you previously used an srtool alias. You can check with:

type srtool

If you see some output mentioning "srtool is an alias for docker run…​", you have an alias set and we need to remove it:

unalias srtool

This alias is likely set in your .bash_profile or .zshrc, make sure to remove this alias there as well.

Install

cargo install --git https://github.com/chevdor/srtool-cli

Usage

help

srtool is cli allowing to control the srtool docker image

Usage: srtool [OPTIONS] <COMMAND>

Commands:
  pull
          Simply pull the srtool image and do not run anything else
  build
          Start a new srtool container to build your runtime
  info
          Provide information about the srtool container and your repo
  version
          Show the versions of the srtool container. Use --version if you want the version of this executable
  help
          Print this message or the help of the given subcommand(s)

Options:
  -i, --image <IMAGE>
          Choose an alternative image. Beware to choose an image that is compatible with the original srtool image. Using a random image, you take the risk to NOT produce exactly the same deterministic result as srtool

          [default: docker.io/paritytech/srtool]

  -j, --json
          This option is DEPRECATED and has no effect

  -n, --no-cache
          Do not use the local cached tag value

  -e, --engine <ENGINE>
          By default, srtool-cli auto-detects whether you use Podman or Docker. You can force the engine if the detection does not meet your expectation. The default is auto and defaults to Podman.

          NOTE: Using Podman currently forces using --no-cache

          [default: auto]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

version

Show the versions of the srtool container. Use --version if you want the version of this executable

Usage: srtool version [OPTIONS]

Options:
  -i, --image <IMAGE>
          Choose an alternative image. Beware to choose an image that is compatible with the original srtool image. Using a random image, you take the risk to NOT produce exactly the same deterministic result as srtool

          [default: docker.io/paritytech/srtool]

  -e, --engine <ENGINE>
          By default, srtool-cli auto-detects whether you use Podman or Docker. You can force the engine if the detection does not meet your expectation. The default is auto and defaults to Podman.

          NOTE: Using Podman currently forces using --no-cache

          [default: auto]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

info

Provide information about the srtool container and your repo

Usage: srtool info [OPTIONS] --package <PACKAGE> [PATH]

Arguments:
  [PATH]
          By default, srtool will work in the current folder. If your project is located in another location, you can pass it here

          [default: .]

Options:
  -i, --image <IMAGE>
          Choose an alternative image. Beware to choose an image that is compatible with the original srtool image. Using a random image, you take the risk to NOT produce exactly the same deterministic result as srtool

          [default: docker.io/paritytech/srtool]

  -p, --package <PACKAGE>
          Provide the runtime such as kusama-runtime, polkadot-runtime, etc...

          [env: PACKAGE=]

  -r, --runtime-dir <RUNTIME_DIR>
          If your runtime is not in the standard location runtime/<chain_name> you can pass this args to help srtool find it

          [env: RUNTIME_DIR=]

  -e, --engine <ENGINE>
          By default, srtool-cli auto-detects whether you use Podman or Docker. You can force the engine if the detection does not meet your expectation. The default is auto and defaults to Podman.

          NOTE: Using Podman currently forces using --no-cache

          [default: auto]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

pull

Simply pull the srtool image and do not run anything else

Usage: srtool pull [OPTIONS]

Options:
  -i, --image <IMAGE>
          Choose an alternative image. Beware to choose an image that is compatible with the original srtool image. Using a random image, you take the risk to NOT produce exactly the same deterministic result as srtool

          [default: docker.io/paritytech/srtool]

  -e, --engine <ENGINE>
          By default, srtool-cli auto-detects whether you use Podman or Docker. You can force the engine if the detection does not meet your expectation. The default is auto and defaults to Podman.

          NOTE: Using Podman currently forces using --no-cache

          [default: auto]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

build

Start a new srtool container to build your runtime

Usage: srtool build [OPTIONS] --package <PACKAGE> [PATH]

Arguments:
  [PATH]
          By default, srtool will work in the current folder. If your project is located in another location, you can pass it here

          [default: .]

Options:
  -i, --image <IMAGE>
          Choose an alternative image. Beware to choose an image that is compatible with the original srtool image. Using a random image, you take the risk to NOT produce exactly the same deterministic result as srtool

          [default: docker.io/paritytech/srtool]

  -p, --package <PACKAGE>
          Provide the runtime such as kusama-runtime, polkadot-runtime, etc...

          [env: PACKAGE=]

  -j, --json
          Enable json output, same than the global --json option

  -a, --app
          Enable the "app" mode which is a mix of json output and outputting progress during the build. This flag is recommended for CI. the json output will be provided as a single line at the end in compact mode

  -e, --engine <ENGINE>
          By default, srtool-cli auto-detects whether you use Podman or Docker. You can force the engine if the detection does not meet your expectation. The default is auto and defaults to Podman.

          NOTE: Using Podman currently forces using --no-cache

          [default: auto]

  -r, --runtime-dir <RUNTIME_DIR>
          If your runtime is not in the standard location runtime/<chain_name> you can pass this args to help srtool find it

          [env: RUNTIME_DIR=]

      --build-opts <BUILD_OPTS>
          You may pass options to cargo directly here. WARNING, if you pass this value, the automatic build options for Kusama and Polkadot will not be passed and you need to take care of them manually. In general, you should never use this option unless you HAVE to

          [env: BUILD_OPTS=]

      --default-features <DEFAULT_FEATURES>
          Passing this is less involved than passing BUILD_OPTS. It allows changing the list of default features while keeping the automatic features detection. This value is useless if BUILD_OPTS is set

          [env: DEFAULT_FEATURES=]

      --profile <PROFILE>
          The default profile to build runtimes is always `release`. You may override the default with this flag

          [env: PROFILE=]
          [default: release]

      --no-cache
          Passing this flag allows completely disabling caching. As a result, no cargo-home will be mounted to the srtool image. There is no known issue with having the cache ON, this is why it is the default

      --root
          Run container image as root, this helps on Linux based systems

      --verbose
          Run the build script using the verbose option

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Contributing

If you landed here, you likely want to contribute the project. Let me thank you already. There are several ways you can help. Please start with the few notes below.

Features and issues

Whether you are reporting an issue you ran into or requesting a new feature, please open an issue here.

You know the drill: please try to provide some context information, the version you used, your OS, how to reproduce. That will greatly help solving your issue quicker.

Documentation

The documentation of this project is mainly done using AsciiDoc. Unfortunately, it takes litterally ages for Github to support THE feature that makes AsciiDoc shine. As a result, for now, this project is generating the markdwown from AsciiDoc. In short that means that you should NOT modify any .md file but change the .adoc ones and run just md to generate all the markdown.

Tooling

This project is mainly using Rust so you will need to install the Rust compiler. Make sure everything works with the latest stable version of Rust.

You will find a justfile in the root of the repo. This is to be used with just so you may want to install that as well. Just type just 😁 to discover how it can help you.

Before submitting your code, do a cargo clippy stop to make sure everything works fine. Don’t forget to cargo fmt --all as well if you want to be friend with the CI. No surprise, the test can be ran using cargo test.

You may activate the logs for the project using RUST_LOG=debug for instance.

Pull Requests

PRs are welcome. Feel free to open them early before putting too much effort (you may start with a draft). This way you can ping me (@chevdor) if you want my opinion on what and how you are putting your change together.

srtool-cli's People

Contributors

ccris02 avatar chevdor avatar trusch avatar wilwade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

srtool-cli's Issues

Show docker command

We should show, at least in the debug logs, the docker command that ends up being ran, for troubleshooting purposes

The info command should allow providing the runtime_dir

In the repo, we may have several chains (ie cumulus).
THE version depends on the runtime we consider, we should enforce that the user passes enough info (package , chain, or runtime_dir) so we can figure out the runtime_dir from the info command to extra the version.

cargo install issue

Currently, building on my local setup is failing on a new beta version of clap.

Reproduce 8/18/21

OS: MacOS
Rust: 1.53.0

cargo install --git https://github.com/chevdor/srtool-cli

Error

error[E0658]: arbitrary expressions in key-value attributes are unstable
--> /Users/macdenis/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/lib.rs:8:10
|
8 | #![doc = include_str!("../README.md")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #78835 rust-lang/rust#78835 for more information

error: aborting due to previous error

For more information about this error, try rustc --explain E0658.
error: could not compile clap

Add a --no-cache option

It should be decided whether the caching (ie mounting of /cargo-home on the host) should be enabled or not b default. In any case, we want the user to have a way to control that.
I never ran into an issue so having caching by default and letting the user decide with --no-cache is likely fine.

Only support x86-amd64

This is not particular an issue of srtool-cli as it "ripples" through the entire stack. However, it would be nice to also support other architectures. Would then also require to ensure that different host architectures lead to the same hash, but I hope that rustc is supporting this.

syntax error: operand expected (error token is "<body>You > 10#are")

Using 0.6.0 (from github)

>  srtool -j build --default-features evm-tracing --package moonbase-runtime
...
/srtool/lib.sh: line 23: ((: 10#<html><body>You > 10#are: syntax error: operand expected (error token is "<body>You > 10#are")
/srtool/lib.sh: line 27: ((: 10#<html><body>You < 10#are: syntax error: operand expected (error token is "<body>You < 10#are")

I'll see if I get the time to look at it

Proper support for passing `--features`

This --default-features CLI flag is not really working or at least not for me. Also looking into the docker image it is still doing some kind of processing, which is weird. I just want to pass feature flags, srtool should not care at all what or why I'm doing this and just forward these features.

Exit handler has hardcoded container engine

In the exit handler there is a hardcoded docker command. Its basically my own bug, since I introduced the engine parameter to make it possible to use srtool with podman.

I'll write a short fix.

--json not working

Using --json is not working and printing the output in text format

└────╼ srtool --json build -p moonriver-runtime                                                                                                                           [1257/2964]
Found nightly-2021-03-15, we will be using chevdor/srtool:nightly-2021-03-15 for the build
🧰 Substrate Runtime Toolbox - srtool v0.9.11 🧰
              - by Chevdor -
info: syncing channel updates for 'nightly-2021-02-24-x86_64-unknown-linux-gnu'
info: latest update on 2021-02-24, rust version 1.52.0-nightly (fe1bf8e05 2021-02-23)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: using up to 500.0 MiB of RAM to unpack components
info: installing component 'clippy'
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
πŸ—  Building moonriver-runtime as release using rustc 1.52.0-nightly (fe1bf8e05 2021-02-23)
⏳ That can take a little while, be patient... subsequent builds will be faster.
   Since you have to wait a little, you may want to learn more about Substrate runtimes:
   https://substrate.dev/docs/en/#architecture
   Compiling moonriver-runtime v0.8.0-dev (/build/runtime/moonriver)
    Finished release [optimized] target(s) in 27.11s
✨ Your Substrate WASM Runtime is ready! ✨
Summary:
  Generator  : srtool v0.9.11
  Version    : null
  GIT commit : 1dd6d1b3cd8952cb35be3f3b421bb1a98a89d481
  GIT tag    : moonriver-genesis
  GIT branch : crystalin-strool-ci
  Time       : 2021-06-10T21:42:38Z
  Rustc      : rustc 1.52.0-nightly (fe1bf8e05 2021-02-23)
  Size       : 2117 KB (2168697 bytes)
  Content    : 0x0061736d0100000001b5033b60037f7f...3865303520323032312d30322d323329
  Package    : moonriver-runtime
  Proposal   : 0x308c749b1d3ab65832ddfce6d3580b7833236c8435838b228a165322dfe88780
  IPFS       : QmdFxNmDrxKu6653UEeR2q62hFAbkzohzynZovVRKYm1mk
  SHA256     : 0xbed68ebe10427e0ceb3a5bb6563c480ab484a4946e48580af022b11d77e1001d
  Wasm       : runtime/moonriver/target/srtool/release/wbuild/moonriver-runtime/moonriver_runtime.compact.wasm

Using docker run -v ${PWD}:/build -e PACKAGE=moonriver-runtime -v ${PWD}/target:/out -v ${PWD}/out/getBuildOpts.sh:/srtool/getBuildOpts.sh paritytech/srtool:nightly-2021-03-15 build --json worked

Consider a 'check' subcommand

This remains to be spec'ed but the main idea is to allow used to check a given "srtool result" coming in the form of a json file.

The json file needs to contains all the parameters for the user to reproduce the same build without having to care much about the flags and options.

At the end of the build, the output is similar to a regular build, with, in addition, a comparison of the hashes.

No trailing slash makes build fail

I'm running srtool build -p <some-package> on Linux and getting an error /tmpcargo: no such file or directory. Likely due to this line where env::temp_dir().display() seems to return a path without trailing slash when the slash is expected.

Add support for all srtool ENV variables

Set default to podman

See #23

This is more than just defaulting to podman.
There seem to be issues with podman related to the cache temp folder.

TODO:

Here is the list of changes required when the engine is set to podman:

  • turn on --no-cache
  • align UID/GID
  • warn the user that in case of issue, adding --root may help

Failed to run custom build command for `zstd-sys v2.0.1+zstd.1.5.2`

I'm getting build error while using srtool. There's some issue related to permissions.

error: failed to run custom build command for zstd-sys v2.0.1+zstd.1.5.2

Caused by:
process didn't exit successfully: /build/runtime/relay-template/target/srtool/release/build/zstd-sys-d32b56ed5bbb25db/build-script-build (exit status: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,llvm14-builtins-abi,sse,sse2")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/threading.o" "-c" "zstd/lib/common/threading.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/fse_decompress.o" "-c" "zstd/lib/common/fse_decompress.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/debug.o" "-c" "zstd/lib/common/debug.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/pool.o" "-c" "zstd/lib/common/pool.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/error_private.o" "-c" "zstd/lib/common/error_private.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/entropy_common.o" "-c" "zstd/lib/common/entropy_common.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_compress_literals.o" "-c" "zstd/lib/compress/zstd_compress_literals.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/zstd_common.o" "-c" "zstd/lib/common/zstd_common.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/huf_compress.o" "-c" "zstd/lib/compress/huf_compress.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_double_fast.o" "-c" "zstd/lib/compress/zstd_double_fast.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_compress.o" "-c" "zstd/lib/compress/zstd_compress.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_lazy.o" "-c" "zstd/lib/compress/zstd_lazy.c"
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/hist.o" "-c" "zstd/lib/compress/hist.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/fse_compress.o" "-c" "zstd/lib/compress/fse_compress.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_ldm.o" "-c" "zstd/lib/compress/zstd_ldm.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_fast.o" "-c" "zstd/lib/compress/zstd_fast.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstdmt_compress.o" "-c" "zstd/lib/compress/zstdmt_compress.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_compress_sequences.o" "-c" "zstd/lib/compress/zstd_compress_sequences.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_compress_superblock.o" "-c" "zstd/lib/compress/zstd_compress_superblock.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_opt.o" "-c" "zstd/lib/compress/zstd_opt.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/decompress/zstd_decompress.o" "-c" "zstd/lib/decompress/zstd_decompress.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/decompress/zstd_ddict.o" "-c" "zstd/lib/decompress/zstd_ddict.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/decompress/huf_decompress.o" "-c" "zstd/lib/decompress/huf_decompress.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/decompress/zstd_decompress_block.o" "-c" "zstd/lib/decompress/zstd_decompress_block.c"
exit status: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/decompress/huf_decompress_amd64.o" "-c" "zstd/lib/decompress/huf_decompress_amd64.S"
exit status: 0
exit status: 0
exit status: 0
exit status: 0
exit status: 0
exit status: 0
exit status: 0
exit status: 0
exit status: 0
exit status: 0
exit status: 0
exit status: 0
exit status: 0
AR_x86_64-unknown-linux-gnu = None
AR_x86_64_unknown_linux_gnu = None
HOST_AR = None
AR = None
running: "ar" "cq" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/libzstd.a" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/threading.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/fse_decompress.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/debug.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/pool.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/error_private.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/entropy_common.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/common/zstd_common.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/huf_compress.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_compress_literals.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_compress.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/hist.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_double_fast.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_lazy.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/fse_compress.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_ldm.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_fast.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstdmt_compress.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_compress_sequences.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_compress_superblock.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/compress/zstd_opt.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/decompress/zstd_decompress.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/decompress/zstd_ddict.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/decompress/huf_decompress.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/decompress/zstd_decompress_block.o" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/zstd/lib/decompress/huf_decompress_amd64.o"
exit status: 0
running: "ar" "s" "/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out/libzstd.a"
exit status: 0
cargo:rustc-link-lib=static=zstd
cargo:rustc-link-search=native=/build/runtime/relay-template/target/srtool/release/build/zstd-sys-f11c61af82b41d68/out

--- stderr
thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }', /home/builder/cargo/registry/src/github.com-1ecc6299db9ec823/zstd-sys-2.0.1+zstd.1.5.2/build.rs:184:58

Exit code pass through

The exit code from the underlying command doesn't pass through to be the exit code of srtool-cli.

srtool-cli/cli/src/main.rs

Lines 129 to 135 in dc28ec5

if cfg!(target_os = "windows") {
Command::new("cmd").args(["/C", command.as_str()]).output().expect("failed to execute process");
} else {
let _ =
Command::new("sh").arg("-c").arg(command).spawn().expect("failed to execute process").wait_with_output();
}
}

I can throw up a PR to fix it, but will need help testing it on Windows.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.