8000 [bug] package has 'exports_sources' but sources not found in local cache from local conan center index · Issue #18371 · conan-io/conan · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[bug] package has 'exports_sources' but sources not found in local cache from local conan center index #18371

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&rdqu 8000 o;, 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

Open
igadmg opened this issue May 27, 2025 · 4 comments
Assignees

Comments

@igadmg
Copy link
igadmg commented May 27, 2025

Describe the bug

We had our local conan center index with some packages which does not exist in central conan center. That index is setup with conan remote add --index 0 --force local-conan-center ./conan/conan-center-index
So here what is broken. If I clear local cache with conan remove "*" -c and then build with conan install ./src --output-folder . --build missing --settings build_type=Debug I got all packages from official conan center built correctly, even the one which are duplicated in our local conan center, but when conan try to build packages which exist only in our local conan center I got that error package has 'exports_sources' but sources not found in local cache from local conan center index and package is not built until I by hand remove it with conan remove "vtk/*" (for example)
Why that is happening, I it possible to fix that, very annoying and prevents new deployments.

How to reproduce it

  1. Setup local conan index
  2. add it with conan remote add --index 0 --force local-conan-center ./conan/conan-center-index
  3. remove all packages with conan remove "*" -c
  4. build project - and it will fail on building packages which exist only in local conan center index.
@AbrilRBS AbrilRBS self-assigned this May 27, 2025
AbrilRBS added a commit to AbrilRBS/conan that referenced this issue May 28, 2025
@AbrilRBS
Copy link
Member

Hi @igadmg thanks a lot for taking the time to report this, we appreciate it

After trying a few different ways, I have not yet been able to reproduce this.
My current approach is:

  • Create a foo/0.1 package with an exports_source attribute, call conan create on it, and upload it to a test remote

  • Create a bar/0.1 package with an exports_source attribute

  • Both of these are inside a local-recipes-index remote that has index 0

  • Call conan install --requires=foo/0.1 --requires=bar/0.1 --output-folder=folder

This succeeds regardless of how my test is set-up, so I'd appreciate it you could provide a minimal reproducible example to be able to track it down - see https://github.com/conan-io/conan/pull/18382/files for the test I mentioned

@memsharded
Copy link
Member

I have also tried myself to reproduce without success.
I have tried to do a full new test, trying to resemble the steps above, but it doesn't fail:

def test_export_sources():
    folder = temp_folder()
    recipes_folder = os.path.join(folder, "recipes")
    mypkg_config = textwrap.dedent("""
        versions:
          "1.0":
            folder: all
        """)
    mypkg = textwrap.dedent("""
        from conan import ConanFile
        from conan.tools.files import load
        class Zlib(ConanFile):
            name = "mypkg"
            exports_sources = "*"
            def build(self):
                self.output.info(f"CONANDATA: {self.conan_data}")
                self.output.info(f"BUILDING: {load(self, 'file.h')}")
            """)
    save_files(recipes_folder,
               {"mypkg/config.yml": mypkg_config,
                "mypkg/all/conanfile.py": mypkg,
                "mypkg/all/conandata.yml": "",
                "mypkg/all/file.h": "//myheader"})

    c = TestClient(light=True, default_server_user=True)
    c.run(f"remote add local '{folder}' --index=0")
    c.save({"conanfile.txt": "[requires]\nmypkg/1.0"})
    c.run("install . --build missing")
    assert "mypkg/1.0: CONANDATA: {}" in c.out
    assert "mypkg/1.0: BUILDING: //myheader" in c.out

I have also tried to follow the steps manually, but it didn't fail either.
Maybe having those steps fully specified and automated in a small script could help to reproduce.

@igadmg
Copy link
Author
igadmg commented May 29, 2025

Strange, I was trying to extract our project setup to show the problem but that time it builds. I will try to make a test project later.

@igadmg
Copy link
Author
igadmg commented May 30, 2025

But that still happen in the full project, and that is very annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0