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

.netcore single file executable codesign fail on macOS #2811

Closed
snakeeye opened this issue May 30, 2019 · 9 comments
Closed

.netcore single file executable codesign fail on macOS #2811

snakeeye opened this issue May 30, 2019 · 9 comments
Assignees

Comments

@snakeeye
Copy link

snakeeye commented May 30, 2019

Issue Title

netcore single file executable codesign fail on macOS

General

  1. Create a console "Hello world" executable on macOS.
  2. Generate a single file executable followed: https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#single-file-executables
  3. run codesign with this exe.
    You will get error message: main executable failed strict validation
    If you add --no-strict option in codesign, you will get more detailed error messages:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: the __LINKEDIT segment does not cover the end of the file (can't be processed) in: /Volumes/Data/temp/HelloDotNet/bin/Release/netcoreapp3.0/osx.10.12-x64/publish/MacOS/HelloDotNet
/Volumes/Data/temp/HelloDotNet/bin/Release/netcoreapp3.0/osx.10.12-x64/publish/MacOS/HelloDotNet: the codesign_allocate helper tool cannot be found or used
@karelz
Copy link
Member

karelz commented Jun 5, 2019

Looks like you don't have compatible version of xcode ... @wfurt any idea?

@wfurt
Copy link
Member

wfurt commented Jun 5, 2019

not really. I did not experiment with single-file-executables at all.

cc: @safern @wtgodbe

@safern
Copy link
Member

safern commented Jun 5, 2019

I have no idea either. cc: @nguerrera @livarcocc any idea?

@nguerrera
Copy link
Contributor

@swaroop-sridhar

@swaroop-sridhar swaroop-sridhar self-assigned this Jun 5, 2019
@swaroop-sridhar
Copy link

The single-file bundler adds additional contents (the apps's dependencies) at the end of the host-binary. Looks like this is triggering an internal validation (__LINKEDIT doesn't cover EOF) when running codesign.
I'll investigate further.

Related issue: https://github.com/dotnet/core-setup/issues/6518

@MoonStorm
Copy link

It fails on windows too. I get an error saying it's looking for the main app's dll. Same setup though with unsigned files works fine.

@swaroop-sridhar
Copy link

@MoonStorm the fix for Windows version is in this PR:
dotnet/core-setup#6885

@MoonStorm
Copy link

@MoonStorm the fix for Windows version is in this PR:
dotnet/core-setup#6885

Thanks, hopefully that will make it in the next preview (7)?

@swaroop-sridhar
Copy link

The Windows fix will be in Preview 7. I opened https://github.com/dotnet/core-setup/issues/7065 to track the MAC signing issue (better tracked in the core-setup repo).

Hence closing this issue.

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

No branches or pull requests

7 participants