Giter Site home page Giter Site logo

cargo-5730's People

Contributors

mullr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

marysaka

cargo-5730's Issues

New strategy prevents locking deps with Cargo.lock

To avoid having random build failures, I pin all my dependencies with Cargo.lock. In the old versions of cargo-5730 (before 38b0405) I could simply run cargo update in the folder containing the build script crate, and it would generate a Cargo.lock that would get used when building/running the build script. But with the new strategy, there isn't a separate Cargo.toml, and so we can't have a lockfile pinning the build dependencies.

This recently bit me when a build-dependency accidentally published a breaking change, making my builds fail. IMO, cargo-5730 should have an utility to generate a Cargo.workaround.lock or something along those lines.

Can't cargo publish

Attempting to cargo publish a library crate that uses this workaround fails:

$ cargo build                                                                                                                          warning: unused manifest key: workaround-build-dependencies
    Finished dev [unoptimized + debuginfo] target(s) in 0.57s
$ cargo publish 
    Updating crates.io index
   Packaging my-lib-crate v0.1.7 (/c/Users/User/Documents/my-lib-crate)
   Verifying my-lib-crate v0.1.7 (/c/Users/User/Documents/my-lib-crate)
   Compiling cargo-5730 v0.2.1
   Compiling my-lib-crate v0.1.7 (/c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7)
error: failed to verify package tarball                                                                                                
Caused by:
  failed to run custom build command for `my-lib-crate v0.1.7 (/c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7)`

Caused by:
  process didn't exit successfully: `/c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7/target/debug/build/my-lib-crate-a7d79ce11b1f43d2/build-script-build` (exit code: 101)
--- stdout
Removing build crate staging dir: /tmp/build-script-599a12d2d076132272c3cd239122d9

--- stderr
   Compiling workaround-build-script v0.1.0 (/tmp/build-script-599a12d2d076132272c3cd239122d9)
     Running `CARGO_PKG_VERSION_PATCH=0 CARGO=/home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo CARGO_PKG_VERSION=0.1.0 CARGO_PKG_HOMEPAGE= CARGO_PKG_NAME=workaround-build-script CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_AUTHORS='The cargo-5730 crate' CARGO_PKG_VERSION_PRE= LD_LIBRARY_PATH='/c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7/build-script-target/debug/deps:/home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib' CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_DESCRIPTION= CARGO_MANIFEST_DIR=/tmp/build-script-599a12d2d076132272c3cd239122d9 CARGO_PKG_REPOSITORY= rustc --edition=2018 --crate-name workaround_build_script src/main.rs --color never --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=ed61adb261da6fa8 -C extra-filename=-ed61adb261da6fa8 --out-dir /c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7/build-script-target/debug/deps -C incremental=/c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7/build-script-target/debug/incremental -L dependency=/c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7/build-script-target/debug/deps --cfg workaround_build`
error[E0433]: failed to resolve: use of undeclared type or module `bindgen`
  --> src/main.rs:21:20
   |
21 |     let bindings = bindgen::Builder::default()
   |                    ^^^^^^^ use of undeclared type or module `bindgen`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0433`.
error: Could not compile `workaround-build-script`.

Caused by:
  process didn't exit successfully: `CARGO_PKG_VERSION_PATCH=0 CARGO=/home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo CARGO_PKG_VERSION=0.1.0 CARGO_PKG_HOMEPAGE= CARGO_PKG_NAME=workaround-build-script CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_AUTHORS='The cargo-5730 crate' CARGO_PKG_VERSION_PRE= LD_LIBRARY_PATH='/c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7/build-script-target/debug/deps:/home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib' CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_DESCRIPTION= CARGO_MANIFEST_DIR=/tmp/build-script-599a12d2d076132272c3cd239122d9 CARGO_PKG_REPOSITORY= rustc --edition=2018 --crate-name workaround_build_script src/main.rs --color never --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=ed61adb261da6fa8 -C extra-filename=-ed61adb261da6fa8 --out-dir /c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7/build-script-target/debug/deps -C incremental=/c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7/build-script-target/debug/incremental -L dependency=/c/Users/User/Documents/my-lib-crate/target/package/my-lib-crate-0.1.7/build-script-target/debug/deps --cfg workaround_build` (exit code: 1)
thread 'main' panicked at 'Failed to run compile build crate at /tmp/build-script-599a12d2d076132272c3cd239122d9 with Output {
    status: ExitStatus(
        ExitStatus(
            25856,
        ),
    ),
    stdout: "",
    stderr: "",
}', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-5730-0.2.1/src/lib.rs:102:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

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.