https://github.com/keddad/sif
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/keddad/sif
- Owner: keddad
- License: mit
- Created: 2022-11-27T14:54:37.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-15T21:09:51.000Z (about 3 years ago)
- Last Synced: 2024-06-21T02:13:25.717Z (about 2 years ago)
- Language: Go
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sif
Golang app which removes unused dependencies in your Bazel projects. For example, say you have dependency graph like this:
```
--- //app:useful_dep_a
/
//app:app --- //app:useful_dep_b --- //app:useless_dep
\- //...
```
Sif can find that //app:useless_dep is redundant dependency in //app:useful_dep_b and remove it, while ensuring that //app:app still compiles. It is done with some smart brtuteforce made fast by Bazel caches. It does parse BUILD files without actual Starlark interpreter, so it can fail to build a full build graph (if your deps are generated using a function, or if there is a weird macro generating a target, or ...), but it is generally quite useful. It is still in development.
Building:
```
go build .
```
Usage example:
```
./sif --workspace test/cppexample --label //main:hello-world --param deps,hdrs --recparams deps --recblacklist someregexp
```
Params:
* --workspace: Path to workspace where targets are, if not current folder
* --label: Label of target to optimize
* --params: Params to optimize. Split with ","
* --check: List of additional targets (tests) to ensure still compile (pass) while optimizing. Split with ","
* -v: Verbose mode
* --recparams: Params to recursivly optimize dependency graph
* --recblacklist: Regexp to filter out unwanted recursive optimization targets