go-flutter-desktop / go-flutter

Flutter on Windows, MacOS and Linux - based on Flutter Embedding, Go and GLFW.
https://hover.build/
BSD 3-Clause "New" or "Revised" License
5.85k stars 283 forks source link

Hover install fails in Conda environment #614

Closed skeledrew closed 3 years ago

skeledrew commented 3 years ago

Installing

$ go version
go version go1.16.6 linux/amd64
$ GO111MODULE=on go get -u -a github.com/go-flutter-desktop/hover
# runtime/cgo
cgo: exec x86_64-conda-linux-gnu-cc: exec: "x86_64-conda-linux-gnu-cc": executable file not found in $PATH
$ which gcc
/usr/bin/gcc

I have installed Go within a Conda environment, and and would like hover to be installed there as well. Conda was installed via the script to $HOME/.conda, dependencies installed with sudo apt install libgl1-mesa-dev xorg-dev and the environment created with conda create -n my_env go.

OS: Kubuntu 20.04 LTS

pchampio commented 3 years ago

https://github.com/hpcng/singularity/issues/5265#issuecomment-621861361

Check the output of which x86_64-conda-linux-gnu-cc - where does it show?

skeledrew commented 3 years ago

That link was very helpful, thanks. A conda install gcc_linux-64 resolved the issue.

Just one other minor thing. I notice hover was installed into $HOME/go/bin/hover instead of path/to/env/bin/hover. Not sure if it's due to how the install was invoked, or if it's just a "Go thing", but it'd be nice if it respected the given environment setup.

provokateurin commented 3 years ago

That is how go works.

skeledrew commented 3 years ago

OK, thanks.

I'm now running into another issue:

$ ~/go/bin/hover run --target lib/main.dart
[...]

💪 Building with sound null safety 💪

hover: Compiling 'go-flutter' and plugins
runtime/cgo
# runtime/cgo
[~]/.conda/envs/flutter_env/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: [~]/.cache/hover/engine/linux-debug_unopt/libflutter_engine.so: undefined reference to `memcpy@GLIBC_2.14'
[~]/.conda/envs/flutter_env/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: [~]/.cache/hover/engine/linux-debug_unopt/libflutter_engine.so: undefined reference to `getauxval@GLIBC_2.16'
[~]/.conda/envs/flutter_env/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: [~]/.cache/hover/engine/linux-debug_unopt/libflutter_engine.so: undefined reference to `clock_gettime@GLIBC_2.17'
collect2: error: ld returned 1 exit status
hover: Go build failed: exit status 2
pchampio commented 3 years ago

Read this section of the hover readme:


Install these dependencies:


This one is important: https://github.com/golang/go/wiki/InstallFromSource#install-c-tools

TLDR: Install with conda GLIBC share lib.