Skip to content

Broken symlinks in lndir build tree

I routinely create separate build trees using lndir (per wiki:WorkingConventions/Git#Creatingabuildtreewithlndir). However it seems this is currently broken by the code to copy fs.{c,h} to various places in ./configure (see D4416):

$ mkdir ghc-validate
$ cd ghc-validate
$ lndir ../ghc
$ ln -s ../ghc/.git
$ ./boot
[...]
$ ./configure
[...]
$ find . -name "fs.*" | xargs file
./rts/fs.c:                    broken symbolic link to ../../../ghc/utils/fs/fs.c
./rts/fs.h:                    broken symbolic link to ../../../ghc/utils/fs/fs.h
./utils/fs/fs.c:               symbolic link to ../../../ghc/utils/fs/fs.c
./utils/fs/fs.h:               symbolic link to ../../../ghc/utils/fs/fs.h
./utils/unlit/fs.c:            symbolic link to ../../../ghc/utils/fs/fs.c
./utils/unlit/fs.h:            symbolic link to ../../../ghc/utils/fs/fs.h
./utils/lndir/fs.c:            symbolic link to ../../../ghc/utils/fs/fs.c
./utils/lndir/fs.h:            symbolic link to ../../../ghc/utils/fs/fs.h
./libraries/base/include/fs.h: broken symbolic link to ../../../ghc/utils/fs/fs.h
./libraries/base/cbits/fs.c:   broken symbolic link to ../../../ghc/utils/fs/fs.c

This can be fixed by manually correcting the symlinks, but it is a bit of pain, especially for ./validate.

ln -fs ../../ghc/utils/fs/fs.c rts/fs.c
ln -fs ../../ghc/utils/fs/fs.h rts/fs.h
ln -fs ../../../../ghc/utils/fs/fs.c libraries/base/include/fs.c
ln -fs ../../../../ghc/utils/fs/fs.h libraries/base/include/fs.h
ln -fs ../../../../ghc/utils/fs/fs.c libraries/base/cbits/fs.c
Trac metadata
Trac field Value
Version 8.5
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Build System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information