Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ghuntley opened this issue Nov 22, 2021 · 1 comment

Comments

@ghuntley
Copy link
Member

ghuntley commented Nov 22, 2021

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

@atrauzzi
Copy link

Composer in the PHP ecosystem lets you override files. You can copy and patch an entire class within your codebase.

@ghuntley ghuntley mentioned this issue Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants