-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to build elementum binaries properly? #712
Comments
@antonsoroko I'm not sure travis build is working, that was long time ago. There is a |
ahhh. still interesting how travis-ci still works, maybe it has some old libtorrent-go binaries from cache https://travis-ci.org/github/elgatito/elementum/jobs/471307519#L456 |
Almost. Local Jenkins. Up-to-date libtorrent-go docker images are uploaded to docker hub. When you do "make pull-all" from libtorrent-go repo - it will download docker images so you don't need to build them. |
i see. thanks. would be nice to save jenkins job config to github, just in case. |
@elgatito Since we don't have intermediate generated files, tools like So far i managed to obtain intermediate generated files by editing and use them as a reference code. Another option is to directly run I also tried to copy all files (i mean also files generated by So currently i just search these 2 files manually. |
@antonsoroko Yes, I have same issue. When you do CGO you don't have intermediate cxx/go files. It just makes a compiled package inside Go pkg directory. It was somewhen working with proper syntax highlighting and code completion, now it is not working on my dev host. |
@elgatito
but i am not sure that this will not break your CI, so i have not sent patch yet. i guess for CI the best option would be https://www.docker.com/blog/containerize-your-go-developer-environment-part-2/ but if my approach will work for your CI then i guess we can keep it simple. |
looks like in order to use "cache volume" image also should be changed first. not cool. so, maybe let's add
to Makefile? if it will not break your Jenkins CI of course, it is really very convenient. |
@antonsoroko what exactly to add? |
diff --git a/Makefile b/Makefile
index f52075c..90f407f 100644
--- a/Makefile
+++ b/Makefile
@@ -170,7 +170,8 @@ build: force
ifeq ($(TARGET_OS), windows)
GOOS=windows $(GO) get -u github.com/StackExchange/wmi
endif
- $(DOCKER) run --rm -v $(GOPATH):/go -e GOPATH=/go -v $(shell pwd):/go/src/$(GO_PKG) --ulimit memlock=67108864 -w /go/src/$(GO_PKG) $(DOCKER_IMAGE):$(TARGET_OS)-$(TARGET_ARCH) make dist TARGET_OS=$(TARGET_OS) TARGET_ARCH=$(TARGET_ARCH) GIT_VERSION=$(GIT_VERSION)
+ $(DOCKER) run --rm -v $(GOPATH):/go -e GOPATH=/go -v $(shell pwd):/go/src/$(GO_PKG) -v $(shell go env GOCACHE):/root/.cache/go-build --ulimit memlock=67108864 -w /go/src/$(GO_PKG) $(DOCKER_IMAGE):$(TARGET_OS)-$(TARGET_ARCH) make dist TARGET_OS=$(TARGET_OS) TARGET_ARCH=$(TARGET_ARCH) GIT_VERSION=$(GIT_VERSION)
+ sudo chown -R $(shell id --user):$(shell id --group) $(shell go env GOCACHE)
docker: force
$(DOCKER) run --rm -v $(GOPATH):/go -v -e GOPATH=/go -v $(shell pwd):/go/src/$(GO_PKG) --ulimit memlock=67108864 -w /go/src/$(GO_PKG) $(DOCKER_IMAGE):$(TARGET_OS)-$(TARGET_ARCH) |
@antonsoroko try the latest commit in elementum repository. Docker there is ran by your local user, and all the gocache data is also owned by you. |
works nice. and now |
Hi.
Is there any tricks to build elementum binaries properly?
I can see old build steps in https://github.com/elgatito/elementum/blob/master/.gitlab-ci.yml
and new one in https://travis-ci.org/github/elgatito/elementum/jobs/471307519/config
and some quick start info in https://github.com/elgatito/elementum/blob/master/README.md and in https://github.com/ElementumOrg/libtorrent-go/blob/master/README.md and in https://github.com/elgatito/elementum/blob/master/Makefile
So I was able to build elementum (and binary works), but I had some small issues, that's why I am curious.
e.g. on
go get -u ./...
go tried to build libtorrent-go and I gotPackage libtorrent-rasterbar was not found in the pkg-config search path.
which I ignored since it should be build differently as I can see.But I do not see this issue in travis-ci log for example.
Also I do not see how you build libtorrent-go in travis-ci - no
make libs
or similar.I would appreciate some info. Thank you!
p.s. this might be useful for #536
The text was updated successfully, but these errors were encountered: