-
Notifications
You must be signed in to change notification settings - Fork 32
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
Strong naming MedallionShell assembly #65
Comments
Hi @ldennington thanks for your interest in the library! I'll admit that I've never worked with strong naming before (other than tweaking binding redirects) but after reading over some of the MSFT docs on this (e. g. https://github.com/dotnet/runtime/blob/master/docs/project/strong-name-signing.md) it seems like something I'd be happy to have the library support. I'd be inclined to follow MSFT's recommendation for open source and have the private key checked into the library. I've forked other projects before where the build fails due to the key being missing and that is always frustrating. Given my lack of knowledge, if you are willing to take a first crack at this and submit a PR that would be great. The one thing I can think of that might be slightly tricky is that the main MedallionShell assembly embeds the ProcessSignaler assembly inside of it. I'm curious whether you think both should be strong-named or just MedallionShell. If both, then we'll need to make sure that everything happens in the right order during the build (hopefully this will just work). |
Thanks for the super-speedy followup @madelson! I've submitted a PR with these changes here. Let me know if you see any issues, although I think it's pretty straightforward. Also, when you have a moment, would you mind sharing your workflow for packaging these binaries? I'm working on publishing a nuget package locally to validate my changes and want to make sure I'm following the correct series of steps! |
Awesome thanks! I've added some comments/questions. The main simplification I'd hope to see would be avoiding signing the tests and samplecommand assemblies unless we have to for some reason.
All I do is build in release mode which should generate the package on build. Does that work for you? |
Ah yes. Unfortunately, signing only the MedallionShell and MedallionShell.ProcessSignaler assemblies was the first option we tried, as that was our preference too. However, since the MedallionShell.Tests assembly references MedallionShell and needs to access its internal methods, we had to strongly sign it (the build failed before we did so). And, since MedallionShell.Tests also references the SampleCommand assembly, that assembly had to be strongly signed as well before the build would pass. |
Also I'm not seeing any comments unfortunately - is it possible your review was not published? Or am I just overlooking them? |
Sorry I also can't seem to find any comments on the PR itself. As @ldennington mentioned the Tests have to be signed as-is because MedallionShell is using the |
Sorry looks like it is now submitted. Main remaining comment/question is:
EDIT: one more question concerning the release. In some places, where NuGet assemblies are strong-named I know that package authors will keep the assembly version at Major.0.0.0 rather than having it track with the NuGet package version. The idea is that this avoids the need for binding redirects unless you have references to different major versions. The downside is that assembly.version is a bit misleading. See https://codingforsmarties.wordpress.com/2016/01/21/how-to-version-assemblies-destined-for-nuget/. Have you come across this practice? Any thoughts as to whether it is a good idea in this case? |
I agree, so I updated to consolidate on a single MedallionShell.snk file. I don't have a ton of experience with NuGet vs Assembly naming - @kyle-rader can you weigh in on that? |
@ldennington thanks! I'll try to get this merged and published over the weekend. I'm definitely interested in hearing thoughts on the versioning question but that doesn't need to block this from going out. |
Thanks so much @madelson - getting a release this weekend would be super helpful! @kyle-rader gentle ping in case you have thoughts on the above. |
Hi @ldennington . Minor bump in the road. I was reading on https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/breaking-changes that
If I understand correctly, in order to switch this, we'd have to jump to a 2.0 release because we'll break backwards compat with all existing versions. I'm reluctant to do that at this moment. My philosophy is that I strive to keep breaking changes to an absolute minimum because they can be so disruptive to consumers. Therefore, my plan has been for the eventual 2.0 release to take the opportunity of a 2.0 release to revisit the APIs and functionality more broadly, likely bundling several breaking changes together and then hopefully waiting for a very long time before jumping to 3.0. Hopefully this makes sense. However, that doesn't mean we have to hold off on a release here. My thought is that, for the duration of 1.x, I will maintain a strong-name branch in the repo from which I will publish a Hopefully this will still allow you to get what you want out of this? |
Hi @madelson - I'm so sorry for not highlighting this issue; I actually didn't realize strong naming the assembly would break consumers (if it's not obvious already I've been learning as I go through this process too 😀). I think your solution is more than reasonable. I really appreciate your willingness to maintain a separate branch with a strong name variant until you're ready for 2.0, as that will definitely provide what I need. Please let me know if there's anything I can do to be of assistance with the initial strong name release. |
@ldennington new package is out! See https://www.nuget.org/packages/MedallionShell.StrongName/. Thanks again (also @kyle-rader) for contributing :-) |
I've been using MedallionShell to run commands from a new application I'm developing at work, and it's been awesome! However, I'm migrating my project out of its own repo and into my org's main codebase, which means I need all dependencies to be strong-name signed. Would it be possible to do a strong-name signed release of the MedallionShell binaries?
I'm more than happy to contribute this change if that's preferable. Please let me know if this is how you'd like to proceed.
The text was updated successfully, but these errors were encountered: