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

Getting started new example throws error on M1 chip #49

Closed
sshquack opened this issue Dec 21, 2021 · 4 comments
Closed

Getting started new example throws error on M1 chip #49

sshquack opened this issue Dec 21, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@sshquack
Copy link
Contributor

sshquack commented Dec 21, 2021

I tried the create new example per docs on macOS arm64 and it throws the following error.

Steps to reproduce

❯ craftsman new:example

─────────────────────────────────────── Create an Example Project ────────────────────────────────────────
What would you like to name this project (e.g. MyExampleProject)? Craftsman01
File scaffolding for RecipeManagement was successful.
Database Migrations for RecipeManagement were successful.
TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an
exception.
      In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment
     variable: dlopen(libgit2-106a5f2, 0x0001): tried: 'libgit2-106a5f2' (no such file),
     '/usr/local/lib/libgit2-106a5f2' (no such file), '/usr/lib/libgit2-106a5f2' (no such file),
     '/Users/me/Desktop/code/csharp/libgit2-106a5f2' (no such file),
     '/usr/local/lib/libgit2-106a5f2' (no such file), '/usr/lib/libgit2-106a5f2' (no such file)
       at git_libgit2_init()
       at InitializeNativeLibrary()
       at cctor()
  at git_repository_init_ext(git_repository*& repository, FilePath path, GitRepositoryInitOptions options)
  at git_repository_init_ext(FilePath workdirPath, FilePath gitdirPath, Boolean isBare)
  at Init(String path, Boolean isBare)
  at Init(String path)
  at GitSetup(String solutionDirectory) in Utilities.cs:393
  at CreateNewDomainProject(String domainDirectory, IFileSystem fileSystem, DomainProject domainProject)
     in NewDomainProjectCommand.cs:115
  at Run(String buildSolutionDirectory, IFileSystem fileSystem) in NewExampleCommand.cs:41

Further technical details

Craftsman version (dotnet tool list -g):

❯ dotnet tool list -g
Package Id      Version      Commands
--------------------------------------
craftsman       0.12.3       craftsman
dotnet-ef       6.0.1        dotnet-ef

Environment info

❯ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.101
 Commit:    ef49f6213a

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.1
 OS Platform: Darwin
 RID:         osx.12-arm64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.101/

Host (useful for support):
  Version: 6.0.1
  Commit:  3a25a7f1cc

.NET SDKs installed:
  6.0.101 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

Git version

❯ git --version
git version 2.34.1

Libgit2 info

❯ brew info libgit2
libgit2: stable 1.3.0 (bottled), HEAD
C library of Git core methods that is re-entrant and linkable
https://libgit2.github.com/
/opt/homebrew/Cellar/libgit2/1.3.0 (102 files, 3.5MB) *
  Poured from bottle on 2021-12-21 at 11:05:13
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libgit2.rb
License: GPL-2.0-only
==> Dependencies
Build: cmake ✘, pkg-config ✔
Required: libssh2 ✔
==> Options
--HEAD
        Install HEAD version
==> Analytics
install: 5,007 (30 days), 23,757 (90 days), 60,775 (365 days)
install-on-request: 1,839 (30 days), 12,159 (90 days), 31,213 (365 days)
build-error: 0 (30 days)

I tried this with few different example type (BasicAuth, FK) and they all throw the same error.

@sshquack sshquack added the bug Something isn't working label Dec 21, 2021
@pdevito3
Copy link
Owner

Looks like git2sharp is unhappy. Let me see if this is a .NET 6 this or an apple silicon thing.

@pdevito3
Copy link
Owner

FYI, seems like it's a silicon issue. will investigate.

thanks for the updates here. sorry you ended up being the silicon guinea pig! Wish that was me :-) I do have some coworkers getting M1's soon so that will be some extra bodies keeping me honest there as well.

@sshquack
Copy link
Contributor Author

Oh good to know! Thanks for getting on top of this so quickly. Happy to be the contribute in a small way and make good use of the holidays 😄 Just in the past few months the M1 became more productive for dev. FWIW I've been able to build and run the generated Craftsman solution successfully. So this is not a blocker. I'll be sure to report any other issues as I work through your fantastic docs.

@pdevito3 pdevito3 changed the title Getting started new example throws error Getting started new example throws error on M1 chip Jan 3, 2022
@sshquack
Copy link
Contributor Author

@pdevito3 This now works great on M1. I've added a note on libgit2/libgit2sharp#1932 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants