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

Unhandled exception is thrown when using in a Github pipeline #24

Closed
cdavernas opened this issue Mar 21, 2022 · 4 comments
Closed

Unhandled exception is thrown when using in a Github pipeline #24

cdavernas opened this issue Mar 21, 2022 · 4 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@cdavernas
Copy link

Describe the bug
Unhandled exception is thrown when running a Github pipeline with Versioning.NET

Unhandled exception. 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

To Reproduce
Steps to reproduce the behavior:

  1. Got to Github
  2. Create a new pipeline
  3. Try running Versioning.NET on your project, as described in the wiki

Expected behavior
Everything should work correctly, and new version is computed as expected

Additional information

The pipeline that fails:

name: CI

on:

  push:
    branches: [ main ]
    
  pull_request:
    branches: [ main ]
    
  workflow_dispatch:
  
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Configure remote repository
        run: |
          apt-get update
          apt-get install -y libgit2-dev
          git remote set-url origin "https://username:[email protected]/myrepo/repo.git"
          dotnet tool install --global Versioning.NET
          dotnet-version increment-version-with-git -g "." --branch-name main --author-email [email protected]
@cbcrouse
Copy link
Owner

Hi @cdavernas, thanks for submitting this issue. Unfortunately, I don't have time to work on this until next week, but I believe that you can change your agent specification from ubuntu-latest to a lower version of ubuntu or use windows-latest as a temporary work around. Let me know if this helps or if changing the agent specification is not possible for you.

@cbcrouse cbcrouse self-assigned this Mar 22, 2022
@cbcrouse cbcrouse added the bug Something isn't working label Mar 22, 2022
@cdavernas
Copy link
Author

@cbcrouse Thanks for the quick answer and heads off! I'm gonna try out your suggestions tomorrow and will let you know how that worked out!

@cdavernas
Copy link
Author

cdavernas commented Apr 15, 2022

@cbcrouse The exception indeed disappears when using windows-latest! Sorry for not coming back to you earlier, it was a crazy month. Cheers!

@cbcrouse
Copy link
Owner

Hey @cdavernas, it turns out that LibGit2Sharp outputs a runtimes folder where the supported native binaries are copied. When considering an agent runtime, it'll have to come from this list:

image
image

There's nothing I can do in this project to make-up for this, so I'm closing this issue.
You can read more about this on their GitHub page.

@cbcrouse cbcrouse added wontfix This will not be worked on and removed bug Something isn't working labels Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants