Skip to content

fix: Resolve local import paths relative to containing lazefile#900

Open
dcz-self wants to merge 1 commit into
kaspar030:mainfrom
dcz-self:dbg
Open

fix: Resolve local import paths relative to containing lazefile#900
dcz-self wants to merge 1 commit into
kaspar030:mainfrom
dcz-self:dbg

Conversation

@dcz-self

Copy link
Copy Markdown

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::handle can resolve the import taking it into account.

Before this patch, all local paths were resolved relative to the root lazefile.

Signed-off-by: dcz <gilapfco.dcz@porcupinefactory.org>
@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchdbg
Testbedgithub-actions
Click to view all benchmark results
Benchmarkperf:task-clockBenchmark 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%)
🐰 View full continuous benchmarking report in Bencher

@dcz-self

Copy link
Copy Markdown
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?)?

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.

1 participant