Skip to content

Add RuntimeIdentifiers to each project. #214

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

Merged
merged 12 commits into from
Apr 6, 2021
Merged

Conversation

scovetta
Copy link
Member

This PR adds RuntimeIdentifiers to each project to enable self-contained cross-project publishing.

From here:

--self-contained [true|false]

Publishes the .NET runtime with your application so the runtime doesn't need to be installed on the target machine. Default is true if a runtime identifier is specified and the project is an executable project (not a library project). For more information, see .NET application publishing and Publish .NET apps with the .NET CLI.

More information in dotnet/sdk#10902.

This should fix #213.

@scovetta scovetta requested a review from gfs March 23, 2021 20:03
Copy link
Contributor

@gfs gfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but @daalcant should confirm that this will cause the pipeline to publish correctly.

@daalcant
Copy link
Contributor

@scovetta @gfs I'm not sure why #213 is broken, but adding a runtime identifier via project properties shouldn't be necessary. We are using dotnet publish with a runtime identifier switch already (-r) which implies the application will be self-contained. I tested this back when I built the pipelines, but maybe things have changed since then. I'll look into this further.

@daalcant
Copy link
Contributor

Documentation just for peace-of-mind: https://docs.microsoft.com/en-us/dotnet/core/deploying/

@gfs
Copy link
Contributor

gfs commented Mar 24, 2021

The problem is that the publish command is missing these flags -p:PublishSingleFile=true --self-contained true see #217. Should probably close this PR and open one that resolves that issue.

@gfs
Copy link
Contributor

gfs commented Mar 24, 2021

Closed. See #218 instead.

@gfs gfs closed this Mar 24, 2021
@daalcant
Copy link
Contributor

Reopening and converting to draft mode. Will attempt to resolve this and any remaining publishing issues in one PR to reduce the number of times I need to test release artifacts.

@daalcant daalcant reopened this Mar 30, 2021
@daalcant daalcant marked this pull request as draft March 30, 2021 17:32
@daalcant
Copy link
Contributor

daalcant commented Apr 6, 2021

Publishing using the PublishSingleFile property is increasing the total unpacked size of a release by 4.5-5x (from ~100 MB to ~500 MB). I believe this is because the .NET runtime is again being bundled with each project built by the solution. I have removed this property for the time being and we can reconsider it in the future (perhaps with a revised project structure).

Leaving this PR in draft mode for a bit longer so I can test the binaries and resolve a couple more issues re: code signing and maintaining Linux file permissions.

@daalcant
Copy link
Contributor

daalcant commented Apr 6, 2021

Everything should be set here. I won't be able to completely validate the fixes until the sign/release job is run, but prelim tests were a success. Letting checks complete then merging. If any issues arise with the release process then I'll troubleshoot them in the morning.

Fix #213 #215 #216

@daalcant daalcant marked this pull request as ready for review April 6, 2021 03:35
@daalcant daalcant merged commit e5c01d1 into main Apr 6, 2021
@daalcant daalcant deleted the miscovet/fix-self-contained branch April 6, 2021 18:35
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

Successfully merging this pull request may close these issues.

OSS Gadget Linux Releases aren't chmod'd properly Update which binaries are signed to be current Recent OSS Gadget doesn't work on Linux
3 participants