Skip to content

Commit d1f394d

Browse files
committed
doc: Update source patching approach
1 parent 8f886d6 commit d1f394d

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

doc/src/architecture.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ This means we always have to write out all dependencies to the lock.
3939

4040
When creating the module cache directory all `*.mod` files have to be patched & all `go.sum` files have to be omitted from the file tree.
4141

42-
While it may be tempting to create a flat symlink structure (like `lndir`) this is not possible because Go doesn't traverse into packages where the directory is a symlink.
43-
So one symlink per input file is created when unpacking the module cache.
44-
45-
This approach causes a downstream knock-on effect which is that Go embed statements don't consider files that are symlinks.
46-
47-
That's why `gobuild.nix` unpacks the module cache using a hybrid approach: create one symlink per source file & copy every non-Go file in full.
42+
To be more efficient this patching happens at _dependency build time_ and is written to the store as a build output.
43+
When the module cache is "unpacked" it's symlinked in a structure which is as flat as possible.
4844

4945
### Deeply nested indirect dependencies
5046

0 commit comments

Comments
 (0)