Replies: 1 comment 1 reply
-
I'm not sure if there's a good, general way to do this at evaluation time besides introspecting the derivation's version? Even if If you want to do this check at build time it's probably much easier since you could run a nightly command and check for errors and bubble up a message to the user that they should be using a nightly toolchain |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
dylint is a neat little tool to create ones own lints. It however has some runtime features which do not jive with how I'd like things to be defined. (Aka, the nix way, reproducibly).
This is a semi-feature request, a call for help/review as well input into developing this. (Or maybe someone already made this, and I didn't find it?)
The way dylint works is:
cargo dylint
Luckily
dylint
is not purely runtime driven when it comes to its inputs, and allows for customizing the source of the lints:https://github.com/trailofbits/dylint/blob/master/docs/how_dylint_works.md#how-libraries-are-found
To quote in the section "How does dylint discover lints":
This should be fairly doable to have as an input, where one takes an array of derivations and renames the output dylibs to the expected format/collects them in a store folder.
One snag is that lints require a nightly compiler, as they need the
rustc_private
feature. I'd have to look into this if there is another way, but given that a lint does use compiler internals,this is probably going to be a requirement.
Is there a way to check whether the toolchain used with crane is unstable? And if so, have the user specify an unstable one explicitely or error out.
Since the lints are not part of the code, this does not influence the 'main' compilation process, but would mean that in most cases two compilers would have to be installed. One for the 'actual' compilation, and another to compile the lints/dylints.
Beta Was this translation helpful? Give feedback.
All reactions