Giter Site home page Giter Site logo

hgomersall / vergen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rustyhorde/vergen

1.0 0.0 0.0 700 KB

Generate cargo instructions at compile time in build scripts for use with the env! or option_env! macros

License: Apache License 2.0

Shell 0.91% Rust 99.09%

vergen's Introduction

vergen - Emit cargo instructions from a build script

vergen, when used in conjunction with cargo build scripts can emit the following:

Current Release

docs.rs Crates.io Crates.io Crates.io codecov CI sponsor

Sponsors

Special thanks to the sponsors of this project

⚠️ This documention is for version 8 ⚠️

If you wish to refer to version 7 you can find that branch here

MSRV

The current minimum supported rust version is 1.70.0

Example Usage

See the documentation at docs.rs for example usage

Notes about the optional git2 dependency

This update to git2 picked up some security related features. In docker environments especially, this requires a safe.directory configuration. There are a couple methods for achieving this.

  1. If you control the build, you can add git config --global --add safe.directory /workspace to the build file.
  2. If you do not control the docker build, you can add git config --global --add safe.directory /workspace && before the actual command you are running when using docker run.
  3. If you do not control the docker build, you can mount a .gitconfig file at /root that includes the safe.directory configuration. I use this method myself when building static binaries with clux/muslrust.

docker run -v cargo-cache:/root/.cargo/registry -v (pwd):/volume -v ~/.gitconfig:/root/.gitconfig:ro --rm -t clux/muslrust:stable cargo build --release

See rustyhorde#126 for more discussion on the topic. If the solutions above do not work for your usecase, you can pin your vergen version to 7.4.3, with the caveat you will be exposed to the issues described at the link above.

Contributing

See the documentation at CONTRIBUTING.md

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

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.