-
Notifications
You must be signed in to change notification settings - Fork 9
Fix auto PATH ordering #938
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
Conversation
Missing delimiter strikes again
The docs stated that we're appending the layer-bin path. With this change we're now prepending it to align with lifecycle.
873bf84
to
cf6b9f0
Compare
There was a problem hiding this c 8000 omment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. I have two small code suggestions. I also took the liberty to refactor the tests in cf6b9f0. I found them hard to grasp and they had some things in them that didn't matter to the issue under test and are tested already. LMK if you're fine with those changes.
Before: ``` thread 'layer_env::tests::layer_paths_come_before_manually_added_paths' panicked at libcnb/src/layer_env.rs:944:13: assertion `left == right` failed left: Some("/var/folders/yr/yytf3z3n3q336f1tj2b2j0gw0000gn/T/.tmpKPAfq0/bin:test-value") right: Some("test-value/var/folders/yr/yytf3z3n3q336f1tj2b2j0gw0000gn/T/.tmpKPAfq0/bin") ``` After: ``` thread 'layer_env::tests::layer_paths_come_before_manually_added_paths' panicked at libcnb/src/layer_env.rs:944:13: assertion `left == right` failed: For ENV var `PATH` scope `Build` left: Some("/var/folders/yr/yytf3z3n3q336f1tj2b2j0gw0000gn/T/.tmpaCmToR/bin:test-value") right: Some("test-value/var/folders/yr/yytf3z3n3q336f1tj2b2j0gw0000gn/T/.tmpaCmToR/bin") note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```
Co-authored-by: Manuel Fuchs <manuel.fuchs@salesforce.com> Signed-off-by: Richard Schneeman <richard.schneeman+no-recruiters@gmail.com>
Applied all suggestions. Your test seems good. I made a small addition to emit the env var and scope on failure aef08b6. Ready for re-review. |
In #900, I observed that the path of a layer's
./bin
dir (if present) is appended to any explicitly added paths by CNB lifecycle. Libcnb instead prepends the path.This is fixed to match the upstream implementation by changing the order of path evaluation.
Close #900