katyo / aubio-rs

Rust bindings for Aubio library
37 stars 7 forks source link

Windows support (mingw, travis) #5

Closed katyo closed 4 years ago

katyo commented 4 years ago

Currently windows builds disabled due to strange error:

error: failed to run custom build command for `aubio-lib v0.1.2 (C:\Users\travis\build\katyo\aubio-rs\aubio-lib)`
Caused by:
  process didn't exit successfully: `C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-c16645850cc4bf39\build-script-build` (exit code: 101)
--- stderr
Fetch aubio from https://github.com/katyo/aubio-rs/releases/download/aubio-0.5.0-git1f23a23d/aubio-0.5.0-git1f23a23d.tar.gz to C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d
Run command: "python" "waf" "--verbose" "--build-type" "release" "--jobs" "2" "--disable-docs" "--disable-tests" "--disable-examples" "--disable-double" "--disable-fftw3f" "--disable-fftw3" "--disable-wavread" "--disable-wavwrite" "--disable-jack" "--disable-sndfile" "--disable-avcodec" "--disable-samplerate" "--out" "C:\\Users\\travis\\build\\katyo\\aubio-rs\\target\\release\\build\\aubio-lib-bc0d25f50c988cce\\out\\build\\0.5.0-git1f23a23d" "--prefix" "C:\\Users\\travis\\build\\katyo\\aubio-rs\\target\\release\\build\\aubio-lib-bc0d25f50c988cce\\out\\build\\0.5.0-git1f23a23d" "configure"
thread 'main' panicked at 'Command '"python" "waf" "--verbose" "--build-type" "release" "--jobs" "2" "--disable-docs" "--disable-tests" "--disable-examples" "--disable-double" "--disable-fftw3f" "--disable-fftw3" "--disable-wavread" "--disable-wavwrite" "--disable-jack" "--disable-sndfile" "--disable-avcodec" "--disable-samplerate" "--out" "C:\\Users\\travis\\build\\katyo\\aubio-rs\\target\\release\\build\\aubio-lib-bc0d25f50c988cce\\out\\build\\0.5.0-git1f23a23d" "--prefix" "C:\\Users\\travis\\build\\katyo\\aubio-rs\\target\\release\\build\\aubio-lib-bc0d25f50c988cce\\out\\build\\0.5.0-git1f23a23d" "configure"' failed (stdout: Setting top to                           : C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d 
Setting out to                           : C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\build\0.5.0-git1f23a23d 
Checking for 'msvc' (C compiler)         : 14:59:19 runner ['C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe', '-products', '*', '-legacy', '-format', 'json']
Traceback (most recent call last):
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Scripting.py", line 119, in waf_entry_point
    run_commands()
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Scripting.py", line 182, in run_commands
    ctx=run_command(cmd_name)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Scripting.py", line 173, in run_command
    ctx.execute()
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Configure.py", line 85, in execute
    super(ConfigurationContext,self).execute()
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Context.py", line 92, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Context.py", line 133, in recurse
    user_function(self)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d\wscript", line 134, in configure
    ctx.load('compiler_c')
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Configure.py", line 156, in load
    func(self)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Tools/compiler_c.py", line 23, in configure
    conf.load(compiler)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Configure.py", line 156, in load
    func(self)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Tools/msvc.py", line 543, in configure
    conf.autodetect(True)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Configure.py", line 175, in fun
    return f(*k,**kw)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Tools/msvc.py", line 561, in autodetect
    compiler,version,path,includes,libdirs,cpu=conf.detect_msvc()
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Configure.py", line 175, in fun
    return f(*k,**kw)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Tools/msvc.py", line 461, in detect_msvc
    return self.setup_msvc(self.get_msvc_versions())
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Configure.py", line 175, in fun
    return f(*k,**kw)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Tools/msvc.py", line 469, in get_msvc_versions
    self.gather_vswhere_versions(dct)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Configure.py", line 175, in fun
    return f(*k,**kw)
  File "C:\Users\travis\build\katyo\aubio-rs\target\release\build\aubio-lib-bc0d25f50c988cce\out\source\0.5.0-git1f23a23d/waflib/Tools/msvc.py", line 311, in gather_vswhere_versions
    txt=txt.decode(Utils.console_encoding())
LookupError: unknown encoding: cp65001
) (stderr: )', aubio-lib\build.rs:195:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 Downloading crates ...
  Downloaded hound v3.4.0
   Compiling hound v3.4.0
   Compiling aubio-rs v0.1.2 (C:\Users\travis\build\katyo\aubio-rs\aubio-rs)
   Compiling aubio-lib v0.1.2 (C:\Users\travis\build\katyo\aubio-rs\aubio-lib)
The command "(cd aubio-rs && cargo test --release)" exited with 101.
1.87s$ (cd aubio-rs && cargo test --release --features log)
error: failed to run custom build command for `aubio-lib v0.1.2 (C:\Users\travis\build\katyo\aubio-rs\aubio-lib)`

Because that related to waf (and particularly python) I temporarly disable windows support. I tried to fix it using solutions from stackoverflow but nothing help me to do it. I'm not an expert in windows so I don't understand what happens wrong and how it can be fixed.

katyo commented 4 years ago

Same errors still happened after #9. See Travis-CI log. Branch windows-ci.

To @kukuen Can you help to fix this issue?

katyo commented 4 years ago

It seems I fixed waf invocation by forcing python to be 3.x, but now I have linking issues: Travis CI log @kukuen What do you think about it?

katyo commented 4 years ago

Possibly it related to different static library name (aubio.lib instead of libaubio.a). But I dont sure. Also maybe WAF used MSVC to build aubio, but Rust target is mingw. Which WAF behavior in case of windows?

kukuen commented 4 years ago

I'm fairly new to Rust, so I don't know if MSVC is usually more used than mingw or if it's the opposite, but I think checking both targets in the CI would be the best way the handle windows. I'll check what's happening with the mingw build.

katyo commented 4 years ago

I tried to force WAF use GCC with --check-c-compiler=gcc (for GNU target env) but WAF ignores it and still use MSVC instead. UPD: Oh, it seems I mistyped env name in checking (gcc instead of gnu). UPD2: Yes, it works, but build still failed (nm not found).

katyo commented 4 years ago

Linking failed (several undefined references) log. UPD: Only doc samples failed to link. UPD2: It seems, I fixed using of 'aubio_lib' crate by code samples with old-style extern crate aubio_lib; instead of use aubio_lib;. Now It works fine.

kukuen commented 4 years ago

Great ! I wasn't available lately, but let me know if you need more help on the windows side.