conan-io / conan

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

[bug] .conanrc in root of windows drive is not detected #16430

Open peakschris opened 1 month ago

peakschris commented 1 month ago

Describe the bug

Windows, conan 2.4.0

I placed a .conanrc file with conan_home=d:\workdir\conan in the root of my d: drive, and then ran conan profile detect in d:\workdir\project. The .conanrc file was not detected and profile is written to default location.

Moving .conanrc to d:\workdir, it is detected

How to reproduce it

No response

memsharded commented 1 month ago

Hi @peakschris

Thanks for reporting.

So far, this was intentional. The .conanrc is intended to be a per-project mechanism, so setting it in the root directory would make it global configuration, and that can be configured at the system level (via CONAN_HOME env-var, for example). Why do you want to put the .conanrc in the root folder, can you please elaborate a bit more?

peakschris commented 1 month ago

I'm happy with that restriction (perhaps it could be documented if not already)?

I was trying to put it in the root of my drive because I would like a global config for a user without use of envvars. The reason is explained here: https://github.com/conan-io/conan/issues/16431. If that feature was supported, I would not be trying to place it in the drive root.