Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AbrilRBS opened this issue Jun 27, 2024 · 1 comment
Closed

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

AbrilRBS opened this issue Jun 27, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@AbrilRBS
Copy link
Member

AbrilRBS commented Jun 27, 2024

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
@AbrilRBS
Copy link
Member Author

Closing as solved, the issue arose in an old Conan version. The global conf is properly propagated to the tool helpers via the conan_helper mechanisim, it's just that the conanfile's conf which does not get it, which we think is "a feature not a bug" :)

@AbrilRBS AbrilRBS closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant