conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
7.96k stars 952 forks source link

#16427. Make MSBuildDeps generation with deployer relocatable #16441

Closed stgatilov closed 3 weeks ago

stgatilov commented 3 weeks ago

Changelog: Feature: Make MSBuildDeps generation with deployer relocatable. Docs: Omit

Close https://github.com/conan-io/conan/issues/16427

I have copied the relativize_path logic from CMakeDeps, I can't say I fully understand its implementation though.

As far as I understand, paths should be relativized when deployer is present but kept absolute if package is in conan cache. I have not found in the code where this decision happens, but I have tested locally that paths are relative with deployer but absolute without it (even though everything is on the same disk letter).

Please advise where to add test if it is necessary. As far as I see, there are two tests which check that output with deployer is relocatable (tests/functional/command/test_install_deploy.py). If I should make a similar test for MSBuildDeps, where should I put it?

CLAassistant commented 3 weeks ago

CLA assistant check
All committers have signed the CLA.

stgatilov commented 3 weeks ago

I added a simple test. Full build test would be a bit more reliable, but I guess can't have full-blown tests on every combination of settings/features.

Since my goal was a test without msbuild, the tests in test\integration\toolchains\microsoft\test_msbuilddeps.py were much more useful to me as reference.

memsharded commented 3 weeks ago

Thanks very much for contributing this!