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

libcnb-cargo: Prevent stdout spam when not packaging for automation #600

Open
edmorley opened this issue Jul 17, 2023 · 1 comment
Open

Comments

@edmorley
Copy link
Member

After #575, the cargo libcnb package command now outputs the paths of all compiled buildpacks to stdout (with the rest of the output on stderr).

This is intended so that automation can fish out the buildpack names, and is used by eg:
https://github.com/heroku/languages-github-actions

However, it gives a cluttered output for human users of cargo libcnb package, eg:

$ cargo libcnb package
🔍 Locating buildpacks...
📦 [1/1] Building heroku/python
Determining automatic cross-compile settings...
Building binaries (x86_64-unknown-linux-musl)...
    Finished dev [unoptimized] target(s) in 0.05s
Writing buildpack directory...
Successfully wrote buildpack directory: target/buildpack/x86_64-unknown-linux-musl/debug/heroku_python (7.66 MiB)
✨ Packaging successfully finished!

💡 To test your buildpack locally with pack, run:
pack build my-image-name \
  --buildpack /Users/emorley/src/buildpacks-python/target/buildpack/x86_64-unknown-linux-musl/debug/heroku_python \
  --path /path/to/application

/Users/emorley/src/buildpacks-python/target/buildpack/x86_64-unknown-linux-musl/debug/heroku_python

(ie: the very final line of the log output)

Perhaps we need a separate --machine-readable or some other output format control?

@Malax
Copy link
Member

Malax commented Aug 21, 2023

Minor: Ideally we'd use --message-format like Cargo itself does. Otherwise I think it's the right direction - you either need output for humans or machines - usually not both.

edmorley added a commit that referenced this issue Sep 14, 2023
The logs output by `cargo libcnb package` have changed over recent
PRs - this updates the example output to match.

There's still some improvements required to the output (eg #600), however,
for now it at least reflects reality.
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