conan-io / conan-vs-extension

Conan Extension for Visual Studio
https://marketplace.visualstudio.com/items?itemName=conan-io.conan-vs-extension
MIT License
59 stars 34 forks source link

Building boost x86 fails with plugin, not with cmd line #184

Closed nminkov closed 8 months ago

nminkov commented 3 years ago

Trying to build boost/1.72.0 or newer in x86 will fail with the plugin with error:

04.01.2021 17:29:58: libiconv/1.16: run_in_windows_bash: z:\.conan\91fd30\1\bin\usr\bin\bash.exe --login -c ^"cd \^"/z/.conan/libiconv/1.16/_/_/build/29d1f4003b3f7143826ef1988625574513d526ce/source_subfolder\^" ^&^& PATH=\^"/z/.conan/91fd30/1/bin/usr/bin:$PATH\^" ^&^& /z/.conan/libiconv/1.16/_/_/build/29d1f4003b3f7143826ef1988625574513d526ce/source_subfolder/configure --help ^"
04.01.2021 17:29:58: ln: failed to create symbolic link '/dev/stdin': No such file or directory
04.01.2021 17:30:00: /z/.conan/libiconv/1.16/_/_/build/29d1f4003b3f7143826ef1988625574513d526ce/source_subfolder/configure: line 567: 0: Bad file descriptor
04.01.2021 17:30:00: libiconv/1.16: Calling:
04.01.2021 17:30:00:  > /z/.conan/libiconv/1.16/_/_/build/29d1f4003b3f7143826ef1988625574513d526ce/source_subfolder/configure --enable-static --disable-shared --prefix=z:/.conan/libiconv/1.16/_/_/package/29d1f4003b3f7143826ef1988625574513d526ce --host=i686-w64-mingw32
04.01.2021 17:30:00: libiconv/1.16: run_in_windows_bash: z:\.conan\91fd30\1\bin\usr\bin\bash.exe --login -c ^"cd \^"/z/.conan/libiconv/1.16/_/_/build/29d1f4003b3f7143826ef1988625574513d526ce/source_subfolder\^" ^&^& PATH=\^"/z/.conan/91fd30/1/bin/usr/bin:$PATH\^" ^&^& /z/.conan/libiconv/1.16/_/_/build/29d1f4003b3f7143826ef1988625574513d526ce/source_subfolder/configure --enable-static --disable-shared --prefix=z:/.conan/libiconv/1.16/_/_/package/29d1f4003b3f7143826ef1988625574513d526ce --host=i686-w64-mingw32 ^"
04.01.2021 17:30:00: ln: failed to create symbolic link '/dev/stdin': No such file or directory
04.01.2021 17:30:02: /z/.conan/libiconv/1.16/_/_/build/29d1f4003b3f7143826ef1988625574513d526ce/source_subfolder/configure: line 567: 0: Bad file descriptor

04.01.2021 17:30:02: libiconv/1.16: ERROR: Package '29d1f4003b3f7143826ef1988625574513d526ce' build failed
04.01.2021 17:30:02: libiconv/1.16: WARN: Build folder z:\.conan\libiconv\1.16\_\_\build\29d1f4003b3f7143826ef1988625574513d526ce
04.01.2021 17:30:02: ERROR: libiconv/1.16: Error in build() method, line 129
04.01.2021 17:30:02:    autotools = self._configure_autotools()
04.01.2021 17:30:02: while calling '_configure_autotools', line 119
04.01.2021 17:30:02:    self._autotools.configure(args=configure_args, host=host, build=build)
04.01.2021 17:30:02:    ConanException: Error 1 while executing /z/.conan/libiconv/1.16/_/_/build/29d1f4003b3f7143826ef1988625574513d526ce/source_subfolder/configure --enable-static --disable-shared --prefix=z:/.conan/libiconv/1.16/_/_/package/29d1f4003b3f7143826ef1988625574513d526ce --host=i686-w64-mingw32
04.01.2021 17:30:02: Conan has returned exit code '1' while processing configuration 'Architecture: x86, build type: Release, compiler toolset: v142, compiler version: 16;, runtime library: MD'. Please check file 'V:\CopyTransFiley\trunk\CopyTransFiley\bin\Win32\Release\.conan\conan_52a96ecd-7d4f-4b42-9343-afe56e6221de.log' for details.

However executing the command line that's run from the plugin in VS command line will succeed (logged at log start).

"c:\Program Files\Python38\Scripts\conan.exe" install AppPath\conanfile.txt -g visual_studio --install-folder AppPath\exe\Win32\Debug.conan -s arch=x86 -s build_type=Debug -s compiler.toolset=v142 -s compiler.version=16 -s compiler.runtime=MTd --build=missing --update

64bit works as expected, but probably because libiconv has a precompiled lib and skips the build.

The issue seems to be that "bash" envinroment setup. tools.os_info.detect_windows_subsystem() returns "None" when run from Conan Visual studio plugin.

Issue started after updating to conan 1.32 from 1.28. However even after downgrading, the issue presisted,