-
Notifications
You must be signed in to change notification settings - Fork 8
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
Incorrect error message shown when cross-compile dependencies not installed #704
Comments
@jose-fully-ported Thank you for filing an issue. When I run the tests locally I don't get that error message (macOS 14.0; M1). I notice in the STR, there's no mention of brew installing the cross-compilation requirements. If they are missing, then the framework should tell you to install them - or at least it used to. Perhaps this is an error message UX regression after the refactoring in #666 or one of the other similar PRs? If you run If not, then for now could you follow these steps and see if that allows the tests to succeed? libcnb.rs/libcnb-package/src/cross_compile.rs Lines 21 to 28 in cdd2eb4
|
So I ran the two commands and got that error from
I then did the |
Thank you. Tomorrow I'll look into why |
Ok so this is a regression from #666 in libcnb-test 0.15.0: The previous implementation had to unwrap a temp dir path at one point, and used the ~"but crate wasn't packaged as a buildpack" message for that. In #666 the code was refactored and the same error message used when unwrapping a completely different return value (the result from packaging). Before when packaging failed a "Could not package current crate as buildpack" error was returned instead: |
Ah so there are two parts to the regression:
|
In fact, it seems the regression was actually caught be the tests, which is why they ended up being changed in: The problem is that IMO we should only be using asserts/panics/expects at the runner top level, and not in lower down helper functions. |
After #666, incorrect error messages were shown for failures that occurred during buildpack compilation packaging, since the handling in `TestRunner::build_internal` used the wrong message text, plus didn't include the error struct in the `panic!` string. These have been fixed, plus display representations added to all of the new error variants. In addition, the usages of `assert!` and `.unwrap()` in functions that return `Result` have been replaced with new error enum variants. The change in output can be seen in the new tests added by #717. There is one last scenario that doesn't yet have a test - the testing of the cross-compilation output itself. However, I'll add that separately, since it's going to be more complex to test / there are a few different options that we'll need to choose between. Fixes #704. Fixes #709. Fixes #710. GUS-W-14395170.
I've just released libcnb 0.16.0 (which includes the fix for this), and updated the Node.js CNB to use that version. Now, if I
|
<3 |
I was trying to run tests for the nodejs buildpack (to ensure the behavior around alternative package manager selection is tested, since it appears to have changed in the past two days) but am encountering an error:
Output
Of note, I'm on MacOS Venture 13.6 on a Macbook Air M2, so maybe its an architecture thing?
The text was updated successfully, but these errors were encountered: