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

dotnet: implement autoPatchcilHook #373107

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

GGG-KILLER
Copy link
Contributor

Adds a new tool called patchcil which aims to be the CIL (.NET's intermediate language) equivalent of patchelf.

Also implements a new hook called autoPatchcilHook which uses the patchcil tool to rewrite all static (read: [DllImport]-based) native library uses to point to the correct location in the nix store.

Finally, rewrites avalonia-ilspy to use autoPatchcilHook as a (rather extreme, as it uses quite a few Xorg libraries, GTK 3 and OpenGL) test case.

cc: @NixOS/dotnet @js6pak @AngryAnt @emilytrau

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@GGG-KILLER GGG-KILLER changed the title Implement autoPatchcilHook dotnet: implement autoPatchcilHook Jan 12, 2025
@github-actions github-actions bot added 8.has: documentation This PR adds or changes documentation 6.topic: dotnet Language: .NET labels Jan 12, 2025
@nix-owners nix-owners bot requested review from emilytrau and AngryAnt January 12, 2025 03:50
@GGG-KILLER
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 373107


x86_64-linux

✅ 92 packages built:
  • ArchiSteamFarm
  • alttpr-opentracker
  • am2rlauncher
  • autoPatchcilHook
  • avalonia-ilspy
  • azure-artifacts-credprovider
  • azure-functions-core-tools
  • bicep
  • blendfarm
  • btcpayserver
  • btcpayserver-altcoins
  • cavalier
  • celeste64
  • certdump
  • clps2c-compiler
  • csharp-ls
  • csharpier
  • csharprepl
  • cyclonedx-cli
  • dafny
  • denaro
  • dependency-track
  • depotdownloader
  • discordchatexporter-cli
  • discordchatexporter-desktop
  • dotnet-ef
  • dotnet-outdated
  • dotnet-repl
  • fable
  • famistudio
  • fantomas
  • formula
  • fsautocomplete
  • galaxy-buds-client
  • garnet
  • gh-gei
  • git-credential-manager
  • github-runner
  • gitversion
  • ilspycmd
  • imewlconverter
  • inklecate
  • jackett
  • jellyfin
  • juniper
  • kavita
  • knossosnet
  • kryptor
  • libation
  • lubelogger
  • lumafly
  • marksman
  • mesen
  • mqttmultimeter
  • msbuild-structured-log-viewer
  • msgraph-cli
  • nbxplorer
  • netcoredbg
  • nexusmods-app
  • nexusmods-app-unfree
  • nixpkgs-manual
  • omnisharp-roslyn
  • opentabletdriver
  • openutau
  • osu-lazer
  • parabolic
  • patchcil
  • pbm
  • pinta
  • ps3-disc-dumper
  • pupdate
  • recyclarr
  • retrospy
  • ryujinx
  • ryujinx-greemdev
  • scarab
  • seq-cli
  • skeditor
  • slskd
  • smtp4dev
  • space-station-14-launcher
  • tagger
  • technitium-dns-server
  • technitium-dns-server-library
  • tone
  • torrentstream
  • upgrade-assistant
  • v2rayn
  • vrcadvert
  • wiseunpacker
  • xivlauncher
  • yafc-ce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant