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

Fix: use self._run instead of self._conanfile.run to ensure vcvars apply for Ninja/NMake generators #3803

Merged
merged 2 commits into from Oct 23, 2018

Conversation

Projects
None yet
3 participants
@SSE4
Copy link
Contributor

commented Oct 19, 2018

follow up on #2803

when using ninja_installer/1.8.2@bincrafters/stable, right now the following code is required:

        if self.settings.compiler == 'Visual Studio':
            with tools.vcvars(self.settings, force=True, filter_known_paths=False):
                self.build_cmake()
        else:
            self.build_cmake()

I tried to simplify it in our zmq/4.2.2@bincrafters/stable recipe, but it currently fails, because there are places in CMake helper which use self._conanfile.run directly instead of self._run:

https://github.com/conan-io/conan/blob/1.8.3/conans/client/build/cmake.py#L183
https://github.com/conan-io/conan/blob/1.8.3/conans/client/build/cmake.py#L185

Changelog: Fix: vcvars is also called in the CMake() build helper when using Ninja or NMake generators.

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

@ghost ghost added the contributor pr label Oct 19, 2018

@SSE4 SSE4 changed the title - use self._run instead of self._conanfile.run to ensure vcvars apply… Fix: use self._run instead of self._conanfile.run to ensure vcvars apply… Oct 19, 2018

@SSE4 SSE4 changed the title Fix: use self._run instead of self._conanfile.run to ensure vcvars apply… Fix: use self._run instead of self._conanfile.run to ensure vcvars apply for Ninja/NMake generators Oct 19, 2018

@SSE4 SSE4 force-pushed the SSE4:vcvars_cmake_ninja branch from a0e32bd to 869c879 Oct 19, 2018

- use self._run instead of self._conanfile.run
- ensure vcvars apply for Ninja/NMake generators

Signed-off-by: SSE4 <tomskside@gmail.com>
@danimtb
Copy link
Member

left a comment

I remember this change was done some time ago. Was this tested somewhere? If not, we should write a test for it

@danimtb
Copy link
Member

left a comment

I remember this change (using vcvasr for ninja) was done some time ago. Was it tested somewhere? If not, it will require a proper test

@memsharded memsharded added this to the 1.9 milestone Oct 22, 2018

@memsharded
Copy link
Contributor

left a comment

This makes sense, but it would deserve (a unit test, no need full integration test) a test

@SSE4

This comment has been minimized.

Copy link
Contributor Author

commented Oct 22, 2018

I am adding the test

- add unit test to verify vcvars are really applied in CMake
Signed-off-by: SSE4 <tomskside@gmail.com>
@SSE4

This comment has been minimized.

Copy link
Contributor Author

commented Oct 22, 2018

unit test has been added

@SSE4

This comment has been minimized.

Copy link
Contributor Author

commented Oct 22, 2018

I am not sure about CI, it fails with strange error:

ModuleNotFoundError: No module named 'semver'

not sure how is it related to my changes, probably an infrastructure error, so please re-start build

@memsharded memsharded merged commit 487ff56 into conan-io:develop Oct 23, 2018

1 check passed

continuous-integration/jenkins/pr-head This commit looks good
Details

@ghost ghost removed the contributor pr label Oct 23, 2018

@SSE4 SSE4 referenced this pull request Oct 23, 2018

Merged

Fix: call vcvars for clang-cl as well #3832

4 of 5 tasks complete

grisumbras pushed a commit to grisumbras/conan that referenced this pull request Dec 27, 2018

Merge pull request conan-io#3803 from SSE4/vcvars_cmake_ninja
Fix: use self._run instead of self._conanfile.run to ensure vcvars apply for Ninja/NMake generators
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.