objectbox / objectbox-go

Embedded Go Database, the fast alternative to SQLite, gorm, etc.
https://objectbox.io
Apache License 2.0
1.07k stars 46 forks source link

Installation fails under WSL2 #37

Closed maracko closed 2 years ago

maracko commented 2 years ago

Description

Installation fails

Basic info

Please complete the following information:

How to reproduce

Run installation script

Expected behavior

Objectbox installed

Code

bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-go/main/install.sh) --sync

Logs, stack traces

Base config: OS Linux and architecture x86_64
Using configuration sync-linux-x64
Resolved URL: https://github.com/objectbox/objectbox-c/releases/download/v0.15.0/objectbox-sync-linux-x64.tar.gz
Downloading ObjectBox library version v0.15.0 for sync-linux-x64...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   670  100   670    0     0   1013      0 --:--:-- --:--:-- --:--:--  1013
100 1455k  100 1455k    0     0   586k      0  0:00:02  0:00:02 --:--:--  823k
Downloaded:
1.5M    download/objectbox-0.15.0-sync-linux-x64.tar.gz

Extracting into download/objectbox-0.15.0-sync-linux-x64...
Copied to /home/mario/go/src/github.com/objectbox/objectbox-go/objectboxlib/lib:
total 3448
-rwxr-xr-x 1 mario mario 3530328 Jan  9 13:26 libobjectbox.so
OK. Do you want to install the library into /usr/lib? [Y/n] y
Installing /usr/lib/libobjectbox.so
Installed objectbox libraries:
        libobjectbox.so (libc6,x86-64) => /usr/lib/libobjectbox.so
/home/mario/go/src/github.com/objectbox/objectbox-go
Your project doesn't seem to be using go modules. Installing FlatBuffers & ObjectBox using go get.
y
# github.com/objectbox/objectbox-go/objectbox
/usr/bin/ld: $WORK/b001/_x012.o: in function `_cgo_1d5082261c69_Cfunc_obx_txn_mark_success':
/tmp/go-build/cgo-gcc-prolog:134: undefined reference to `obx_txn_mark_success'
collect2: error: ld returned 1 exit status
vaind commented 2 years ago

This issue is due to the install.sh in main branch already using a newer objectbox-c dependency, while the released (tagged) Go version still depends on the previous one. Before the new release is out, you can install the previous dependency version by using the script from the corresponding tagged revision, i.e. https://github.com/objectbox/objectbox-go/blob/v1.5.0/install.sh

maracko commented 2 years ago

That worked, thank you