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

[feature] distinguish build/host context in log messages #17737

Open
1 task done
valgur opened this issue Feb 7, 2025 · 0 comments
Open
1 task done

[feature] distinguish build/host context in log messages #17737

valgur opened this issue Feb 7, 2025 · 0 comments

Comments

@valgur
Copy link
Contributor

valgur commented Feb 7, 2025

What is your suggestion?

When cross-compiling large recipes that are used as both requires and tool_requires, such as qt or protobuf, it would be very helpful if the log messages containing the package ref could include info about whether the package being built is for the host or build context.

For example, in logs like

-------- Installing package qt/6.8.2 (83 of 84) --------
qt/6.8.2: Building from source
qt/6.8.2: Package qt/6.8.2:c6dbd07191d6497f198f28e308a4b699b70b2ac9
qt/6.8.2: Copying sources to build folder
qt/6.8.2: Building your package in /home/user/.conan2/p/b/qtc8d3483cfcb1b/b
qt/6.8.2: Calling generate()
qt/6.8.2: Generators folder: /home/user/.conan2/p/b/qtc8d3483cfcb1b/b/build/Release/generators
qt/6.8.2: CMakeToolchain generated: conan_toolchain.cmake
qt/6.8.2: CMakeToolchain generated: /home/user/.conan2/p/b/qtc8d3483cfcb1b/b/build/Release/generators/CMakePresets.json
qt/6.8.2: Generating aggregated env files
qt/6.8.2: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
qt/6.8.2: Calling build()
...
qt/6.8.2: ERROR: 
Package 'c6dbd07191d6497f198f28e308a4b699b70b2ac9' build failed
qt/6.8.2: WARN: Build folder /home/user/.conan2/p/b/qtc8d3483cfcb1b/b/build/Release
ERROR: qt/6.8.2: Error in build() method, line 848
	cmake.build()
	ConanException: Error 1 while executing

I would replace the qt/6.8.2 refs with qt/6.8.2 [build] or qt/6.8.2 [host]. This would help quite a bit in case of build errors like the above, where it's hard to tell which graph node exactly failed.

It's also quite relevant for the graph computation step, e.g.:

======== Computing dependency graph ========
qt/6.8.2: Requested modules: [] <-- requires for consuming package
qt/6.8.2: Requested modules: [] <-- tool_requires for consuming package
qt/6.8.2: Requested modules: [] <-- tool_requires for qt package
Graph root
    cli
...

I would only include this info in case the same recipe is present multiple times in the build graph, though, to not overburden the logs.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
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

1 participant