Skip to content

[bug] conan source does not actually get global.conf's core. confs #16555

@AbrilRBS

Description

@AbrilRBS

Describe the bug

While helping @ErniGH with an issue while trying to fetch glib's source with conan source, we noticed that the command was not respecting the core.sources:download_cache conf.

In fact, https://github.com/conan-io/conan/blob/develop2/conan/api/subapi/local.py#L78 comment is a lie, because only tool and user confs are propagated when eventually calling rebase_conf_definition in the newly created profile.

I'm not sure then how this has ever worked 🤔

How to reproduce it

This test currently fails

def test_source_method_access_to_globalconf():
    c = TestClient(light=True)
    c.save({"conanfile.py": textwrap.dedent("""
    from conan import ConanFile

    class Pkg(ConanFile):
        name = "pkg"
        version = "0.1"
        def source(self):
            self.output.info(f'Backup download cache: {self.conf.get("core.sources:download_cache")}')
    """)})
    c.save_home({"global.conf": "core.sources:download_cache=foobar"})
    c.run("source .")
    assert "Backup download cache: foobar" in c.out

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions