Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] icu/74.2: won't build with msvc17 from within msys2, without MSVC paths pre-setup #23679

Closed
paulharris opened this issue Apr 20, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@paulharris
Copy link
Contributor

Description

I use msys2 as my shell (git-sdk-64), on my M:
I set up a python devenv with a dos prompt first, using Windows python (not msys),

Then in msys terminal, I run . /m/conan4/devenv/Scripts/activate
This works with most things - let me know if I should be doing things differently.
(I want to build with msvc17 and (in future) clang+msvc)

Now, I have 2 options when running my terminal. I'll just talk about DOS prompts, but I actually use Windows Terminal.

  1. I start a plain DOS prompt. Enter bash. ie standard msys startup.
  2. I run the MSVC command prompt setup first, and THEN enter bash.

The ICU build works with approach #2, which means the recipe DEPENDS ON the environment of the calling conan command. It SHOULD be using the conan environment setup, like all the other recipes!

So, anyway, without the initial MSVC environment setup,
I then run my big conan install for my recipe, and this is what happens when it comes to ICU's build:

see log below

NOTE that it complains, and then asks me to check config.log
I checked, the difference is there are MSVC bin paths in the PATH variable in the working example.

Package and Environment Details

  • Package Name/Version: icu/74.2
  • Operating System+version: Windows 10
  • Compiler+version: msvc17
  • Conan version: conan 2.2.3
  • Python version: Python 3.11.2

Conan profile

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Debug
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Debug
compiler.version=193
os=Windows
[options]
libcurl/:with_ssl=schannel
mxrap/
:shared=True
qt/*:openssl=False
[conf]
tools.cmake.cmaketoolchain:generator=Ninja

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[options]
libcurl/:with_ssl=schannel
qt/
:openssl=False
[conf]
tools.cmake.cmaketoolchain:generator=Ninja

Steps to reproduce

Open MSYS

conan create . --version 74.2 --user test --channel test1 -pr:h theprofileh -pr:b theprofileb

Logs

Click to expand log
-------- Installing package icu/74.2 (40 of 68) --------
icu/74.2: Building from source
icu/74.2: Package icu/74.2:08facffd46140036be35c6dc82940b177605cc13
icu/74.2: Copying sources to build folder
icu/74.2: Building your package in M:\cocache4\cache\b\icuf12bbba6c97ae\b
icu/74.2: Calling generate()
icu/74.2: Generators folder: M:\cocache4\cache\b\icuf12bbba6c97ae\b\build-debug\conan
icu/74.2: Generating aggregated env files
icu/74.2: Generated aggregated env files: ['conanbuild.sh', 'conanbuild.bat', 'conanrun.bat']
icu/74.2: Calling build()
icu/74.2: Apply patch (file): patches/0001-69.1-fix-mingw.patch
icu/74.2: Calling:
 > "/m/cocache4/cache/b/icuf12bbba6c97ae/b/src/source/configure" --disable-shared --enable-static --prefix=/ --bindir=${prefix}/bin --sbindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include --datarootdir=${prefix}/lib --enable-release=no --enable-debug=yes --enable-dyload=yes --enable-extras=no --enable-icuio=yes --disable-layoutex --disable-layout --enable-tools=yes --enable-tests=no --disable-samples --with-library-bits=64
icu/74.2: RUN: "/m/cocache4/cache/b/icuf12bbba6c97ae/b/src/source/configure" --disable-shared --enable-static --prefix=/ --bindir=${prefix}/bin --sbindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include --datarootdir=${prefix}/lib --enable-release=no --enable-debug=yes --enable-dyload=yes --enable-extras=no --enable-icuio=yes --disable-layoutex --disable-layout --enable-tools=yes --enable-tests=no --disable-samples --with-library-bits=64
conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=None - vcvars_ver=14.3
[vcvarsall.bat] Environment initialized for: 'x64'
mkdir: cannot create directory ‘/dev/shm’: Read-only file system

Creating /dev/shm directory failed.
POSIX semaphores and POSIX shared memory will not work

mkdir: cannot create directory ‘/dev/mqueue’: Read-only file system

Creating /dev/mqueue directory failed.
POSIX message queues will not work

configure: loading site script /etc/config.site
checking for ICU version numbers... release 74.2, library 74.2, unicode version 15.1
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking whether to build debug libraries... yes
checking whether to build release libraries... no
checking whether the C compiler works... no
configure: error: in `/m/cocache4/cache/b/icuf12bbba6c97ae/b/build-debug':
configure: error: C compiler cannot create executables
See `config.log' for more details

icu/74.2: ERROR:
Package '08facffd46140036be35c6dc82940b177605cc13' build failed
icu/74.2: WARN: Build folder M:\cocache4\cache\b\icuf12bbba6c97ae\b\build-debug
ERROR: icu/74.2: Error in build() method, line 204
        autotools.configure(build_script_folder=os.path.join(self.source_folder, "source"))
        ConanException: Error 77 while executing
@paulharris paulharris added the bug Something isn't working label Apr 20, 2024
@paulharris paulharris changed the title [package] icu/74.2: won't build with msvc17 from within msys2 shell environment [package] icu/74.2: won't build with msvc17 from within msys2, without MSVC paths pre-setup Apr 20, 2024
@paulharris
Copy link
Contributor Author

I guess the base question is:
Must I always run conan builds from within a terminal with MS vcvars already executed?
Or is this something I should expect conan to initialise with each package build step?

@paulharris
Copy link
Contributor Author

I have managed to get this to build with some changes to the conan source code.
I'm making a PR.

@franramirez688
Copy link
Contributor

@paulharris May we close this issue as solved?

@franramirez688 franramirez688 self-assigned this Nov 29, 2024
@ErniGH
Copy link
Contributor

ErniGH commented Nov 29, 2024

Hello @paulharris ,

I have been testing and was able to replicate the error. This error persists in the later versions of ICU, ICU/75.1, and ICU/76.1. I resolved it by upgrading the compiler version from 193 to 194. The profiles would be as follows:

Profile host:
[settings]
arch=x86_64
build_type=Debug
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Debug
compiler.version=194
os=Windows
[options]
libcurl/:with_ssl=schannel
mxrap/:shared=True
qt/*:openssl=False
[conf]
tools.cmake.cmaketoolchain:generator=Ninja

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=194
os=Windows
[options]
libcurl/:with_ssl=schannel
qt/:openssl=False
[conf]
tools.cmake.cmaketoolchain:generator=Ninja

@paulharris
Copy link
Contributor Author

Hrm I wanted to build with 194 but there is another library that doesn't build with 194.
If you say its fixed with 194, I'm happy to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants