mattermost-community / focalboard

Focalboard is an open source, self-hosted alternative to Trello, Notion, and Asana.
https://www.focalboard.com
Other
21.9k stars 1.97k forks source link

Bug: Error with sqlite3-binding when building for linux #373

Closed fabiancrx closed 3 years ago

fabiancrx commented 3 years ago

Summary: After following the instructions in the readme and installing the required dependencies when running make linux-app the process errors (see log).

Steps to reproduce the behavior: make linux-app

Expected behavior: It compiles the app

Platform: Linux Pop_OS! 20.10 x86_64

If the information I provided is incomplete to triage the problem do ask for more, as I'm eager to try focalboard after #123 got closed.

Error log
```sh make linux-app cd webapp; npm run pack > focalboard@0.6.6 pack > NODE_ENV=production webpack --config webpack.js asset static/main.js 1.74 MiB [emitted] [minimized] [big] (name: main) asset static/easymde.min.css 12.1 KiB [compared for emit] [from: node_modules/easymde/dist/easymde.min.css] [copied] asset static/favicon.svg 2.36 KiB [compared for emit] [from: static/favicon.svg] [copied] asset index.html 503 bytes [compared for emit] orphan modules 1.33 MiB [orphan] 259 modules runtime modules 1.47 KiB 6 modules javascript modules 2.84 MiB modules by path ./src/ 598 KiB 330 modules modules by path ./node_modules/ 2.25 MiB 53 modules fs (ignored) 15 bytes [built] [code generated] json modules 67.1 KiB 11 modules WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). This can impact web performance. Assets: static/main.js (1.74 MiB) WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. Entrypoints: main (1.74 MiB) static/main.js WARNING in webpack performance recommendations: You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. For more info visit https://webpack.js.org/guides/code-splitting/ webpack 5.35.1 compiled with 3 warnings in 29451 ms rm -rf linux/temp rm -rf linux/dist mkdir -p linux/dist mkdir -p linux/temp/focalboard-app cp app-config.json linux/temp/focalboard-app/config.json cp build/MIT-COMPILED-LICENSE.md linux/temp/focalboard-app/ cp NOTICE.txt linux/temp/focalboard-app/ cp webapp/NOTICE.txt linux/temp/focalboard-app/webapp-NOTICE.txt cp -R webapp/pack linux/temp/focalboard-app/pack cd linux; make build make[1]: Entering directory '/home/user/_temp/focalboard/linux' mkdir -p bin go build -o bin/focalboard-app # github.com/mattn/go-sqlite3 sqlite3-binding.c: In function ‘sqlite3SelectNew’: sqlite3-binding.c:128049:10: warning: function may return address of local variable [-Wreturn-local-addr] 128049 | return pNew; | ^~~~ sqlite3-binding.c:128009:10: note: declared here 128009 | Select standin; | ^~~~~~~ make[1]: Leaving directory '/home/user/_temp/focalboard/linux' cp -R linux/bin/focalboard-app linux/temp/focalboard-app/ cd linux/temp; tar -zcf ../dist/focalboard-linux.tar.gz focalboard-app rm -rf linux/temp ```
fabiancrx commented 3 years ago

Well followed the issue to the go-sqlite3 repo and found this issue. The problems seems to be originated from a missing environment varaible and modifying the linux make file to:

.PHONY: run

run:
    go run ./main.go

build:
    mkdir -p bin
    CGO_CFLAGS="-g -O2 -Wno-return-local-addr" go build -o bin/focalboard-app

solved the issue for me.

jespino commented 3 years ago

This is not a bug, actually, this compiles the app, the noticed messages are a warning from SQLite and the proposed solution is to disable that kind of warnings. I think I prefer to keep the warnings enable just in case we include other libraries that have the same issue (I prefer to keep the messages there). I going to close this.