Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

make fails on raspberry pi #1411

Closed
MansM opened this issue Sep 30, 2018 · 7 comments · Fixed by #1474
Closed

make fails on raspberry pi #1411

MansM opened this issue Sep 30, 2018 · 7 comments · Fixed by #1474

Comments

@MansM
Copy link
Contributor

MansM commented Sep 30, 2018

HW: raspberry pi 3b
OS: hypriot

buildenv:

FROM arm32v7/golang:1.10
RUN go get -u github.com/golang/dep/cmd/dep

RUN mkdir -p /go/src/github.com/weaveworks/

RUN apt update && apt install -y \
     apt-transport-https \
     ca-certificates \
     curl \
     gnupg2 \
     software-properties-common

RUN  echo "deb [arch=armhf] https://download.docker.com/linux/debian \
     $(lsb_release -cs) stable" | \
     tee /etc/apt/sources.list.d/docker.list

RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN apt update && apt install -y  docker-ce
WORKDIR /go/src/github.com/weaveworks/
CMD tail -f /var/log/alternatives.log

build script (just docker exec'ed into the container)

git clone https://github.com/weaveworks/flux.git && \
cd flux && \
git checkout 1.7.1 && \
sed -i "s/amd64/arm/g" Makefile && \
dep ensure && \
make

2 cups (very large cups) of coffee later:

oot@0667eb690340:/go/src/github.com/weaveworks/flux# make
go install ./cmd/fluxd
# github.com/weaveworks/flux/checkpoint
checkpoint/checkpoint_linux.go:10:36: cannot use uts.Release[:] (type []uint8) as type []int8 in argument to cstringToString
Makefile:76: recipe for target '/go/bin/fluxd' failed
make: *** [/go/bin/fluxd] Error 2

same for master

This seems to work (not sure about effects):

cd /go/src/github.com/weaveworks/ && \
git clone https://github.com/weaveworks/flux.git && \
cd flux && \
git checkout 1.7.1 && \
sed -i 's#int8)#uint8)#g' checkpoint/checkpoint_linux.go
sed -i "s/amd64/arm/g" Makefile && \
dep ensure && \
make
@dholbach dholbach added the bug label Oct 1, 2018
@squaremo squaremo removed the bug label Oct 1, 2018
@MansM
Copy link
Contributor Author

MansM commented Oct 3, 2018

@squaremo ehm you removed bug label, its not a bug, its a feature? just being curious

@squaremo
Copy link
Member

squaremo commented Oct 3, 2018

Sorry, I had a comment queued up which I neglected to submit.
I don't think this is a bug, no. We just don't target arm32 at present. I'm not against making adjustments to accommodate arm32, though. Perhaps this could be considered a feature request?

@MansM
Copy link
Contributor Author

MansM commented Oct 4, 2018

makes sense!
Would highly like it to work on rpi 32bits.
I wonder, what kind of issues can I expect from my fix as it seems to work?

@dholbach
Copy link
Member

dholbach commented Oct 4, 2018

A good way forward for this enhancement would be to start turning it into a PR, which modifies the build so that it works on arm32, but leaves the build of other architectures untouched.

@MansM
Copy link
Contributor Author

MansM commented Oct 5, 2018

Wish I knew how. I have no clue how to make platform specific code in go. Makefile is the thing that is not too simple (after some investigation)

found some docs, will try to make the code working

@squaremo
Copy link
Member

squaremo commented Oct 5, 2018

There's two ways of doing this within the Go toolchain, both explained at https://dave.cheney.net/2013/10/12/how-to-use-conditional-compilation-with-the-go-build-tool
(for reference, the architectures and OSes are listed in https://golang.org/src/go/build/syslist.go)

I think build tags are probably what we need here, since it looks like we want to define some things in different ways for arm and !arm.

There's also the question of where images for different architectures fits in the build process -- will have to think about that one ..

@MansM
Copy link
Contributor Author

MansM commented Oct 5, 2018

that is exactly the same page I found :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants