@@ -23,5 +23,18 @@ Cargo uses the `target` directory for storing build artifacts. In our case we ar
...
@@ -23,5 +23,18 @@ Cargo uses the `target` directory for storing build artifacts. In our case we ar
Cargo identifies a build context by a unique hash in order to distinguish cashed compilation units between builds (under different configurations). To that end, we need to determine the current hash to determine the full path of the generated llvm ir (e.g. `target/thumbv7m-none-eabi/release/examples/hello1-f3268774e62977a5.ll`, `f3268774e62977a5` being the hash). While `Cargo` can be accessed as a library, it does not (AFAIK) provide a stable API. A pragmatic solotion is to parse the actual invocation parameters to `rustc` to determine the current hash (as identified by the `extra-filename` option).
Cargo identifies a build context by a unique hash in order to distinguish cashed compilation units between builds (under different configurations). To that end, we need to determine the current hash to determine the full path of the generated llvm ir (e.g. `target/thumbv7m-none-eabi/release/examples/hello1-f3268774e62977a5.ll`, `f3268774e62977a5` being the hash). While `Cargo` can be accessed as a library, it does not (AFAIK) provide a stable API. A pragmatic solotion is to parse the actual invocation parameters to `rustc` to determine the current hash (as identified by the `extra-filename` option).
### Multiple targets
An attempt to analyse multiple targets, e.g.,
> cargo call-stack --examples --release
Will render:
``` text
error: extra arguments to `rustc` can only be passed to one target, consider filtering
the package by passing e.g. `--lib` or `--bin NAME` to specify a single target
```
This is fine Since we are interested in analysing a single application. This error is reported directly by `rustc` (not by the `call-stack` command).