fix: Resolve local import paths relative to containing lazefile#900
Open
dcz-self wants to merge 1 commit into
Open
fix: Resolve local import paths relative to containing lazefile#900dcz-self wants to merge 1 commit into
dcz-self wants to merge 1 commit into
Conversation
Before this patch, all local paths were resolved relative to the root lazefile. Signed-off-by: dcz <gilapfco.dcz@porcupinefactory.org>
Contributor
|
| Branch | dbg |
| Testbed | github-actions |
Click to view all benchmark results
| Benchmark | perf:task-clock | Benchmark Result msec x 1e9 (Result Δ%) | Upper Boundary msec x 1e9 (Limit %) |
|---|---|---|---|
| laze -C RIOT build --global --generate-only | 📈 view plot 🚷 view threshold | 9.26 x 1e9(-1.59%)Baseline: 9.41 x 1e9 | 10.71 x 1e9 (86.50%) |
Author
|
I can see now why the code preferred to use relative paths for links - the tests compare them manually, and I'm guessing it's not desirable to encode the properties of the environment (working directory). I think absolute paths are a lot simpler to reason about, though. What should I do? Force relative paths to stay relative? Redo the tests (but how?)? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this patch, all local paths were resolved relative to the root lazefile. This can break chained lazefile imports.
Try building this: https://codeberg.org/dcz/ariel-tests/commit/121ffdb536ae7b2ed87787ae619b0ee48c78741f
Make sure that ariel-os is in the same directory as ariel-tests.
With old laze, it will just fail with "no such file or directory". If you turn on import symlinks (see commit contents), you will get a hint: laze creates a symlink that leads 1 directory too high: "../../../ariel-os" resolves correctly from "ariel-tests/apps/interrupt_blinky" but not so from "ariel-tests/native".
To fix this, the local import now carries additional info about where it is declared in the file system, so that
Import::handlecan resolve the import taking it into account.