Polochon-street / bliss-rs

A song analysis library for making playlists
https://lelele.io/bliss.html
GNU General Public License v3.0
81 stars 3 forks source link

Build fails: thread 'main' panicked #60

Open yurivict opened 1 year ago

yurivict commented 1 year ago
   Compiling aho-corasick v0.7.20
     Running `CARGO=/usr/local/bin/cargo CARGO_CRATE_NAME=aho_corasick CARGO_MANIFEST_DIR=/usr/ports/audio/bliss-rs/work/bliss-rs-97f563d/cargo-crates/aho-corasick-0.7.20 CARGO_PKG_AUTHORS='Andrew Gallant <jamslam@gmail.com>' CARGO_PKG_DESCRIPTION='Fast multiple substring searching.' CARGO_PKG_HOMEPAGE='https://github.com/BurntSushi/aho-corasick' CARGO_PKG_LICENSE='Unlicense OR MIT' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=aho-corasick CARGO_PKG_REPOSITORY='https://github.com/BurntSushi/aho-corasick' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.7.20 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=7 CARGO_PKG_VERSION_PATCH=20 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/usr/ports/audio/bliss-rs/work/target/release/deps:/usr/local/lib' /usr/local/bin/rustc --crate-name aho_corasick --edition=2018 /usr/ports/audio/bliss-rs/work/bliss-rs-97f563d/cargo-crates/aho-corasick-0.7.20/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C panic=abort -C linker-plugin-lto -C codegen-units=1 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=da22d7a0a07769e7 -C extra-filename=-da22d7a0a07769e7 --out-dir /usr/ports/audio/bliss-rs/work/target/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -C linker=cc -L dependency=/usr/ports/audio/bliss-rs/work/target/x86_64-unknown-freebsd/release/deps -L dependency=/usr/ports/audio/bliss-rs/work/target/release/deps --extern memchr=/usr/ports/audio/bliss-rs/work/target/x86_64-unknown-freebsd/release/deps/libmemchr-593d96310239a278.rmeta --cap-lints warn -C link-arg=-fstack-protector-strong`
     Running `/usr/ports/audio/bliss-rs/work/target/release/build/bliss-audio-aubio-sys-a37581d54bd9744c/build-script-build`
[bliss-audio-aubio-sys 0.2.0] thread 'main' panicked at 'No prebuilt bindings. Try use `bindgen` feature.', /usr/ports/audio/bliss-rs/work/bliss-rs-97f563d/cargo-crates/bliss-audio-aubio-sys-0.2.0/build.rs:34:13
[bliss-audio-aubio-sys 0.2.0] stack backtrace:
[bliss-audio-aubio-sys 0.2.0]    0: std::panicking::begin_panic
[bliss-audio-aubio-sys 0.2.0]    1: build_script_build::main
[bliss-audio-aubio-sys 0.2.0]    2: core::ops::function::FnOnce::call_once
[bliss-audio-aubio-sys 0.2.0] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: failed to run custom build command for `bliss-audio-aubio-sys v0.2.0`

Caused by:
  process didn't exit successfully: `/usr/ports/audio/bliss-rs/work/target/release/build/bliss-audio-aubio-sys-a37581d54bd9744c/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'No prebuilt bindings. Try use `bindgen` feature.', /usr/ports/audio/bliss-rs/work/bliss-rs-97f563d/cargo-crates/bliss-audio-aubio-sys-0.2.0/build.rs:34:13
  stack backtrace:
     0: std::panicking::begin_panic
     1: build_script_build::main
     2: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
warning: `bindgen` (lib) generated 3 warnings
*** Error code 101

rust-1.67.1 FreeBSD 13.1

Polochon-street commented 1 year ago

Hi,

What did you run to try and build it? cargo build? What happens if you try cargo build --features=default,bliss-audio-aubio-rs/bindgen?

yurivict commented 1 year ago

What did you run to try and build it? cargo build?

cargo build

What happens if you try cargo build --features=default,bliss-audio-aubio-rs/bindgen?

Then it fails with this message:

===>  Building for bliss-rs-g20230316
error: failed to select a version for the requirement `bindgen = "^0.58"`
candidate versions found which didn't match: 0.64.0
location searched: directory source `/wrkdirs/usr/ports/audio/bliss-rs/work/bliss-rs-743f779/cargo-crates` (which is replacing registry `crates-io`)
required by package `bliss-audio-aubio-sys v0.2.0`
    ... which satisfies dependency `bliss-audio-aubio-sys = "^0.2.0"` (locked to 0.2.0) of package `bliss-audio-aubio-rs v0.2.0`
    ... which satisfies dependency `bliss-audio-aubio-rs = "^0.2.0"` (locked to 0.2.0) of package `bliss-audio v0.6.7 (/wrkdirs/usr/ports/audio/bliss-rs/work/bliss-rs-743f779)`
perhaps a crate was updated and forgotten to be re-vendored?
*** Error code 101 
yurivict commented 1 year ago

With --features=default,bliss-audio-aubio-rs/bindgen it strangely begins to depend on multiple versions of bindgen.

Polochon-street commented 1 year ago

hmm, could you try again with bliss-rs 0.6.7? I just bumped it and some other deps with the latest version of bindgen - maybe that will solve your problem

lukasroberts commented 1 year ago

I also encounter the same error using bliss-rs 0.6.7. alongside rust 1.67.1 (d5a82bbd2 2023-02-07) on a MacBook Pro (m1)

Polochon-street commented 1 year ago

Could you post the output of both cargo build --features=default,bliss-audio-aubio-rs/bindgen and cargo build?

lukasroberts commented 1 year ago

For cargo build --features=default,bliss-audio-aubio-rs/bindgen

I get - error: none of the selected packages contains these features: bliss-audio-aubio-rs/bindgen, default

For cargo build

I get -

error: failed to run custom build command for `bliss-audio-aubio-sys v0.2.1`

Caused by:
  process didn't exit successfully: `/Users/x/Documents/Github/project/target/debug/build/bliss-audio-aubio-sys-879693fa372e2dc3/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'No prebuilt bindings. Try use `bindgen` feature.', /Users/x/.cargo/registry/src/github.com-1ecc6299db9ec823/bliss-audio-aubio-sys-0.2.1/build.rs:34:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Looks like it's related to audio because when I try to build that I also get the exact same error.

For reference my cargo file looks like the following:

[package]
name = "x"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bliss-audio = "0.6.1"

[workspace]
resolver = "2" # Important! wgpu/Bevy needs this!

# Enable a small amount of optimization in debug mode
[profile.dev]
opt-level = 1

# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
[profile.dev.package."*"]
opt-level = 3
Polochon-street commented 1 year ago

Alright, the bindgen thing is because I'm not exposing the feature on bliss-rs. Let's try to see if you can build aubio first - what happens if you do git clone --recursive "git@github.com:Polochon-street/aubio-rs.git" (it's an optimized version of aubio for the bliss use case), then in aubio-rs, cargo build --features=bindgen?

If this work I think just adding the feature to bliss-rs would work

lukasroberts commented 1 year ago

Running cargo build --features=bindgen does indeed work after cloning that repo!

Polochon-street commented 1 year ago

awesome! Just made this PR https://github.com/Polochon-street/bliss-rs/pull/62, could you check that the corresponding branch allows you to compile everything correctly? (add-bindgen-feature)

cargo build --features=update-aubio-bindings from that branch should do the trick :crossed_fingers:

If everything works, I'll push a new bliss-rs version to crates.io :)

lukasroberts commented 1 year ago

Just switched onto that branch, ran that command and it builds - awesome stuff. Thank you very much!

Polochon-street commented 1 year ago

awesome, thanks for confirming :)

@yurivict, does cargo build --features=update-aubio-bindings work for you with bliss-rs 0.6.8?

lukasroberts commented 1 year ago

@Polochon-street just tried to cargo build referencing 0.6.8 from my basically empty rust project and am strangely getting the following / same error:

error: failed to run custom build command for `bliss-audio-aubio-sys v0.2.1`

Caused by:
  process didn't exit successfully: `/Users/x/target/debug/build/bliss-audio-aubio-sys-0e47044f462d1d40/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'No prebuilt bindings. Try use `bindgen` feature.', /Users/x/.cargo/registry/src/github.com-1ecc6299db9ec823/bliss-audio-aubio-sys-0.2.1/build.rs:34:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

What are the exact steps to include the crate from an empty rust project? Am I missing something in my cargo.toml file?

EDIT: It build successfully if I use the following:

cargo build --features=bliss-audio/update-aubio-bindings

Polochon-street commented 1 year ago

You can also add a default feature in Cargo.toml with this I think, to just be able to type cargo build and be done with it:

[features]
default = ["bliss-audio/update-aubio-bindings"]
yurivict commented 1 year ago

Current revision still fails with features=default:

     Running `/usr/ports/audio/bliss-rs/work/target/release/build/bliss-audio-aubio-sys-2b0d5d687a5a52ae/build-script-build`
[bliss-audio-aubio-sys 0.2.1] thread 'main' panicked at 'No prebuilt bindings. Try use `bindgen` feature.', /usr/ports/audio/bliss-rs/work/bliss-rs-9ddadb4/cargo-crates/bliss-audio-aubio-sys-0.2.1/build.rs:34:13
[bliss-audio-aubio-sys 0.2.1] stack backtrace:
[bliss-audio-aubio-sys 0.2.1]    0: std::panicking::begin_panic
[bliss-audio-aubio-sys 0.2.1]    1: build_script_build::main
[bliss-audio-aubio-sys 0.2.1]    2: core::ops::function::FnOnce::call_once
[bliss-audio-aubio-sys 0.2.1] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: failed to run custom build command for `bliss-audio-aubio-sys v0.2.1`

Caused by:
  process didn't exit successfully: `/usr/ports/audio/bliss-rs/work/target/release/build/bliss-audio-aubio-sys-2b0d5d687a5a52ae/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'No prebuilt bindings. Try use `bindgen` feature.', /usr/ports/audio/bliss-rs/work/bliss-rs-9ddadb4/cargo-crates/bliss-audio-aubio-sys-0.2.1/build.rs:34:13
  stack backtrace:
     0: std::panicking::begin_panic
     1: build_script_build::main
     2: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
warning: `matrixmultiply` (lib) generated 4 warnings

rust-1.68.0 FreeBSD 13.1

yurivict commented 1 year ago

... but with features=default,bliss-audio-aubio-rs/bindgen it passes this point.

Polochon-street commented 6 months ago

hi @yurivict ! I'm wondering, is this issue solved? Or did it fail again down the line?

Polochon-street commented 1 month ago

Hi @yurivict, ffmpeg-next got bumped with a fix for FreeBSD, I tested on a VM, and things seem to work. Do you confirm on your end? :)