bazel-contrib / bazel-contrib/rules_foreign_cc

Recursive symlink_contents_to_dir is slow

Open
#813 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
737
Forks
270
PR merge metrics
No merged PRs in 30d

Description

In a similar vein to #804, even on Linux the recursive `symlink_contents_to_dir` process can be extremely slow. I'm not sure why it's necessary to recursively symlink dependencies rather than just the top-level dir.

When I compile a program that has a boost dependency using `rules_boost`, it spends nearly 9 minutes on this line in `build_script.sh`:
```
symlink_contents_to_dir $EXT_BUILD_ROOT/external/boost $EXT_BUILD_DEPS/include
```
Because rules_boost [adds its root dir to the include path](https://github.com/nelhage/rules_boost/blob/master/boost/boost.bzl#L88), it's not only symlinking headers but also every source/doc file. But why are we doing this instead of symlinking the top-level dependency directory? (i.e. what #805 proposes but on all platforms)

Contributor guide

Open the contributing guide

Research direction

Start in build_script.sh at the symlink_contents_to_dir call for external/boost and compare it with the behavior discussed in #804 and #805. Determine whether recursive linking is required for this dependency layout; done means the recursive process no longer spends excessive time linking unnecessary source and documentation files.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.