Skip to content

Instantly make and keep fixes to .NET dependencies from an IDE (everything, including the runtime itself) #25

@ghuntley

Description

@ghuntley

overview

Why can't consumers of open-source libraries instantly from their tooling make and keep fixes to open-source dependencies. Being able to patch is a vital band-aid for those of us living on the bleeding edge or anyone who consumes open-source software (ie the entire .NET ecosystem)

In the JavaScript ecosystem there exists patch-package:

https://www.npmjs.com/package/patch-package

# fix a bug in one of your dependencies
vim node_modules/some-package/brokenFile.js

# run patch-package to create a .patch file
npx patch-package some-package

# commit the patch file to share the fix with your team
git add patches/some-package+3.14.15.patch
git commit -m "fix brokenFile.js in some-package"

Patches created by patch-package are automatically and gracefully applied when you use npm or yarn. No more waiting around for pull requests to be merged and published. No more forking repos just to fix that one tiny thing preventing your app from working. No more harassing open-source maintainers to merge pull-requests or support legacy scenarios. By providing the correct tooling consumers of open-source software are empowered to make changes and are in more control of their software supply chain.

In the nix ecosystem this is achieved using Overlays which can pull from git, a tarball, local filesystem, etc.

self: super:
{
  sl = super.sl.overrideAttrs (old: {
    src = super.fetchFromGitHub {
      owner = "open-dotnet";
      repo = "roslyn";
      rev = "923e7d7ebc5c1f009755bdeb789ac25658ccce03";
      # If you don't know the hash, the first time, set:
      # sha256 = "0000000000000000000000000000000000000000000000000000";
      # then nix will fail the build with such an error message:
      # hash mismatch in fixed-output derivation '/nix/store/m1ga09c0z1a6n7rj8ky3s31dpgalsn0n-source':
      # wanted: sha256:0000000000000000000000000000000000000000000000000000
      # got:    sha256:173gxk0ymiw94glyjzjizp8bv8g72gwkjhacigd1an09jshdrjb4
      sha256 = "173gxk0ymiw94glyjzjizp8bv8g72gwkjhacigd1an09jshdrjb4";
    };
  });
}

additional reading

considerations

  • .NET RIDs and topics of cross-platform compilation

related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions