il-repack icon indicating copy to clipboard operation
il-repack copied to clipboard

Migrate to vanilla 0.10 cecil

Open Alexx999 opened this issue 5 years ago • 30 comments

Here's my take on the topic. In order to use completely vanilla cecil I've moved Win32 resource handling into a separate step that includes minimal PE reader/writer based on cecil implementation.

Alexx999 avatar Aug 31 '18 22:08 Alexx999

When it will be merged? I want to build ILRepack for .NET Core, which allows run ILRepack on Linux without Mono. It requires updated Cecil. @gluck

epeshk avatar Oct 10 '18 00:10 epeshk

@epeshk if you wish you can use avostres.ILRepack package as a stopgap solution - it includes this PR

Alexx999 avatar Oct 11 '18 16:10 Alexx999

But it's so cool to have latest features and improvements in the mainline, right?

epeshk avatar Oct 11 '18 18:10 epeshk

Yup, that's why this pull request exists in the first place :)

Alexx999 avatar Oct 12 '18 18:10 Alexx999

With this PR ILRepack fails if output directory was not created with: System.IO.DirectoryNotFoundException: Could not find a part of the path. at System.IO.FileSystem.MoveFile(String sourceFullPath, String destFullPath) at System.IO.File.Move(String sourceFileName, String destFileName) at ILRepacking.ILRepack.MoveTempFile(String tempFile, String outFile) at ILRepacking.ILRepack.Repack() at ILRepacking.Application.Main(String[] args)

iskiselev avatar Dec 01 '18 03:12 iskiselev

AppVeyor builds are now failing even with Previous 2017 version - there's problem with ProjectFileParser component

Alexx999 avatar Jan 07 '19 10:01 Alexx999

@Alexx999 Great work! 👍 I have a working .netcoreapp 2.1, netstandard2.0, net45 build based of https://github.com/peters/il-repack/tree/netcoreapp2.2 and published at https://www.nuget.org/packages/ILRepack.MSBuild.Task/2.0.0

peters avatar Jan 10 '19 23:01 peters

@Alexx999 Yes, there is a bug that happens with latest VS, there is a fix in progress: https://github.com/Ullink/gradle-msbuild-plugin/pull/105

timotei avatar Jan 13 '19 14:01 timotei

Maybe it's possible to just drop gradle? Looks like it used only for nuspec generation

epeshk avatar Jan 13 '19 15:01 epeshk

A better solution would just to use the new dotnet tooling and drop gradle. I've already done this here: https://github.com/peters/ILRepack.MSBuild.Task/blob/master/build.cmd

Most of the "build system" has been moved to ILRepack.csproj https://github.com/peters/ILRepack.MSBuild.Task/blob/master/src/ILRepack.MSBuild.Task/ILRepack.MSBuild.Task.csproj.

peters avatar Jan 13 '19 19:01 peters

@Alexx999 strongname has this problem https://github.com/peters/ILRepack.MSBuild.Task/issues/37#issuecomment-478199400 , and when cecil 0.11.0 release will supoort linux strongname sign.

caozhiyuan avatar Mar 31 '19 10:03 caozhiyuan

A better solution would just to use the new dotnet tooling and drop gradle. I've already done this here: https://github.com/peters/ILRepack.MSBuild.Task/blob/master/build.cmd

Most of the "build system" has been moved to ILRepack.csproj https://github.com/peters/ILRepack.MSBuild.Task/blob/master/src/ILRepack.MSBuild.Task/ILRepack.MSBuild.Task.csproj.

@peters do you have any plan to make a PR for your change ?

odhanson avatar Apr 03 '19 13:04 odhanson

I'm sorry guys but I'm caught up in work stuff so unfortunately I will not have the time to upstream any of my changes.

peters avatar Apr 03 '19 14:04 peters

@Alexx999 Can you rebase/merge with latest master, so that the build works properly?

timotei avatar May 04 '19 13:05 timotei

@timotei that's done, I've removed all build-related changes from this PR (except for removed submodule init step).

Alexx999 avatar May 05 '19 15:05 Alexx999

@abock would this PR remove the need for https://github.com/xamarin/mirepoix/blob/master/tools/ILRepackPatcher/ILRepackPatcher.cs?

kzu avatar May 28 '19 17:05 kzu

@kzu that tool is very weird - it looks like it patches some ancient ILRepack version with fixes included in newer one (and "newer" is quite old, mind you). It even references commits in comments, see here and here. The last spot patches some Mono.Unix stuff - most likely this isn't fixed here yet. I guess when (if?) this repo goes alive and starts actually accepting PRs quicker than "once in few years" it should be properly migrated to .NET Core. I'd probably do it myself but not before this PR is accepted :)

Alexx999 avatar May 28 '19 20:05 Alexx999

Just to confirm my understanding, will this PR mean that ILRepack supports portable PDB fully on all platforms?

richard-fine avatar May 31 '19 13:05 richard-fine

@richard-fine cecil 0.10 does include support for portable PDBs and it's enabled in this PR

Alexx999 avatar May 31 '19 14:05 Alexx999

@Alexx999 I'm taking a look at this and have found one regression for ikvm'ed dlls and another issue with the memory consumption when we merge 70 dlls. They are both linked here. Otherwise it looks good IMO.

tephe avatar Jun 07 '19 13:06 tephe

There're some problems with breakpoints in asynchronous code when debugging in Visual Studio with portable pdb created by Mono.Cecil 0.10.1. I tried upgrade Mono.Cecil 0.10.4, it seems to be fixed. So, I think Mono.Cecil should be upgraded.

But there're still problems with local variables when debugging.

kkwpsv avatar Jun 20 '19 08:06 kkwpsv

@tephe @kkwpsv I've updated Cecil to 0.11.1

Alexx999 avatar Dec 18 '19 11:12 Alexx999

Dear All,

Can we use ilrepack on Linux if the PR is merged?

JongHeonChoi avatar Mar 09 '20 08:03 JongHeonChoi

@JongHeonChoi, I'm successfully run it on Linux/CoreCLR when I've merged this, #239 and config from #238 (and "rollForward": "Major", if you will run it on 3.x).

iskiselev avatar Mar 09 '20 18:03 iskiselev

@gluck any chance this will ever get accepted? Just wondering :)

Alexx999 avatar May 23 '20 15:05 Alexx999

@Alexx999 I will try looking at it next month and merge it if all is good :) (thanks or the PR btw)

timotei avatar May 23 '20 17:05 timotei

I anxiously await this being merged to add portable pdb support. Currently using a build from this branch to support my current scenario.

Update: I'm able to create the pdb file with this solution but unable to debug with it.

TylerBrinkley avatar Jul 22 '20 14:07 TylerBrinkley

Hello, Will this PR fix #273, or do you reckon it may be a different problem? Thanks, Andrei

Using this branch, when I try to validate assembly (produced with /keyfile:...)with sn -vf, it fails with "Failed to verify assembly -- Strong name validation failed".

iskiselev avatar Dec 24 '20 08:12 iskiselev

@gluck Please, could you merge this pull request? Maybe you need help with maintenance?

mfilippov avatar Feb 09 '22 06:02 mfilippov