Giter Club home page Giter Club logo

cargo-no-std-check's Introduction

cargo no-std-check

CI Latest Version

cargo no-std-check is a wrapper for cargo check, which ensures that your library does not link against libstd.

Installation

cargo no-std-check can be built with any stable version of rust, but its operation requires a nightly compiler.

$ cargo install cargo-no-std-check

Usage

Run this command on a crate to build it's lib target without access to std. Attempts to use std in the final library's dependency hierarchy will produce a build error.

Passing Example

$ cargo no-std-check --manifest-path nostd/Cargo.toml
    Creating #![no_std] sysroot
     Copying [============================================================] 154/154: done
     Sysroot x86_64-unknown-linux-gnu (/tmp/nostd_sysroot.YhFkabJ2tXeK)
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s

Failing Example

$ cargo no-std-check --manifest-path withstd/Cargo.toml
    Creating #![no_std] sysroot
     Copying [============================================================] 154/154: done
     Sysroot x86_64-unknown-linux-gnu (/tmp/nostd_sysroot.uYDnxo4ZNOLs)
    Checking withstd v0.1.0 (/crates/withstd)
error[E0463]: can't find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `withstd`.

To learn more, run the command again with --verbose.

cargo-no-std-check's People

Contributors

mystor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cargo-no-std-check's Issues

`--no-default-features` does not work with `--workspace` correctly.

Given a workspace with two packages, both having a default-enabled std feature, cargo no-std-check --no-default-features reports

Checking core2 v0.4.0
error[E0463]: can't find crate for `std`

error[E0463]: can't find crate for `std`
  --> redacted\core2-0.4.0\src\lib.rs:11:9
   |
11 | pub use std::error as error;
   |         ^^^ can't find crate

error[E0463]: can't find crate for `std`
  --> redacted\core2-0.4.0\src\lib.rs:17:9
   |
17 | pub use std::io as io;
   |         ^^^ can't find crate

This might be the same issue as #1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.