8000 Fix auto PATH ordering by schneems · Pull Request #938 · heroku/libcnb.rs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 12 commits into from
May 21, 2025
Merged

Fix auto PATH ordering #938

merged 12 commits into from
May 21, 2025

Conversation

schneems
Copy link
Contributor

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

Missing delimiter strikes again
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
@schneems schneems marked this pull request as ready for review April 29, 2025 14:30
@schneems schneems requested a review from a team as a code owner April 29, 2025 14:30
schneems and others added 3 commits May 13, 2025 18:31
The docs stated that we're appending the layer-bin path. With this change we're now prepending it to align with lifecycle.
@Malax Malax force-pushed the schneems/leeloo-dallas-multi-path branch from 873bf84 to cf6b9f0 Compare May 15, 2025 11:39
Copy link
Member
@Malax Malax left a comment

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.

schneems and others added 2 commits May 16, 2025 12:16
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>
@schneems
Copy link
Contributor Author

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.

@schneems schneems requested a review from Malax May 16, 2025 17:19
@schneems schneems merged commit db2676d into main May 21, 2025
4 checks passed
@schneems schneems deleted the schneems/leeloo-dallas-multi-path branch May 21, 2025 20:02
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

Successfully merging this pull request may close these issues.

Differing behavior between libcnb read_env on a layer and the lifecycle
2 participants
0