gluck / il-repack

Open-source alternative to ILMerge
Apache License 2.0
1.18k stars 217 forks source link

Cecil update to 0.11.4 #316

Closed BSimonSweet closed 10 months ago

BSimonSweet commented 1 year ago

Updated Mono.Cecil to 0.11.4 and dropped the custom fork. I needed support for PortablePdbReader/Writer.

I removed code related to "Win32ResourceDirectory" in ILRepack.cs, as it seems to be supported by Cecil now, but I'm not sure about this one ... If this is still needed, I'll be glad to get some help on that !

mattleibow commented 1 year ago

This PR looks like it does nice things...

timotei commented 1 year ago

Will check it next week 👍

mattleibow commented 1 year ago

@BSimonSweet this PR is a few months old, but CI is still failing a bit. If you rebase does it fix it? The error appears to be that some dll is still in use:

INFO: IL Repack - Version 2.1.0
INFO: ------------- IL Repack Arguments -------------
/out:C:\Users\appveyor\AppData\Local\Temp\1\4hkxnrkb.4xz\test.dll  C:\Users\appveyor\AppData\Local\Temp\1\4hkxnrkb.4xz\foo.dll
-----------------------------------------------
INFO: Adding assembly for merge: C:\Users\appveyor\AppData\Local\Temp\1\4hkxnrkb.4xz\foo.dll
INFO: Processing references
INFO: Processing types
INFO: Merging <Module>
INFO: Processing exported types
INFO: Processing resources
INFO: Fixing references
INFO: Writing output assembly to disk
INFO: Finished in 00:00:02.1684196
System.IO.IOException: The process cannot access the file 'foo.dll' because it is being used by another process.
   at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
   at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
   at ILRepack.IntegrationTests.NuGet.TestHelpers.CleanupTempFolder(String& tempDirectory)
   at ILRepack.IntegrationTests.NuGet.RepackNuGetTests.CleanupTempFolder()
BSimonSweet commented 1 year ago

Hi ! Yes I'm aware of this issue in CI, but I had to workaround that and just ignore it as I needed ILRepack to compile asap ... I didn't had time to look at that again.

I'll fix that as soon as I have time.

mattleibow commented 1 year ago

I also added a commit here that you can take to reduce the whitespace changes if the lib authors want less of that: https://github.com/BSimonSweet/il-repack/pull/1/commits/b1d6e3d2312abe30ae6fcccbc10c1f2d37b84d86

No code, just removed what appears to be the alignment of the = as well as the correct indentation.

mattleibow commented 1 year ago

I managed to fi the lock issue and also added some symbol copying in my fork: https://github.com/mattleibow/il-repack

Mono.Cecil also can load and save all the symbol types, so I just let it do its thing and it loads the portable and saves as portable just fine. It just saves using the "technology" used to load.

deniszykov commented 1 year ago

It's great that you made Github Actions scripts for build. It is 2023 way to build stuff.

KirillOsenkov commented 10 months ago

Hi @BSimonSweet thanks a lot for the contribution and sorry it took so long. I just became a maintainer recently and we've updated to the latest Cecil submodule in the master branch. We can't just drop the Win32Resources logic because it would break compatibility for many users. Also the submodule contains more than just that, so we can't switch to the Cecil NuGet package yet. But at least we now have the latest Cecil and support for native, portable and embedded PDBs.