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

Publish update-deps with rid #2111

Merged
merged 1 commit into from
Jul 21, 2020
Merged

Publish update-deps with rid #2111

merged 1 commit into from
Jul 21, 2020

Conversation

mthalman
Copy link
Member

The following exception occurs when update-dependencies attempts to update an existing PR:

System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'git2-106a5f2' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-106a5f2: cannot open shared object file: No such file or directory
   at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
   at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary()
   at LibGit2Sharp.Core.NativeMethods..cctor()
   --- End of inner exception stack trace ---
   at LibGit2Sharp.Core.NativeMethods.git_clone(git_repository*& repo, String origin_url, FilePath workdir_path, GitCloneOptions& opts)
   at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts)
   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)
   at Dotnet.Docker.Program.UpdateExistingPullRequest(GitHubAuth gitHubAuth, PullRequestOptions prOptions, String commitMessage, GitHubBranch upstreamBranch) in /update-dependencies/Program.cs:line 188
   at Dotnet.Docker.Program.CreatePullRequestAsync() in /update-dependencies/Program.cs:line 155
   at Dotnet.Docker.Program.Main(String[] args) in /update-dependencies/Program.cs:line 53

This issue is described in libgit2/libgit2sharp#1798. The workaround is to publish with the specific RID which provides the correct library. I also took this opportunity to update the Dockerfile to be based on Alpine which simplifies the content and produces a smaller image size.

There was also an issue with the update-dependencies logic where it would end up excluding all directories starting with . when copying the repo. This resulted in the exclusion of the .github folder which would end up deleting the files in that folder as part of the PR update.

Fixes #1898

@mthalman mthalman requested a review from MichaelSimons July 21, 2020 17:54
@mthalman mthalman merged commit 2f53345 into dotnet:nightly Jul 21, 2020
@mthalman mthalman deleted the issue1898 branch July 21, 2020 21:05
mthalman added a commit to mthalman/dotnet-docker that referenced this pull request Jul 22, 2020
MichaelSimons pushed a commit to MichaelSimons/dotnet-docker that referenced this pull request Jul 23, 2020
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.

2 participants