conan-io / conan-io/docs

[question] `CONAN_V2_MODE` and `settings.os` access in `source()` method

Open
#2,458 8 comments 0 reactions 1 assignee Claimed by @memsharded View on GitHub
type: question
Dominant language
C++
Stars
125
Forks
382
Avg merge
22h 39m
Merged PRs (30d)
21

Description

I'm using Conan 1.46.2 with `CONAN_V2_MODE` enabled. I have some recipes which have to download different source archives for different operating systems, exactly what https://docs.conan.io/en/1.46/reference/conanfile/methods.html#source descibes as "Maybe the only setting that makes sense" using there. Unfortunately, I'm getting
```
ConanV2Exception: Conan v2 incompatible: 'self.settings' access in source() method is deprecated.
```
This even completely breaks packaging pre-compiled libraries as described in that documentation link.

Is there any recommended workaround? Or has that just not been noticed yet?

- [X] I've read the [CONTRIBUTING guide](https://github.com/conan-io/conan/blob/develop/.github/CONTRIBUTING.md).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.