Comments (5)
This task could be made easier with #118, given that --message-format=json
happens to include a list of filenames (in this case, .rmeta
artifacts when using cargo check
) belonging to the current crate. We could leverage this flag to glean what artifacts need to be copied in the Nix store on cargo check
or cargo clippy
.
Note that the .d
files aren't listed with --message-format=json
, and deleting them doesn't seem to invalidate the cache of cargo check
nor affect the final result, indicating that they are probably safe to ignore.
from cargo2nix.
I think this feature would require a sizeable refactor of overlay/mkcrate.nix
because cargo check
is so different from cargo {build,test}
. In the latter, we only care about .{rlib,a,so,dylib}
files, while in the former we apparently only care about .rmeta
files. This means that we can't reuse the linking logic in overlay/utils.sh
; we'll need to write it nearly from scratch specifically for cargo check
.
AFAIK, we can't wrap rustc
and use command-line flags to point to Nix store paths of .rmeta
files, so we may need to instead create a target/deps
directory, symlink-farm all the dependencies' .rmeta
files into it, and then pick out all the non-symlink files created and copy them to $out
somewhere. This is so radically different from the other two compile modes, in fact, that I'm not sure how to approach this task without turning mkcrate.nix
into a tangled mess.
from cargo2nix.
I ran the check --release
on RustAnalyzer. Significantly more diverse outputs in the artifacts than just .d
and .rmeta
Aside, since rust check doesn't need to link or emit binary, is it even benefiting from cargo2nix's native deps? I would like to constrain the role so that cargo2nix is doing maximum utility but with only strictly necessary second-system overhead
from cargo2nix.
@psionic-k It depends on the particular crate. If a crate provides a build.rs
that performs codegen, it might run at cargo check
time. As such, we have to be prepared for the possibility that the build.rs
might call out to a native dep at any time, even during cargo check
. Apparently, there is a desire upstream to indicate to build scripts whether a crate is "building" or "checking" and adjust the work done as a result, but this doesn't seem to have landed yet (rust-lang/cargo#4001).
from cargo2nix.
See reasoning in #92 for not blocking, but also not pursuing more support for non-output Nix derivations
from cargo2nix.
Related Issues (20)
- `pam-sys` crate won't build; ENOENT on `#include <security/pam_appl.h>` HOT 16
- Having same revision of git dependency with and without `tag` leads to invalid `Cargo.nix`
- env var at build time. Cant get it to work HOT 2
- Outdated lock file when workspace level dependencies HOT 8
- Can `cargo2nix` run `-Zbuild-std` cross-compiling for embedded targets? HOT 3
- reducePackageToml removes mandatory build dependency
- Clarify branches HOT 2
- Building rust-ocaml-starter error: none of the selected packages contains these features: cc, dune HOT 1
- Make it possible to generate Cargo.nix on the fly HOT 3
- nix develop && cargo build fails HOT 4
- Cargo.nix generation via cargo2nix is incredibly slow HOT 5
- Is there a way to use Fenix with Cargo2Nix HOT 2
- Cargo2Nix in workspace shell HOT 7
- Breaks on complex workspaces when fetched from git HOT 3
- using `rustToolchain` variable for creating workspace HOT 2
- Could not find `parity-scale-codec` in `dependencies` or `dev-dependencies` in `/build/scale-info-2.10.0/Cargo.toml` HOT 3
- Issues with cross-compilation `aarch64-darwin` -> `aarch64-linux`
- Wrong platform triplet for x86_64-pc-windows-gnu(x86_64-w64-mingw32) HOT 2
- Can't build gtk project HOT 2
- Proposal for 0.12.0 release HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo2nix.