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

[question] Feedback: rename build and run traits #11423

Closed
1 task done
ZbigniewRA opened this issue Jun 8, 2022 · 6 comments
Closed
1 task done

[question] Feedback: rename build and run traits #11423

ZbigniewRA opened this issue Jun 8, 2022 · 6 comments
Assignees

Comments

@ZbigniewRA
Copy link

In Conan 2.0 we have those things:

self.requires("cmake/1.0", build=True)

The build=True is very confusing. It looks like we are asking to build cmake, while we just ask for it to be available at build time (only??).
I would suggest to rename build and run traits to buildtime and runtime.

@memsharded memsharded self-assigned this Jun 8, 2022
@memsharded
Copy link
Member

memsharded commented Jun 8, 2022

The traits were discussed in the Tribe proposal: conan-io/tribe#26, and build and run traits were explicitly proposed there and the proposal was approved.

In general, it shouldn't be an issue for the beginner, as they shouldn't get into these details soon. Instead, the recommended syntax is self.tool_requires("cmake/1.0"). Explicitly adding build=True trait should be extremely uncommon.

@ZbigniewRA
Copy link
Author

Beginners will need to understand what static_library package type is.
Then they will see that build is False for those.
And then they will conclude they don't understand a thing about how Conan works.

So it's not really about explicit build=True being uncommon, but the fact that knowing what build means is essential for everyone.

@memsharded
Copy link
Member

It is not true that run == runtime. A tool_require as tool_require("cmake/1.0") has build=True, run=True. build=True means "build context", and run=True means that it has something that runs, executables. But not for the runtime of the application that is being developed, it is clear that cmake is not for runtime but for buildtime. Having self.tool_requires("cmake/1.0", buildtime=True, runtime=True) will be even more confusing.

Again, beginners doesn't need to know about package types. The conan new cmake_lib does not contain anything about package_types, does not contain any trait, and is a fully functional example. In most of the cases, developers shouldn't need to worry about requirement traits, as the default ones for requires(), tool_requires() and test_requires() will be more than enough for all beginner cases. All the tutorial that is being written in https://docs.conan.io/en/2.0-alpha/ doesn't contain even a mention to requirement traits in the "consuming" or "creating packages" (wip) sections.

@ZbigniewRA
Copy link
Author

So maybe:

  • build -> buildtime or build_context_only
  • run -> runtime_components

@SSE4
Copy link
Contributor

SSE4 commented Jun 8, 2022

I think it's valid concern. as it's experimental, it shouldn't be late to change.
in general I prefer terminology to be unified within the same project. otherwise, if same term may refer to a different things depending on the context, it's confusing for newcomers. e.g. build currently may refer:

  • build context (build vs host profile)
  • --build to builld package(s) from sources
  • a dependency is a build tool

in general, it would be nice to use more precise and less ambigious definitions.

@memsharded
Copy link
Member

Closing as not planned, Conan 2 has been using these trait names for 1 year now.

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

No branches or pull requests

3 participants