# \[rust, curl, tls\] neovide failed to run custom build command for \`sdl2-sys v0.34.0\`

**URL:** https://discourse.nixos.org/t/rust-curl-tls-neovide-failed-to-run-custom-build-command-for-sdl2-sys-v0-34-0/7086
**Category:** Development
**Created:** [May 7, 2020, 10:19pm UTC](https://discourse.nixos.org/t/rust-curl-tls-neovide-failed-to-run-custom-build-command-for-sdl2-sys-v0-34-0/7086 "2020-05-07T22:19:51Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ksevelyar](https://discourse.nixos.org/user_avatar/discourse.nixos.org/ksevelyar/32/5988_2.png) [@ksevelyar](https://discourse.nixos.org/u/ksevelyar)
#### Post date: [May 7, 2020, 10:19pm UTC](https://discourse.nixos.org/t/rust-curl-tls-neovide-failed-to-run-custom-build-command-for-sdl2-sys-v0-34-0/7086/1 "2020-05-07T22:19:51Z")

</div>

Hi, I’m trying to create package for neovide: [GitHub - neovide/neovide: No Nonsense Neovim Client in Rust](https://github.com/Kethku/neovide)

`shell.nix`

```auto
let
  moz_overlay = import (
    builtins.fetchTarball
      "https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz"
  );
  nixpkgs = import <nixpkgs> { overlays = [moz_overlay]; };
  ruststable = (
    nixpkgs.latest.rustChannels.stable.rust.override {
      extensions = ["rust-src" "rust-analysis" "rustfmt-preview"];
    }
  );
in
  with nixpkgs;
  stdenv.mkDerivation {
    name = "rust-stable";
    buildInputs =
      [stdenv openssl pkgconfig cargo rustc rustup ruststable freetype];
  }

```

The error:  
`nix-shell -p --run 'RUST_BACKTRACE=full cargo build --release'`

```auto
error: failed to run custom build command for `sdl2-sys v0.34.0`

Caused by:
  process didn't exit successfully: `/c/neovide/target/release/build/sdl2-sys-97227988e5290b8e/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Command 'curl' failed: % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
', /home/ksevelyar/.cargo/registry/src/github.com-1ecc6299db9ec823/sdl2-sys-0.34.0/build.rs:53:17
stack backtrace:
   0: 0x5570a2b8a843 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf9a858612dbb4098
   1: 0x5570a2bae7ec - core::fmt::write::hde32b9032cc454bd
   2: 0x5570a2b88015 - std::io::Write::write_fmt::h2f623909338bd408
   3: 0x5570a2b939e5 - std::panicking::default_hook::{{closure}}::hcc427a59ad7415f9
   4: 0x5570a2b936f0 - std::panicking::default_hook::h3c27ea56707cd031
   5: 0x5570a2b93fea - std::panicking::rust_panic_with_hook::h41b614a0ce92c04c
   6: 0x5570a2b93bd0 - rust_begin_unwind
   7: 0x5570a2b93b4b - std::panicking::begin_panic_fmt::hfaed05fa7b9d8ee8
   8: 0x5570a2ab77e2 - build_script_build::run_command::h8f567d1027dd96f3
                               at /home/ksevelyar/.cargo/registry/src/github.com-1ecc6299db9ec823/sdl2-sys-0.34.0/build.rs:53
   9: 0x5570a2ab77e2 - build_script_build::download_to::h6fbde805aace8c5a
                               at /home/ksevelyar/.cargo/registry/src/github.com-1ecc6299db9ec823/sdl2-sys-0.34.0/build.rs:74
  10: 0x5570a2ab77e2 - build_script_build::download_sdl2::h1efc23e1fdb66eba
                               at /home/ksevelyar/.cargo/registry/src/github.com-1ecc6299db9ec823/sdl2-sys-0.34.0/build.rs:117
  11: 0x5570a2ab77e2 - build_script_build::main::h5094fc1115d9867e
                               at /home/ksevelyar/.cargo/registry/src/github.com-1ecc6299db9ec823/sdl2-sys-0.34.0/build.rs:467
  12: 0x5570a2ab8d83 - std::rt::lang_start::{{closure}}::he1d2118144ddb9c2
                               at /build/rustc-1.42.0-src/src/libstd/rt.rs:67
  13: 0x5570a2b93ab3 - std::panicking::try::do_call::h68771d5c764c5b7c
  14: 0x5570a2b9e987 - __rust_maybe_catch_panic
  15: 0x5570a2b96567 - std::rt::lang_start_internal::h2ec653ad9ffd9dc5
  16: 0x5570a2ab8308 - main
  17: 0x7f89a5253d8b - __libc_start_main
  18: 0x5570a2ab11ca - _start
  19: 0x0 - <unknown>

warning: build failed, waiting for other jobs to finish...

```

Which is a bit odd because I can:

```auto
nix-shell -p --run 'curl https://libsdl.org/release/SDL2-2.0.10.tar.gz -o test.tar.gz' master
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 5420k 100 5420k 0 0 777k 0 0:00:06 0:00:06 --:--:-- 1115k

```

> <https://github.com/neovide/neovide/blob/main/Cargo.toml>

---

<div class="post-metadata">

### Author: ![theotherjimmy](https://discourse.nixos.org/user_avatar/discourse.nixos.org/theotherjimmy/32/2034_2.png) [@theotherjimmy](https://discourse.nixos.org/u/theotherjimmy)
#### Post date: [May 12, 2020, 4:24pm UTC](https://discourse.nixos.org/t/rust-curl-tls-neovide-failed-to-run-custom-build-command-for-sdl2-sys-v0-34-0/7086/2 "2020-05-12T16:24:17Z")

</div>

Perhaps you should try adding `SDL2` to your buildInputs, and removing the line in cargo.toml that forces SDL2 to be statically linked. That worked for me, and now I’m fighting with skia, as it’s non-trivial to package, and the crate assumes it can access the network while running build.rs.

---

<div class="post-metadata">

### Author: ![teto](https://discourse.nixos.org/user_avatar/discourse.nixos.org/teto/32/182_2.png) [@teto](https://discourse.nixos.org/u/teto)
#### Post date: [May 12, 2020, 5:51pm UTC](https://discourse.nixos.org/t/rust-curl-tls-neovide-failed-to-run-custom-build-command-for-sdl2-sys-v0-34-0/7086/3 "2020-05-12T17:51:34Z")

</div>

Might be fair to request upstream changes to account for that.

---

<div class="post-metadata">

### Author: ![theotherjimmy](https://discourse.nixos.org/user_avatar/discourse.nixos.org/theotherjimmy/32/2034_2.png) [@theotherjimmy](https://discourse.nixos.org/u/theotherjimmy)
#### Post date: [May 12, 2020, 8:19pm UTC](https://discourse.nixos.org/t/rust-curl-tls-neovide-failed-to-run-custom-build-command-for-sdl2-sys-v0-34-0/7086/4 "2020-05-12T20:19:28Z")

</div>

True. I’d like to get my modified version building in nix before I submit any changes upstream.

---

<div class="post-metadata">

### Author: ![theotherjimmy](https://discourse.nixos.org/user_avatar/discourse.nixos.org/theotherjimmy/32/2034_2.png) [@theotherjimmy](https://discourse.nixos.org/u/theotherjimmy)
#### Post date: [May 16, 2020, 1:56pm UTC](https://discourse.nixos.org/t/rust-curl-tls-neovide-failed-to-run-custom-build-command-for-sdl2-sys-v0-34-0/7086/5 "2020-05-16T13:56:55Z")

</div>

Packaging skia and making it available to skia-rust is being a pain. In other news, neovide is very snappy on my machine, and I’m really enjoying the cursor wipe animation (when I tune down the time it spends in the animation), as it helps me keep track of the cursor more. This makes me wonder if it would be useful for a terminal, or if ncurses apps would make it noisy.

---

<div class="post-metadata">

### Author: ![voanhduy1512](https://discourse.nixos.org/user_avatar/discourse.nixos.org/voanhduy1512/32/3299_2.png) [@voanhduy1512](https://discourse.nixos.org/u/voanhduy1512)
#### Post date: [November 26, 2020, 1:03pm UTC](https://discourse.nixos.org/t/rust-curl-tls-neovide-failed-to-run-custom-build-command-for-sdl2-sys-v0-34-0/7086/6 "2020-11-26T13:03:58Z")

</div>

I have the same problem with skia-bings when packaging another rust app. Did you manage to resolve the problem?

---

<div class="post-metadata">

### Author: ![theotherjimmy](https://discourse.nixos.org/user_avatar/discourse.nixos.org/theotherjimmy/32/2034_2.png) [@theotherjimmy](https://discourse.nixos.org/u/theotherjimmy)
#### Post date: [November 26, 2020, 3:12pm UTC](https://discourse.nixos.org/t/rust-curl-tls-neovide-failed-to-run-custom-build-command-for-sdl2-sys-v0-34-0/7086/7 "2020-11-26T15:12:08Z")

</div>

Not really. I opened an issue, and a developer was able to help me get through some stuff (gn and ninja paths should be configurable on master), but I did not get much farther than that. I apparently don’t have the code anymore 😅 I don’t know how that happened.
