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

Refactor libcnb_package::cross_compile_assistance #727

Open
edmorley opened this issue Nov 9, 2023 · 0 comments
Open

Refactor libcnb_package::cross_compile_assistance #727

edmorley opened this issue Nov 9, 2023 · 0 comments
Labels
enhancement New feature or request libcnb-package

Comments

@edmorley
Copy link
Member

edmorley commented Nov 9, 2023

I think we should make the following changes to cross_compile_assistance():

  • Make it return a Result<Config, CrossCompileConfigError> instead of the three-state CrossCompileAssistance enum, where some of the states really should be errors. (The call site can still choose to ignore the errors if eg --no-cross-compile-assistance is used.)
  • De-duplicate the help text
  • Stop ignoring I/O errors that occur when using which (other than not found errors)

See:
https://github.com/heroku/libcnb.rs/blob/main/libcnb-package/src/cross_compile.rs

@edmorley edmorley added enhancement New feature or request libcnb-package labels Nov 9, 2023
edmorley added a commit that referenced this issue Nov 9, 2023
…text (#729)

In order to compile buildpacks, users need to have both the musl
toolchain and the Rust target installed.

If the musl toolchain is missing, we already show help text that
says what packages need to be installed.

However, this help text did not mention the Rust target, meaning
after installing the musl tools, users would then go on to receive
another error - this time from the Rust compiler.

Whilst the Rust compiler error message does suggest running the
`rustup target add` command itself:
- this suggestion is often lost in the noise:
  rust-lang/rust#117640
- it means the users has had two failed attempts in a row, which
  could make the experience feel open-ended/frustrating

Now, the cross-compile assistance help text also suggests the
`rustup target add` step, improving the UX slightly.

The help texts are starting to include a fair bit of duplication, however,
refactoring is covered by the separate #727.

Fixes #716.
GUS-W-14438920.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request libcnb-package
Projects
None yet
Development

No branches or pull requests

1 participant