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

[Question][devlake] Setting up a development environment on macOS Sonoma 14.2 #7406

Open
hsol opened this issue Apr 28, 2024 · 5 comments
Open
Labels
type/question This issue is a question

Comments

@hsol
Copy link

hsol commented Apr 28, 2024

Question

  1. About mysqlclient module compatibility(ISO C99 and later do not support implicit function declarations)
    The problem of mysqlclient not being installed during installation of fakeplugin due to a version issue was resolved by using 2.2.x instead of 2.1.1.

  2. Occur panic on go run server/main.go

panic: plugin.Open("bin/plugins/gitextractor/gitextractor.so"): dlopen(/Users/admin/PycharmProjects/incubator-devlake/backend/bin/plugins/gitextractor/gitextractor.so, 0x000A): Library not loaded: @rpath/libgit2.1.3.dylib
  |   Referenced from: <65ABAC48-5208-388B-845A-10DFA9ADD47F> /Users/admin/PycharmProjects/incubator-devlake/backend/bin/plugins/gitextractor/gitextractor.so
  |   Reason: no LC_RPATH's found
Wraps: (2) plugin.Open("bin/plugins/gitextractor/gitextractor.so"): dlopen(/Users/admin/PycharmProjects/incubator-devlake/backend/bin/plugins/gitextractor/gitextractor.so, 0x000A): Library not loaded: @rpath/libgit2.1.3.dylib
  |   Referenced from: <65ABAC48-5208-388B-845A-10DFA9ADD47F> /Users/admin/PycharmProjects/incubator-devlake/backend/bin/plugins/gitextractor/gitextractor.so
  |   Reason: no LC_RPATH's found
Error types: (1) *hintdetail.withDetail (2) *errors.errorString

goroutine 1 [running]:
github.com/apache/incubator-devlake/core/errors.Must(...)
        /Users/admin/PycharmProjects/incubator-devlake/backend/core/errors/util.go:34
github.com/apache/incubator-devlake/server/services.Init()
        /Users/admin/PycharmProjects/incubator-devlake/backend/server/services/init.go:96 +0x38b
github.com/apache/incubator-devlake/server/api.Init(...)
        /Users/admin/PycharmProjects/incubator-devlake/backend/server/api/api.go:58
github.com/apache/incubator-devlake/server/api.CreateAndRunApiServer()
        /Users/admin/PycharmProjects/incubator-devlake/backend/server/api/api.go:70 +0x14
main.main()
        /Users/admin/PycharmProjects/incubator-devlake/backend/server/main.go:33 +0x30
exit status 2
make[1]: *** [run] Error 1
make: *** [dev] Error 2

Screenshots

If applicable, add screenshots to help explain.

Additional context

Add any other context here.
image

Only by resolving this issue will the environment be ready to contribute to devlake.
I will work hard to solve it in my own way. If you can help solve the problem, please comment.

Here's what I did it:

  • Custom install libgit2 correct version on devlake
  • Added LC_RPATH by install_name_tool
@hsol hsol added the type/question This issue is a question label Apr 28, 2024
@abeizn
Copy link
Contributor

abeizn commented Apr 29, 2024

install_name_tool -add_rpath /$path/libgit2/libgit2/build /$path/incubator-devlake/backend/bin/plugins/gitextractor/gitextractor.so

then, go run server/main.go

@klesh
Copy link
Contributor

klesh commented Apr 29, 2024

Hi, I don't understand the 1st problem, and I don't use mac.
But for the libgit2, you may clone the repo https://github.com/libgit2/libgit2, check out the v1.3.2 tag and build the library by following the README.md https://github.com/libgit2/libgit2/tree/v1.3.2?tab=readme-ov-file#building-libgit2---using-cmake

@gustavobini
Copy link
Contributor

I had many issues installing it in macOS that I personally gave up. I went the Docker Compose route using the recently added watch command. I also added a layer to the Dockerfile to execute the tests.

The test database is created with docker compose -f docker-compose-dev.yml up mysql_test and tests can be run with docker build --target test -f backend/Dockerfile ./backend --progress=plain --network=host. For developing, docker compose -f docker-compose-dev.yml watch devlake re-builds as it changes.

The changes files are in this commit and might be outdated.

This might seem a lot of work, but I do not have to install anything on my machine or deal with any incompatibilities.

@klesh @abeizn I recall reading about an item in the roadmap about making it simpler to set up the local environment. Is any work being done in this direction, or are there any ideas?

@hsol
Copy link
Author

hsol commented May 1, 2024

Thanks. I will comment after trying you suggested.

@klesh
Copy link
Contributor

klesh commented May 6, 2024

@gustavobini Not sure, maybe it was about making it simpler for Users? I don't recall any milestone to make Developers' life easier.

However, we did try replacing libgit2 to make things easier for developers with Macs #6615, but it was not very successful due to #7202.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question This issue is a question
Projects
None yet
Development

No branches or pull requests

4 participants