Open Be-ing opened 2 years ago
Oh, Windows, Windows.
I don't recognise this error - I guess you are not using Windows yourself either, but does this CI flow suggest any obvious way to reproduce the flow locally?
There is a RB Windows CI build, and it is currently succeeding (example log here). It tests both Meson and "old-school" Visual Studio projects, using VS2019.
(Also of course I built and packaged the 2.0.1 command-line utility this morning on Windows with VS2019, so it clearly worked for me as well!)
The error looks a bit like the static archiver not recognising the options it's given - perhaps an unexpected archive tool in path, or something has detected it wrongly? The argument quoted (csr
) looks like a Unix-style ar
command sequence. It doesn't come from Rubber Band's own build file, so presumably has been generated by Meson. I wonder what args are being passed in the local successful build. I'll take a look.
Yeah there are no matches for csr
anywhere in the Rubberband repository...
I downloaded the archive of all the logs from vcpkg's CI and the only time the string csr
appears is that link command that fails...
~/Downloads/failure logs for x64-windows
❯ rg -i csr
rubberband/package-x64-windows-dbg-out.log
426:[21/23] "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/lib.exe" "csr" librubberband_objlib.a librubberband_objlib.a.p/src_rubberband-c.cpp.obj librubberband_objlib.a.p/src_RubberBandStretcher.cpp.obj librubberband_objlib.a.p/src_StretcherProcess.cpp.obj librubberband_objlib.a.p/src_StretchCalculator.cpp.obj librubberband_objlib.a.p/src_base_Profiler.cpp.obj librubberband_objlib.a.p/src_dsp_AudioCurveCalculator.cpp.obj librubberband_objlib.a.p/src_audiocurves_CompoundAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_SpectralDifferenceAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_HighFrequencyAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_SilentAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_ConstantAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_PercussiveAudioCurve.cpp.obj librubberband_objlib.a.p/src_dsp_Resampler.cpp.obj librubberband_objlib.a.p/src_dsp_FFT.cpp.obj librubberband_objlib.a.p/src_system_Allocators.cpp.obj librubberband_objlib.a.p/src_system_sysutils.cpp.obj librubberband_objlib.a.p/src_system_Thread.cpp.obj librubberband_objlib.a.p/src_StretcherChannelData.cpp.obj librubberband_objlib.a.p/src_StretcherImpl.cpp.obj librubberband_objlib.a.p/src_dsp_BQResampler.cpp.obj
428:"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/lib.exe" "csr" librubberband_objlib.a librubberband_objlib.a.p/src_rubberband-c.cpp.obj librubberband_objlib.a.p/src_RubberBandStretcher.cpp.obj librubberband_objlib.a.p/src_StretcherProcess.cpp.obj librubberband_objlib.a.p/src_StretchCalculator.cpp.obj librubberband_objlib.a.p/src_base_Profiler.cpp.obj librubberband_objlib.a.p/src_dsp_AudioCurveCalculator.cpp.obj librubberband_objlib.a.p/src_audiocurves_CompoundAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_SpectralDifferenceAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_HighFrequencyAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_SilentAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_ConstantAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_PercussiveAudioCurve.cpp.obj librubberband_objlib.a.p/src_dsp_Resampler.cpp.obj librubberband_objlib.a.p/src_dsp_FFT.cpp.obj librubberband_objlib.a.p/src_system_Allocators.cpp.obj librubberband_objlib.a.p/src_system_sysutils.cpp.obj librubberband_objlib.a.p/src_system_Thread.cpp.obj librubberband_objlib.a.p/src_StretcherChannelData.cpp.obj librubberband_objlib.a.p/src_StretcherImpl.cpp.obj librubberband_objlib.a.p/src_dsp_BQResampler.cpp.obj
432:LINK : fatal error LNK1181: cannot open input file 'csr'
The equivalent link command in my local build appears to be
[21/22] "lib" "/NOLOGO" /MACHINE:x64 /OUT:librubberband_objlib.a librubberband_objlib.a.p/src_rubberband-c.cpp.obj librubberband_objlib.a.p/src_RubberBandStretcher.cpp.obj librubberband_objlib.a.p/src_StretcherProcess.cpp.obj librubberband_objlib.a.p/src_StretchCalculator.cpp.obj librubberband_objlib.a.p/src_base_Profiler.cpp.obj librubberband_objlib.a.p/src_dsp_AudioCurveCalculator.cpp.obj librubberband_objlib.a.p/src_audiocurves_CompoundAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_SpectralDifferenceAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_HighFrequencyAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_SilentAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_ConstantAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_PercussiveAudioCurve.cpp.obj librubberband_objlib.a.p/src_dsp_Resampler.cpp.obj librubberband_objlib.a.p/src_dsp_FFT.cpp.obj librubberband_objlib.a.p/src_system_Allocators.cpp.obj librubberband_objlib.a.p/src_system_sysutils.cpp.obj librubberband_objlib.a.p/src_system_Thread.cpp.obj librubberband_objlib.a.p/src_StretcherChannelData.cpp.obj librubberband_objlib.a.p/src_StretcherImpl.cpp.obj librubberband_objlib.a.p/src_dsp_BQResampler.cpp.obj
which is quite different.
I configured with -Dbuildtype=plain -Ddefault_library=shared
in order to match the failing run as far as possible. (I assume that my command is marked 21/22
while the failing one is 21/23
because the failing build is running ninja install
rather than just building.)
Downloads/failure logs for x64-windows/rubberband
❯ rg buildtype
meson-log-dbg.log
3:Build Options: -Ddebug=true '-Dcmake_prefix_path=['"'"'D:/installed/x64-windows/debug'"'"','"'"'D:/installed/x64-windows'"'"','"'"'D:/installed/x64-windows/share'"'"']' -Dprefix=D:/packages/rubberband_x64-windows/debug -Dincludedir=../include -Dlibdir=lib -Dbackend=ninja -Dbuildtype=plain -Ddefault_library=shared -Dwrap_mode=nodownload '--native-file D:/buildtrees/rubberband/meson-native-x64-windows.log' '--native-file D:/buildtrees/rubberband/meson-native-x64-windows-debug.log'
366:Option buildtype is: plain [default: release]
config-x64-windows-dbg-out.log
5:WARNING: Recommend using either -Dbuildtype or -Doptimization + -Ddebug. Using both is redundant since they override each other. See: https://mesonbuild.com/Builtin-options.html#build-type-options
71:Option buildtype is: plain [default: release]
config-x64-windows-rel-out.log
5:WARNING: Recommend using either -Dbuildtype or -Doptimization + -Ddebug. Using both is redundant since they override each other. See: https://mesonbuild.com/Builtin-options.html#build-type-options
71:Option buildtype is: plain [default: release]
meson-log-rel.log
3:Build Options: -Ddebug=false '-Dcmake_prefix_path=['"'"'D:/installed/x64-windows'"'"','"'"'D:/installed/x64-windows/debug'"'"','"'"'D:/installed/x64-windows/share'"'"']' -Dprefix=D:/packages/rubberband_x64-windows -Dlibdir=lib -Dbackend=ninja -Dbuildtype=plain -Ddefault_library=shared -Dwrap_mode=nodownload '--native-file D:/buildtrees/rubberband/meson-native-x64-windows.log' '--native-file D:/buildtrees/rubberband/meson-native-x64-windows-release.log'
374:Option buildtype is: plain [default: release]
I suppose the most obvious difference is the version of Meson, but the successful runs are using both older (0.55, mine locally) and newer (0.60 on AppVeyor) versions of Meson than the failing one (0.58) which would seem to make that a little less likely a cause.
Anything suggestive in those native-file
files? Those are used to define some aspects of the build environment, though I don't know whether "linker resembles ar / linker resembles link" is one of them.
Downloads/failure logs for x64-windows/rubberband took 6s
❯ cat meson-native-x64-windows.log
[binaries]
mt = 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x64/mt.exe'
ar = 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/lib.exe'
c = 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe'
cpp = 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe'
windres = 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x64/rc.exe'
c_ld = 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/link.exe'
cpp_ld = 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/link.exe'
cmake = 'D:/downloads/tools/cmake-3.21.1-windows/cmake-3.21.1-windows-i386/bin/cmake.exe'
python = 'D:/downloads/tools/python/python-3.10.1-x64/python.exe'
[built-in options]
c_winlibs = ['kernel32.lib', 'user32.lib', 'gdi32.lib', 'winspool.lib', 'shell32.lib', 'ole32.lib', 'oleaut32.lib', 'uuid.lib', 'comdlg32.lib', 'advapi32.lib']
cpp_winlibs = ['kernel32.lib', 'user32.lib', 'gdi32.lib', 'winspool.lib', 'shell32.lib', 'ole32.lib', 'oleaut32.lib', 'uuid.lib', 'comdlg32.lib', 'advapi32.lib']
Downloads/failure logs for x64-windows/rubberband
❯ cat meson-native-x64-windows-debug.log
[properties]
c_args = ['-nologo', '-DWIN32', '-D_WINDOWS', '-W3', '-utf-8', '-MP', '-D_DEBUG', '-MDd', '-Z7', '-Ob0', '-Od', '-RTC1', '-ID:/installed/x64-windows/include']
cpp_args = ['-nologo', '-DWIN32', '-D_WINDOWS', '-W3', '-utf-8', '-GR', '-EHsc', '-MP', '-D_DEBUG', '-MDd', '-Z7', '-Ob0', '-Od', '-RTC1', '-ID:/installed/x64-windows/include']
c_link_args = ['-machine:x64', '-nologo', '-debug', '-INCREMENTAL', '/LIBPATH:D:/installed/x64-windows/debug/lib']
cpp_link_args = ['-machine:x64', '-nologo', '-debug', '-INCREMENTAL', '/LIBPATH:D:/installed/x64-windows/debug/lib']
cmake_toolchain_file = 'C:/a/1/s/scripts/buildsystems/vcpkg.cmake'
[cmake]
VCPKG_TARGET_TRIPLET = 'x64-windows'
VCPKG_CHAINLOAD_TOOLCHAIN_FILE = 'C:/a/1/s/scripts/toolchains/windows.cmake'
VCPKG_CRT_LINKAGE = 'dynamic'
[built-in options]
b_vscrt = 'mdd'
Downloads/failure logs for x64-windows/rubberband
❯ cat meson-native-x64-windows-release.log
[properties]
c_args = ['-nologo', '-DWIN32', '-D_WINDOWS', '-W3', '-utf-8', '-MP', '-MD', '-O2', '-Oi', '-Gy', '-DNDEBUG', '-Z7', '-ID:/installed/x64-windows/include']
cpp_args = ['-nologo', '-DWIN32', '-D_WINDOWS', '-W3', '-utf-8', '-GR', '-EHsc', '-MP', '-MD', '-O2', '-Oi', '-Gy', '-DNDEBUG', '-Z7', '-ID:/installed/x64-windows/include']
c_link_args = ['-machine:x64', '-nologo', '-DEBUG', '-INCREMENTAL:NO', '-OPT:REF', '-OPT:ICF', '/LIBPATH:D:/installed/x64-windows/lib']
cpp_link_args = ['-machine:x64', '-nologo', '-DEBUG', '-INCREMENTAL:NO', '-OPT:REF', '-OPT:ICF', '/LIBPATH:D:/installed/x64-windows/lib']
cmake_toolchain_file = 'C:/a/1/s/scripts/buildsystems/vcpkg.cmake'
[cmake]
VCPKG_TARGET_TRIPLET = 'x64-windows'
VCPKG_CHAINLOAD_TOOLCHAIN_FILE = 'C:/a/1/s/scripts/toolchains/windows.cmake'
VCPKG_CRT_LINKAGE = 'dynamic'
[built-in options]
b_vscrt = 'md'
I am not passing any options to Meson, only using vcpkg's standard Meson macro.
It looks as if Meson tries to determine whether a static linker is the Visual Studio one by calling it with a /?
flag and looking for /OUT:
in the reply. I wonder whether that failed and why?
(edit) Is there a Meson config log file? Typically build/meson-logs/meson-log.txt
. These are not always as informative as you'd like, but might have something.
Mm, nothing very useful there. My hypothesis is that because ar
is specified in the native file Meson thinks it doesn't have to detect it, and so never detects that it is Visual Studio like rather than ar-like. But there are many possible static archivers and it seems unlikely that Meson would skip detecting all of their differences without anyone having noticed. I'll try to test this tomorrow (simply by supplying a native file in my Windows build) if I can find a moment.
Another vcpkg package using Meson also ran into this recently, unfortunately with no solution figured out: https://github.com/microsoft/vcpkg/issues/22196#issuecomment-1001037749
My hypothesis is that because
ar
is specified in the native file Meson thinks it doesn't have to detect it, and so never detects that it is Visual Studio like rather than ar-like.
Yep, that seems to be right.
I create a native file specifying nothing except ar
, and for that I give the same path as the lib.exe
which is already in my environment and which Meson will be picking up anyway:
[binaries]
ar = 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/lib.exe'
Then I configure a new build directory and ninja -v
and this happens:
[21/22] "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/lib.exe" "csr" librubberband_objlib.a librubberband_objlib.a.p/src_rubberband-c.cpp.obj librubberband_objlib.a.p/src_RubberBandStretcher.cpp.obj librubberband_objlib.a.p/src_StretcherProcess.cpp.obj librubberband_objlib.a.p/src_StretchCalculator.cpp.obj librubberband_objlib.a.p/src_base_Profiler.cpp.obj librubberband_objlib.a.p/src_dsp_AudioCurveCalculator.cpp.obj librubberband_objlib.a.p/src_audiocurves_CompoundAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_SpectralDifferenceAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_HighFrequencyAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_SilentAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_ConstantAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_PercussiveAudioCurve.cpp.obj librubberband_objlib.a.p/src_dsp_Resampler.cpp.obj librubberband_objlib.a.p/src_dsp_FFT.cpp.obj librubberband_objlib.a.p/src_system_Allocators.cpp.obj librubberband_objlib.a.p/src_system_sysutils.cpp.obj librubberband_objlib.a.p/src_system_Thread.cpp.obj librubberband_objlib.a.p/src_StretcherChannelData.cpp.obj librubberband_objlib.a.p/src_StretcherImpl.cpp.obj librubberband_objlib.a.p/src_dsp_BQResampler.cpp.obj
FAILED: librubberband_objlib.a
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/lib.exe" "csr" librubberband_objlib.a librubberband_objlib.a.p/src_rubberband-c.cpp.obj librubberband_objlib.a.p/src_RubberBandStretcher.cpp.obj librubberband_objlib.a.p/src_StretcherProcess.cpp.obj librubberband_objlib.a.p/src_StretchCalculator.cpp.obj librubberband_objlib.a.p/src_base_Profiler.cpp.obj librubberband_objlib.a.p/src_dsp_AudioCurveCalculator.cpp.obj librubberband_objlib.a.p/src_audiocurves_CompoundAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_SpectralDifferenceAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_HighFrequencyAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_SilentAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_ConstantAudioCurve.cpp.obj librubberband_objlib.a.p/src_audiocurves_PercussiveAudioCurve.cpp.obj librubberband_objlib.a.p/src_dsp_Resampler.cpp.obj librubberband_objlib.a.p/src_dsp_FFT.cpp.obj librubberband_objlib.a.p/src_system_Allocators.cpp.obj librubberband_objlib.a.p/src_system_sysutils.cpp.obj librubberband_objlib.a.p/src_system_Thread.cpp.obj librubberband_objlib.a.p/src_StretcherChannelData.cpp.obj librubberband_objlib.a.p/src_StretcherImpl.cpp.obj librubberband_objlib.a.p/src_dsp_BQResampler.cpp.obj
Microsoft (R) Library Manager Version 14.28.29337.0
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : fatal error LNK1181: cannot open input file 'csr'
I'll check using the latest version of Meson (even the newer one in the AppVeyor CI is not the very latest).
Still a problem with Meson 0.61.1.
This looks very like https://github.com/mesonbuild/meson/issues/9730
Oof... thanks for looking into it.
Discovered on vcpkg CI
Meson output: