Commit 353e85a
authored
fix: make sources' paths absolute (#312)
Cache entries are keyed by absolute path relative to project root, but
it's possible to construct and pass in Sources from a relative path,
such as CLI argument in `forge lint`/`forge eip712`...
In these cases the path will be relative and will always be a cache
miss. This includes the path's imports, which get resolved as relative
to the initial path rather than root now with Solar.
Make all paths in Sources absolute when constructing Graph so that this
change propagates through the entire compilation process.
I couldn't find a reproducer in today's stable/nightly Foundry, however
making `config.solar_project()` use `project()` instead of
`ephemeral_project()` will reproduce the behavior explained above.
With this change, `solar_project` will almost never call to solc.1 parent 0073f15 commit 353e85a
File tree
4 files changed
+19
-10
lines changed- crates
- artifacts/solc/src
- compilers/src
- resolver
4 files changed
+19
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
| |||
169 | 177 | | |
170 | 178 | | |
171 | 179 | | |
172 | | - | |
| 180 | + | |
173 | 181 | | |
174 | 182 | | |
175 | 183 | | |
| |||
178 | 186 | | |
179 | 187 | | |
180 | 188 | | |
181 | | - | |
182 | | - | |
183 | | - | |
| 189 | + | |
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
187 | 193 | | |
188 | | - | |
| 194 | + | |
189 | 195 | | |
190 | 196 | | |
191 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | | - | |
| 619 | + | |
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
403 | 406 | | |
404 | 407 | | |
405 | 408 | | |
| |||
566 | 569 | | |
567 | 570 | | |
568 | 571 | | |
569 | | - | |
| 572 | + | |
570 | 573 | | |
571 | 574 | | |
572 | 575 | | |
573 | | - | |
| 576 | + | |
574 | 577 | | |
575 | 578 | | |
576 | | - | |
| 579 | + | |
577 | 580 | | |
578 | 581 | | |
579 | 582 | | |
| |||
0 commit comments