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

[bug] environment shell script executed in a windows subsystem don't use the subsystem_path #11988

Open
jellespijker opened this issue Aug 30, 2022 · 0 comments

Comments

@jellespijker
Copy link
Contributor

Came across this while trying to modernize the msys2 recipe See reproduction steps) and issue #11980 and #11986

Environment shell scripts executed in the bash of the msys2 recipe contain the Windows formatted paths. Since these scripts are sourced in the bash environment they should be aware of the path formatting.

I don't think that this is a huge issue, because (as far as I'm aware) all the bash commands are called as single shot commands. But it might raise some questions and it is bug prone.

Environment Details (include every applicable attribute)

  • Operating System+version: Windows 11
  • Compiler+version: MSVC
  • Conan version: 1.50.2 (also on dev
  • Python version: 3.10.4

Steps to reproduce (Include if Applicable)

create the package for: https://github.com/Ultimaker/conan-center-index/blob/modernize_autoconf/recipes/msys2/all/conanfile.py
create the package for: https://github.com/Ultimaker/conan-center-index/blob/modernize_autoconf/recipes/autoconf/all/conanfile.py

Logs (Executed commands with output) (Include/Attach if Applicable)

below is the output of the conanautotoolchain.sh notice the Windows formatting of the deactivation_ script paths

echo Capturing current environment in "C:\.conan\e6645b\1\build-release\conan\deactivate_conanautotoolstoolchain.sh"
echo "echo Restoring environment" >> "C:\.conan\e6645b\1\build-release\conan\deactivate_conanautotoolstoolchain.sh"
for v in CXX CC CPPFLAGS CXXFLAGS CFLAGS LDFLAGS PKG_CONFIG_PATH
do
    is_defined="true"
    value=$(printenv $v) || is_defined="" || true
    if [ -n "$value" ] || [ -n "$is_defined" ]
    then
        echo export "$v='$value'" >> "C:\.conan\e6645b\1\build-release\conan\deactivate_conanautotoolstoolchain.sh"
    else
        echo unset $v >> "C:\.conan\e6645b\1\build-release\conan\deactivate_conanautotoolstoolchain.sh"
    fi
done

echo Configuring environment variables

export CXX="cl"
export CC="cl"
export CPPFLAGS="$CPPFLAGS -DNDEBUG"
export CXXFLAGS="$CXXFLAGS /std:c++17 -MD -O2 -Ob2"
export CFLAGS="$CFLAGS -MD -O2 -Ob2"
export LDFLAGS="$LDFLAGS"
export PKG_CONFIG_PATH="/c/.conan/e6645b/1/build-release/conan:$PKG_CONFIG_PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant