After compiling a project, target/release/deps
has the metadata files for all the dependent crates. I saw there are several directories generated in target/release/build
. I'm confused with what exactly this build
directory does?
For example, for the prorgram exa, the build
directory contains the following directories: 2 exa-some_hash
, 3 libc-some_hash
, 2 libgit2-sys-some_hash
, libz-sys-some_hash
, and log-some_hash
. exa
has about 40 dependent crates. I'm confused that why only these crates related files are generated?
Here is the what cargo tree
gives for exa
:
exa v0.10.1 (/Users/jie/projects/srust/progs/exa)
├── ansi_term v0.12.1
├── datetime v0.5.2
│ ├── libc v0.2.117
│ ├── locale v0.2.2
│ │ └── libc v0.2.117
│ └── pad v0.1.6
│ └── unicode-width v0.1.9
├── git2 v0.13.25
│ ├── bitflags v1.3.2
│ ├── libc v0.2.117
│ ├── libgit2-sys v0.12.26+1.3.0
│ │ ├── libc v0.2.117
│ │ └── libz-sys v1.1.3
│ │ └── libc v0.2.117
│ │ [build-dependencies]
│ │ ├── cc v1.0.72
│ │ │ └── jobserver v0.1.24
│ │ │ └── libc v0.2.117
│ │ └── pkg-config v0.3.24
│ │ [build-dependencies]
│ │ ├── cc v1.0.72 (*)
│ │ └── pkg-config v0.3.24
│ ├── log v0.4.14
│ │ └── cfg-if v1.0.0
│ └── url v2.2.2
│ ├── form_urlencoded v1.0.1
│ │ ├── matches v0.1.9
│ │ └── percent-encoding v2.1.0
│ ├── idna v0.2.3
│ │ ├── matches v0.1.9
│ │ ├── unicode-bidi v0.3.7
│ │ └── unicode-normalization v0.1.19
│ │ └── tinyvec v1.5.1
│ │ └── tinyvec_macros v0.1.0
│ ├── matches v0.1.9
│ └── percent-encoding v2.1.0
├── glob v0.3.0
├── lazy_static v1.4.0
├── libc v0.2.117
├── locale v0.2.2 (*)
├── log v0.4.14 (*)
├── natord v1.0.9
├── num_cpus v1.13.1
│ └── libc v0.2.117
├── number_prefix v0.4.0
├── scoped_threadpool v0.1.9
├── term_grid v0.2.0
│ └── unicode-width v0.1.9
├── terminal_size v0.1.17
│ └── libc v0.2.117
├── unicode-width v0.1.9
├── users v0.11.0
│ ├── libc v0.2.117
│ └── log v0.4.14 (*)
└── zoneinfo_compiled v0.5.1
├── byteorder v1.4.3
└── datetime v0.5.2 (*)
[build-dependencies]
└── datetime v0.5.2 (*)