Skip to content

[question] How to properly use "core.sources:exclude_urls"? #18277

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

Open
1 task done
Nekto89 opened this issue May 9, 2025 · 2 comments
Open
1 task done

[question] How to properly use "core.sources:exclude_urls"? #18277

Nekto89 opened this issue May 9, 2025 · 2 comments

Comments

@Nekto89
Copy link
Contributor

Nekto89 commented May 9, 2025

What is your question?

Hi,

I currently try to switch to recommended way of backing up sources with conan.
I've added these lines to my global.conf

core.sources:download_urls=["https://myserver/artifactory/thirdparty_public-generic-dev-local/backup-sources/", "origin"]
core.sources:download_cache=D:/conan2_sources_backup
core.sources:exclude_urls=["https://myserver/artifactory/"]
core.sources:upload_url=https://myserver/artifactory/thirdparty_public-generic-dev-local/backup-sources/

Sources are cached locally and uploaded to server. But for some reason exclude doesn't work. I have recipes with 2 urls inside. For example, for xsimd I have additional URL from old way of mirroring:

  - "https://myserver/artifactory/thirdparty_public-generic-dev-local/xsimd/13.0.0.tar.gz"
  - "https://github.com/xtensor-stack/xsimd/archive/13.0.0.tar.gz"

I would expect that in this case conan won't mirror xsimd sources because first url starts with "https://myserver/artifactory/". But it still uploads sources. Am I missing something in syntax?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@AbrilRBS AbrilRBS self-assigned this May 9, 2025
@AbrilRBS
Copy link
Member

AbrilRBS commented May 9, 2025

@Nekto89 hi, thanks for the report.

Currently, all URLs must match at least one of the exclusion URLs for the whole source not to be backed up, but it's true that for cases like yours, that helps little. I'll check with the team if we modifying this behaviour would be worth it, but meanwhile, one question:

If you're already manually mirroring the sources for this reference, why keep the original sources? In case a developer does not have access to the myserver one?

@Nekto89
Copy link
Contributor Author

Nekto89 commented May 9, 2025

If you're already manually mirroring the sources for this reference, why keep the original sources? In case a developer does not have access to the myserver one?

I would like to get rid of this manual mirroring but there will be overlap for some time until old versions with conandata.yml customizations would be gone naturally. If I understood correctly, Artifactory is smart enough to optimize storage and doesn't create copy of file internally if hashes are the same. But still it would be "prettier" not to upload already existing file.
So do I understand correctly, that current implementation of "exclude_urls" is intended just for filtering out sources for internal packages that aren't mirrored from outside?

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

2 participants