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

Application build failed #44

Closed
elissa2333 opened this issue Aug 9, 2020 · 6 comments
Closed

Application build failed #44

elissa2333 opened this issue Aug 9, 2020 · 6 comments
Assignees
Labels

Comments

@elissa2333
Copy link

version:
github.com/casbin/gorm-adapter/v3 v3.0.1

log :

exec: "gcc": executable file not found in %PATH%

The build fails under Windows because I have not installed gcc and cannot build qlite3

Rely on explanation go mod why github.com/mattn/go-sqlite3

# github.com/mattn/go-sqlite3
myApp/internal/cas
github.com/casbin/gorm-adapter/v3
gorm.io/driver/sqlite
github.com/mattn/go-sqlite3
@hsluoyz
Copy link
Member

hsluoyz commented Aug 9, 2020

It seems that this PR: 57a0c40 has caused this issue. @L1ghtman2k can you fix it?

@hsluoyz hsluoyz self-assigned this Aug 9, 2020
@hsluoyz hsluoyz added the bug label Aug 9, 2020
@L1ghtman2k
Copy link
Contributor

L1ghtman2k commented Aug 9, 2020

@elissa2333 Have you started getting the above error only recently? In my setup I always had gcc on windows, so I have never encountered that issue. According to https://github.com/mattn/go-sqlite3#installation, the package requires gcc to be installed, since go-sqlite3 is cgo package

You can find the solution for windows here:
According to mattn/go-sqlite3#467

@hsluoyz, I am not sure if this could be labeled as bug, since that is a requirement of a library gorm depends on(Unless there are some workarounds around cgo libraries that doesn't require gcc).

@hsluoyz
Copy link
Member

hsluoyz commented Aug 9, 2020

@L1ghtman2k can we remove the dependency on: https://github.com/mattn/go-sqlite3 ? I know this adapter supports sqlite, but let's not add it to the code directly. Or comment it, people who need it can uncomment to enable the feature.

This is classified as a bug because Casbin is supposed to work on Windows, Linux, macOS without special setup like gcc or cgo. Looking forward to the PR!

@L1ghtman2k L1ghtman2k mentioned this issue Aug 9, 2020
@L1ghtman2k
Copy link
Contributor

L1ghtman2k commented Aug 9, 2020

Oh, got it. My impression was that @elissa2333 was trying to utilize sqlite library, I will make the PR

@elissa2333
Copy link
Author

@elissa2333 Have you started getting the above error only recently? In my setup I always had gcc on windows, so I have never encountered that issue. According to https://github.com/mattn/go-sqlite3#installation, the package requires gcc to be installed, since go-sqlite3 is cgo package

You can find the solution for windows here:
According to mattn/go-sqlite3#467

@hsluoyz, I am not sure if this could be labeled as bug, since that is a requirement of a library gorm depends on(Unless there are some workarounds around cgo libraries that doesn't require gcc).

Thank you for your answer. Encountered an error while upgrading v3. My program only supports MySQL Postgres

@hsluoyz
Copy link
Member

hsluoyz commented Aug 10, 2020

@elissa2333 fixed by commit: 007a8c0

Released v3.0.2: https://github.com/casbin/gorm-adapter/releases/tag/v3.0.2

@hsluoyz hsluoyz closed this as completed Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants