Code Monkey home page Code Monkey logo

diener's Introduction

diener - dependency diener is a tool for easily changing Substrate or Polkadot dependency versions

Usage

You can find the full documentation on docs.rs.

Update

The update subcommand changes all Cargo.toml files in a given folder to use a specific branch/path/commit/tag.

Change all Substrate dependencies in a folder to a different branch:

diener update --substrate --branch diener-branch

Or you want to change Polkadot and Substrate dependencies to the same branch:

diener update --branch diener-branch-2

Diener also supports tag and rev as arguments.

If a dependency is belongs to Substrate or Polkadot is currently done by looking at the git url. It also only works for repos called substrate or polkadot.

Patch

The patch subcommand adds a patch section for each crate in a given cargo workspace to the workspace Cargo.toml file in some other cargo workspace.

Patch all Substrate git dependencies to be build from a given path:

diener patch --crates-to-patch ../path/to/substrate/checkout --substrate

This subcommand can be compared to .cargo/config without using a deprecated feature of Cargo ;)

License

Licensed under either of

at your option.

License: Apache-2.0/MIT

diener's People

Contributors

apopiak avatar athei avatar bkchr avatar chevdor avatar coderobe avatar dependabot[bot] avatar felixonmars avatar ggwpez avatar gilescope avatar liuchengxu avatar s3krit avatar sergejparity avatar vyorkin 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

diener's Issues

Optionally make path patches relative to the patched directory

Problem: Given the following folder structure

project
└── project2

If I want to patch project2 into project, the command would be

diener patch --target something --crates-to-patch project/project2 --path project/Cargo.toml

The problem is that references to project2 end up as absolute paths rather than the relative path from project, i.e. { path = "/full/path/to/project2" } rather than { path = "project2" } (relative path)

The example of nested directories might be a bit unintuitive but this could also be desirable for use-cases where repositories are positioned relative to each other, for instance both projects within the same folder.

folder
├── project
└── project2

Motivation: sometimes it's necessary to transfer projects to a different host after patching, so absolute paths stop working after the transfer unless they can be recreated exactly as they were before the transfer. In those cases it's preferrable to have relative paths as it's easier to make them work that way in the new host.

Solution: introduce an option to make path patches relative to the patched directory, e.g.

diener --target something --relative-crates-to-patch --crates-to-patch project/project2 --path project/Cargo.toml

Easier or better deps to consider using?

https://rustacean-station.org/episode/rust-1.62-1.63-1.64/ talks about cargo-add being included in cargo itself now, and it's deps that might be relevant to this repo:

So this issue is more of a question: can these tools help make dealing with modifying Cargo files in diener easier/better?

feature request: --all flag on patch

If I point diener at a particular cumulus then whatever version of polkadot that that cumulus is pointing to must be also patched / updated to. And that polkadot is referring to a version of substrate so that also needs to be patched / updated to. ( The point is by doing diener patch --crates-to-patch ../cumulus --cumulus for example there's no choice in which polkadot or substrate version to use, it must be whatever polkadot and substrate branch/path that ../cumulus is pointing to)

This would make diener a joy to use and would remove the tedium of running the command 2 - 3 times with different arguments.

(feel free to bikeshed the flag name...)

Support for updating/patching cumulus crates

Hey @bkchr! This is a super-convenient tool for updating Substrate, Polkadot and Beefy dependencies, thanks for sharing it. The only addition that I believe would make it perfect for my use case is the Cumulus support. Have you considered adding the updaing/patching functionality for cumulus crates? Would you review the PR if I try to implement this? Thank you

diener doesn't find all crates in a repository

As corroborated by https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/1577990#L521 and reproducible by the steps of paritytech/pipeline-scripts#45 (comment), diener doesn't patch all crates in a repository.

As an example polkadot-node-core-pfv (https://github.com/paritytech/polkadot/blob/f8b668b7540eaac106765a978c17af533d261f8e/node/core/pvf/Cargo.toml) for which there was no Adding patch for polkadot-node-core-pfv log line in the GitLab job and it also doesn't show up in the patch entries as demonstrated by the diff of paritytech/pipeline-scripts#45 (comment). Outdated, see #15 (comment).

From cursory look at the code I think this is where the crates are detected, but I haven't dug deeper into that to know the cause of why some crates are missed.

https://github.com/bkchr/diener/blob/69ab0f76fb851968af8e493061cca84a2f3b1c5b/src/patch.rs#L236-L255

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.