Skip to content

hadrian: Always canonicalize topDirectory

Ben Gamari requested to merge wip/T22451 into master

Hadrian's topDirectory is intended to provide an absolute path to the root of the GHC tree. However, if the tree is reached via a symlink this

One question here is whether the canonicalizePath call is expensive enough to warrant caching. In a quick microbenchmark I observed that canonicalizePath "." takes around 10us per call; this seems sufficiently low not to worry.

Alternatively, another approach here would have been to rather move the canonicalization into m4/fp_find_root.m4. This would have avoided repeated canonicalization but sadly path canonicalization is a hard problem in POSIX shell.

Addresses #22451 (closed).

Merge request reports