Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# `dagger` - tools for library dependency graph introspection
Dagger contains tools which help developers understand MongoDB's build dependency graph. Currently, this repository contains:

1. query repl for asking various build dependency questions
2. A visualizer for exploring the graph.

## Usage
Do a MongoDB build locally, or via Evergreen on OSX or Linux hosts, and generate the library_dependency_graph.json file (by default the tool will generate this file in the root of your mongo directory or by download via Evergreen)

```
scons dagger
```

In the root of the Dagger tool directory, install the virtualenv

```
make install
```

Activate the virtualenv

```
eval $(make activate)
```

Now the dagger repl is initialized, and we can kick off the visualizer or query repl.

To kick off the query repl:

```
dagger repl /path/to/json/file
```

# Queries

Now your query engine repl is kicked off.

To see all available queries:
```
help
```

To see documentation for a query:
```
help query_name
```


# Examples
Find the explicit direct library dependencies
```
get_explicit_lib_deps build/opt/mongo/transport/libtransport_layer_common.a
```

Find implicit library dependencies
```
get_implicit_lib_deps build/opt/mongo/transport/libtransport_layer_common.a
```

Find the paths from LibA to LibB, or from EXE to LIB

```
get_link_paths build/opt/mongo/mongod build/opt/mongo/unittest/libunittest.a
```
Find the symbol leaks in a library (the symbols that a library implicitly needs but are not satisfied by its explicit direct dependencies)
```
symbol_leaks build/opt/mongo/unittest/libunittest.a
```
1 change: 1 addition & 0 deletions dagger/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.1-pre"
6 changes: 3 additions & 3 deletions dagger/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
import libgiza.error

import dagger.config.cli
import dagger.operations.hello_world
import dagger.operations.version
import dagger.operations.repl
import dagger.operations.viz

logger = logging.getLogger("dagger.cli")

commands = {
"main": [
dagger.operations.hello_world.main,
dagger.operations.version.main,
dagger.operations.viz.main,
dagger.operations.repl.main,
dagger.operations.viz.main
],
}

Expand Down
30 changes: 30 additions & 0 deletions dagger/config/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import sys
import logging

Expand Down Expand Up @@ -52,3 +53,32 @@ def level(self, value):

root_logger.setLevel(levels[value])
self.state['level'] = value

@property
def path(self):
if 'path' in self.state:
return self.state['path']
else:
raise KeyError("Path is not set")

@path.setter
def path(self, value):
if isinstance(value, basestring):
if os.path.isfile(value):
self.state['path'] = value
else:
raise ValueError("Path must be a valid file")
else:
raise TypeError("Path must be a string corresponding to a file name")












Loading