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] self.win_bash and msys2, internal commands not found #12110

Closed
lasote opened this issue Sep 14, 2022 · 4 comments · Fixed by #12457
Closed

[bug] self.win_bash and msys2, internal commands not found #12110

lasote opened this issue Sep 14, 2022 · 4 comments · Fixed by #12457
Milestone

Comments

@lasote
Copy link
Contributor

lasote commented Sep 14, 2022

While testing this PR: #12095

I saw that I couldn't run any command belonging to msys2 (installed packages there) located in /usr/bin, but there were tests that work because they use the @pytest.mark.tool_msys2 that is putting the C:/msys64/usr/bin in the path in the conftest.py.

I think that is very confusing because a recipe trying to run a command like autoconf in msys2 doesn't find it, nevertheless, we have 2 conf to "set up" the environment: tools.microsoft.bash:subsystem and tools.microsoft.bash:path. So we could:

  1. Ignore this and expect the user to have the c:/mysys2/../usr/bin in the path.
  2. Somehow declare the PATH to the folder "/usr/bin" before running the command
  3. Have a conf for that path? Looks like too much.

PD: I haven't tested it this happens in other subsystems.
PD: This is failing in develop2 too.

@lasote lasote added this to the 1.53 milestone Sep 14, 2022
@jellespijker
Copy link
Contributor

jellespijker commented Sep 14, 2022

@lasote I have a feeling it might be related to: #11980 (which has a proposed fix: #11980) or more likely #11986

@lasote
Copy link
Contributor Author

lasote commented Sep 14, 2022

Yes, thanks, #11986 is the one. I see that you closed the issue because of using of msys2 conan center package. But I still think there is a bug in Conan, working with a local msys2 installation should also work.

@jellespijker
Copy link
Contributor

Agreed. My proposed solution was making sure the parent directory of the bash.exe from the conf value was added to the msys2 generated file. But that caused some issue at the time: #11987

@czoido czoido modified the milestones: 1.53, 1.54 Oct 4, 2022
@memsharded
Copy link
Member

I am checking this, and this works:

[settings]
arch=x86_64
os=Windows
compiler=gcc
compiler.version=6
compiler.libcxx=libstdc++11

[conf]
tools.microsoft.bash:subsystem=msys2
tools.microsoft.bash:path=C:/ws/msys64/usr/bin/bash.exe
tools.env.virtualenv:auto_use=True

[buildenv]
PATH=+(path)C:/ws/msys64/usr/bin
from conan import ConanFile


class HelloConan(ConanFile):
    name = "hello"
    version = "0.1"

    # Binary configuration
    settings = "os", "arch"

    win_bash = True

    def build(self):
        self.run("ar")

The winbash might be redundant here, of course, not strictily necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants