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] WARN: Name containing special chars is discouraged 'hello-world' #3329

Closed
andrey-zherikov opened this issue Aug 16, 2023 · 6 comments · Fixed by conan-io/conan#15920
Closed
Assignees
Milestone

Comments

@andrey-zherikov
Copy link
Contributor

andrey-zherikov commented Aug 16, 2023

Environment details

  • Operating System+version: Windows 10
  • Compiler+version: N/A
  • Conan version: 2.0.9
  • Python version: 3.11.2

Steps to reproduce

conan new cmake_lib -d name=hello-world -d version=1.0
conan create .  

Logs

> conan create . 

======== Exporting recipe to the cache ========
WARN: Name containing special chars is discouraged 'hello-world'
...

Note that hello-world is valid name according to docs

@memsharded
Copy link
Member

Hi @andrey-zherikov

Thanks for your comment.
This is a valid warning, and also the docs are fine:

  • The name hello-world can be used. It is not an error, and in general Conan will manage to create the packages.
  • The name hello-world is discouraged, and the warning will tell about it. The reason is that so many integrations, build system, generators can struggle with filenames, variables, etc that contain these special characters that will appear. We try to test and fix the most popular built-in ones, but we have seen this failing too many times to actively discourage it.

The reason that these names have not been completely banned was to not introduce yet another breaking change in Conan 2.0. But it is ok to discourage and warn against them, because they are quite problematic in many cases.

@andrey-zherikov
Copy link
Contributor Author

Thank you for clarification. Can this explanation be written in docs some way? It's confusing right now.

@memsharded
Copy link
Member

Moving this to the docs repo, thanks for the feedback!

@memsharded memsharded transferred this issue from conan-io/conan Aug 17, 2023
@memsharded memsharded added this to the 2 milestone Aug 17, 2023
@SzBosch
Copy link

SzBosch commented Feb 20, 2024

Can this warning be suppressed?

@memsharded
Copy link
Member

At the moment it is not possible because this warning is not tagged, but there is a core:skip_warnings conf that can be used to silence warnings, maybe we could add a new tag.

In any case, this warning I'd suggest not silencing it, it would just postpone the problems, it is much better recommended to rename it and get rid of the special char. I have seen a bunch of users being later affected by it later down the road, when other tool doesn't like the special chars in filenames

@memsharded
Copy link
Member

We are finally removing this warning in conan-io/conan#15920 for 2.3, there are too many packages in ConanCenter with "-", this would be too much to migrate.

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

Successfully merging a pull request may close this issue.

3 participants