-
Notifications
You must be signed in to change notification settings - Fork 634
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
DYN-5944 Removed NDesk.Options Library #14106
Conversation
@pinzart90 I've responded to your questions, let me know if you want to discuss further. |
potentially we remove this step for now and resolve in the other ILMerge update task. @JimmySanchezGlobant do local builds work for net48 and net6? Do you see the same errors?
|
@mjkkirschner where are you seeing these errors, which job? Are these failing for .net6 or because of commandlineparser? |
@aparajit-pratap multiple builds - see the PR status checks, probably because of .net6 - but not sure. |
@pinzart90 Solved, it's building correctly, could you please review it again to know if anything is missing to do here? |
":white_check_mark: Bin-Diff Issue Resolved." |
<Exec Condition=" '$([MSBuild]::IsOSPlatform(`Windows`))' == 'True'" Command="if not exist $(SharedOutputPath) mkdir $(SharedOutputPath)" /> | ||
<Exec Condition=" '!$([MSBuild]::IsOSPlatform(`Windows`))' == 'True' " Command="mkdir -p $(SharedOutputPath)" /> | ||
<Exec Condition=" '!$([MSBuild]::IsOSPlatform(`Windows`))' == 'True' " Command="cp $(OutputPath)*.* $(SharedOutputPath)" /> | ||
</Target> | ||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need this to run on net48 too. Please verify if the new way works for net48. If not you will have to bring back the old way with (ilmerge) under the net48 condition.
- Net6 : SelfContained + PublishSingleFile
- net48 - ilmerge (old way)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinzart90 As I told you before, this was built it correctly on .NET 4.8 and also I built it on .NET 6, and there wasn't any error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JimmySanchezGlobant please see the comment above from the bin diff job - the exe is not being produced:
#14106 (comment), so even if there are no errors, something seems off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JimmySanchezGlobant the new flags do not work for net48 target.
You need to use the old way (with ILMerge) for net48
And the new flags + Add a new publish target (the flags work on publish only I think)
ex
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Build;Publish">
But this should be added only under net6 target somehow. Also SelfContained
should be set to false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinzart90 The old way with ILMerge is failing, when I build the project it's returning the error code (missing file), so, it's not clear to me how this can solve this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ILMerge should only work under net48. If you try to build from master it still works right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinzart90 Yes, it's working well under . Net 4.8 from the master branch, it's weird, yesterday I did exactly the same test and it was failing on the ILMerge command, so, I don't know what to do to solve this, to be honest, I'm still very confused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
src/Tools/Md2Html/Md2Html.csproj
Outdated
<PackageReference Include="System.Buffers" Version="4.5.1" /> | ||
<PackageReference Include="System.Memory" Version="4.5.5" /> | ||
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" /> | ||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need direct references to these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these references need to be bundled in a single executable. From what I can tell, these dependencies were needed for net48 (when using ilmerge). I assume they are still needed on net6 (I did not check though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. These are actually transitive dependencies from one of the other packageRefs.
I can remove these
|
@@ -137,6 +137,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoSandbox", "DynamoSand | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssemblyRenamerCLI", "Tools\AssemblyRenamerCLI\AssemblyRenamerCLI.csproj", "{F382C3F8-C55C-4350-800A-3D13A94F8E13}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Md2Html", "Tools\Md2Html\Md2Html.csproj", "{0893F745-CB1A-427A-8E87-CA927273039A}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinzart90 looks like a missing EndProject
tag maybe messing up the build somehow?
|
||
namespace Md2Html | ||
{ | ||
internal class CMDLineOptions | ||
{ | ||
[Option('h', "help", Required = false, HelpText = "Show help and exit")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinzart90 ... two thoughts - I don't see that this PR updates any of the tests. I think that ndesk options and command line parser require setting flags differently... ie /
vs -
or --
, I can't remember for certain.
Have you tried running the docs browser tests locally? Perhaps the markdown converter tool is never shutting down causing some kind of deadlock in the test runner etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjkkirschner good catch, the md2html tests do seem to hang locally. Hopefully it is the same cause on the build machine
options.IgnoreUnknownArguments = true; options.HelpWriter = Console.Out; | ||
options.CaseSensitive = false; | ||
}); | ||
var results = parser.ParseArguments<CMDLineOptions>(args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guess it's also possible that this is somehow messing with Console.Out or modifying the input argument list so it never makes its way to the rest of the Main function?
Please Note:
DynamoRevit
repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after aLGTM
label is added to the PR.Purpose
Remove NDesk.Options library and replace it with CommandLineParser library to unify all CLI programs.
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
(FILL ME IN) Brief description of the fix / enhancement. Mandatory section
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of