Comments (12)
Have you tried brew install nasm
?
from lilliput.
@brian-armstrong-discord Yes I've now got all the deps installed. Initially thought that would fix it, however building with crosscompile still doesn't work.
from lilliput.
What is the error?
from lilliput.
I'd like to add my voice to this issue as well. It seems like cross-compiling, regardless of the host os, isn't working as hoped.
On macOS:
$ GOOS=linux go build
# github.com/discordapp/lilliput
../../go/src/github.com/discordapp/lilliput/lilliput.go:26:13: undefined: ImageHeader
../../go/src/github.com/discordapp/lilliput/lilliput.go:41:14: undefined: Framebuffer
../../go/src/github.com/discordapp/lilliput/lilliput.go:48:12: undefined: Framebuffer
../../go/src/github.com/discordapp/lilliput/ops.go:43:16: undefined: Framebuffer
On Linux:
$ GOOS=darwin go build
# github.com/discordapp/lilliput
../../go/src/github.com/discordapp/lilliput/lilliput.go:26:13: undefined: ImageHeader
../../go/src/github.com/discordapp/lilliput/lilliput.go:41:14: undefined: Framebuffer
../../go/src/github.com/discordapp/lilliput/lilliput.go:48:12: undefined: Framebuffer
../../go/src/github.com/discordapp/lilliput/ops.go:43:16: undefined: Framebuffer
go build
in the same directory works regardless of platform.
My "go greeness" is showing here, but could it be that the platform is getting lost along the way, resulting in a build attempt that's just all kinds of confused?
from lilliput.
Well, this package also has c deps that are needed, and compilation has to occur with cgo.
Maybe https://gist.github.com/steeve/6905542 is relevant?
from lilliput.
It looks like if nothing else, in cross-compile mode, you need CGO_ENABLED=1. But you'll also need a valid cross-compile setup for compiling the C deps.
from lilliput.
Did you manage to work around this issue @samsamm777
from lilliput.
docker run -it --rm \
-v $GOPATH/src/github.com/MYPROJECT/app/backend:/go/src/github.com/MYPROJECT/app/backend \
-w /go/src/github.com/MYPROJECT/app/backend \
-e CGO_ENABLED=1 \
docker.elastic.co/beats-dev/golang-crossbuild:1.14.4-main-debian8 \
--build-cmd "go build" \
-p "linux/amd64"
from lilliput.
Only this error left now:
/usr/bin/ld: cannot find -lpng
/usr/bin/ld: cannot find -lpng
collect2: error: ld returned 1 exit status
Error: failed building for linux/amd64: exit status 2
failed building for linux/amd64: exit status 2
from lilliput.
docker run -it --rm \
-v $GOPATH/src/github.com/MYPROJECT/app/backend:/go/src/github.com/MYPROJECT/app/backend \
-w /go/src/github.com/MYPROJECT/app/backend \
-e CGO_ENABLED=1 \
docker.elastic.co/beats-dev/golang-crossbuild:1.14.4-main-debian8 \
--build-cmd "
apt-get update
apt-get install gcc libc6-dev
apt-get install libx11-dev xorg-dev libxtst-dev libpng++-dev
apt-get install xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxkbcommon-dev
apt-get install xsel xclip
go build -v" \
-p "linux/amd64"
Results in
/usr/bin/ld: /go/pkg/mod/github.com/discordapp/[email protected]/deps/linux/lib/libswscale.a(swscale.o): unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Error: failed building for linux/amd64: exit status 2
failed building for linux/amd64: exit status 2
from lilliput.
Ah debian8 is old apparently crystal-lang/crystal#8653 (comment). It works with this command on OSX.
docker run -it --rm \
-v $GOPATH/src/github.com/MYPROJECT/app/backend:/go/src/github.com/MYPROJECT/app/backend \
-w /go/src/github.com/MYPROJECT/app/backend \
-e CGO_ENABLED=1 \
docker.elastic.co/beats-dev/golang-crossbuild:1.14.4-main \
--build-cmd "
apt-get -y update
apt-get -y install gcc libc6-dev
apt-get -y install libx11-dev xorg-dev libxtst-dev libpng++-dev
apt-get -y install xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxkbcommon-dev
apt-get -y upgrade binutils
apt-get -y install xsel xclip
go build -v" \
-p "linux/amd64"
from lilliput.
Final command :-D
It works 👍
docker run -it --rm \
-v $GOPATH/src/github.com/MYPROJECT/app/backend:/go/src/github.com/MYPROJECT/app/backend \
-w /go/src/github.com/MYPROJECT/app/backend \
-e CGO_ENABLED=1 \
docker.elastic.co/beats-dev/golang-crossbuild:1.14.4-main \
--build-cmd "
apt-get -y update
apt-get -y install libpng++-dev
go build -v
" \
-p "linux/amd64"
from lilliput.
Related Issues (20)
- APNG support HOT 4
- WebP animated support HOT 7
- Unreachable code in thumbhash_encoder_create function
- Segfaults when `go-fitz` is imported
- ld: library not found for -lsharpyuv HOT 2
- Dockerfile Example HOT 1
- Getting error in building library
- The effect of Discord increasingly relying on rust on this project HOT 2
- Couldnt build lilliput HOT 2
- Can not build the lib HOT 4
- PNG compression algorithm causing desaturation
- Please add sample for Audio support
- Some .gifs are incorrectly "smearing"
- go get error HOT 3
- Not possible to cross compile
- Compile warning on Ubuntu 20.04.2 LTS HOT 4
- PNG compression - larger then before HOT 2
- ARM support (Apple M1) HOT 4
- Apple M1 issues HOT 2
- Versions not picked up by pkg.go.dev
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lilliput.