Comments (6)
I checked the workaround:
tc = CMakeToolchain(self)
td = target_dir.replace("\\", "/")
td = td.replace("/", "${VAR_THAT_CONTAINS_A_SLASH}")
tc.variables["VAR_THAT_CONTAINS_A_SLASH"] = "/"
tc.variables["GUROBI_EXTRACT_TARGET_DIR"] = td
and it results in a working build; of course, this is not nice and raises the question whether the order of the 'set(...)' commands in conan_toolchain.cmake
always reflects the order of setting the values on the python side (because the workaround would break if VAR_THAT_CONTAINS_A_SLASH
was set after GUROBI_EXTRACT_TARGET_DIR
.
from conan.
Thanks for your report.
It seems the issue is that the relativization of paths if finding /home/my_username/.conan2/p/b/gurob4ddde3d219d31
as a valid "full path", but then it happens that it is located as subfolder in a very non conventional file system that starts with /misc/ibr
and that was not expected. I'll have a look to see if this can be fixed.
from conan.
Note: it is not impossible that this is due to the fact that my home directory (which I build in) is reachable by two different paths (/misc/ibr/home/my_username and /ibr/home/my_username) via a symlink I have no control over.
This is indeed what is confusing the system, and the reason it doesn't happen in the vast majority of other cases
Overall, I find this type of postprocessing of string values quite dangerous and unexpected and I would have expected the values to be passed to CMake without change or interpretation (after all, they might not even be paths); however, I could see that there might be some cases that require it.
We have been improving this and adding explicit relativization of things when they are known to be paths. The original reason was the demand to make generated files relocatable (see https://blog.conan.io/2023/05/23/Conan-agnostic-deploy-dependencies.html), but it is true that the current replacement strategy is not great, I will try to do another iteration over this.
from conan.
Thanks for the quick response/reaction! I had something like this in mind when I said I could see reasons one would like to do a replacement like this. For me, this issue now has little time pressure/sensitivity since I have a workaround (albeit one that might be a bit brittle).
from conan.
I am proposing #16316 for next Conan 2.4 release, in case you want to give it a try and run it from sources from my branch with your code.
Thanks for the quick response/reaction! I had something like this in mind when I said I could see reasons one would like to do a replacement like this. For me, this issue now has little time pressure/sensitivity since I have a workaround (albeit one that might be a bit brittle).
Thanks very much for your understanding and consideration, it is really appreciated. Very often maintainers of very active open source projects are subject to lots of pressure from users to fix things and are overwhelmed with demands, so this understanding is great.
But I agree that we should be pursuing correctness and it is not the first time someone is bitten by this raw replacement, so I am pushing the PR to get rid of it, and do a better more explicit replacements of things known to be paths. It is possible that this might need some further iteration, because some missing relativizations, but lets wait for users feedback about it.
from conan.
Related Issues (20)
- [bug] Github actions fail when set `tools.system.package_manager:mode` HOT 2
- [question] How to depend on a specific Git commit or branch of a project HOT 7
- [bug] build_requires with different #RREV are not used correctly HOT 2
- [question] What is the correct way of exposing PATH when packaging library type? HOT 2
- [feature] [question] Support the Tricore-gcc toolchain and arch
- Incorrect generation of file conanvcvars.ps1 HOT 2
- [question] Conan centre package rereleases HOT 9
- [question] Should Visual Studio 17.10 require a profile update to 194? HOT 31
- [bug] Multiple `--build=missing:~foo` does not work HOT 3
- [bug] Conan setting `CMAKE_FIND_ROOT_PATH_MODE_*=BOTH` fundamentally breaks cross-compilation HOT 4
- [feature] Add a --skip-generator option HOT 4
- [feature] Allow multiline blocks and inline comments in profiles HOT 1
- [question] Handling package that is platform and variant agnostic but not the tests in the package HOT 30
- [question] Install from local recipes index with user/channel HOT 9
- [bug] requires of a dependency of a dependency in build context not visible HOT 3
- [question] How to modify global.conf HOT 10
- [bug] conan.tools.build.check_min_cppstd does infer default cppstd as documented HOT 1
- [bug] Conanfile self.dependencies.items() is empty when overriding versions in the top package. HOT 5
- [question] Inject toolchain.cmake from RTOS library package via user_toolchain HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conan.