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
Update docker-build-static.yml add FreeBSD static build #856
Conversation
Add x86_64-unknown-freebsd static build, create tar.gz from static builds
Pardon my ignorance, but since this is a statically linked binary without dependencies, can't you run the Linux version of the binary? How is freebsd special in that respect? |
Oh, duh, different kernels, the syscalls are different. Pardon the derp |
You'll need to install rust for freebsd as well: "consider downloading the target with |
Hi @nitnelave Yes, your are right. As there are different low level kernel elements when you change the CPU/SOC family: armv7 aarm64 vs amd64, here even a completely different OS underlying. But luckily its a Rust code, so after a Answering the last one:
It is amd64 an actual build starts with this |
Following @nitnelave's query changing commented text line 37 from "x86_64-unknown-freebsd" to "build_x86_freebsd"
Based on your review, the build name changed: instead of "build_x86_freebsd" to "x86_64-unknown-freebsd" in the commented line 37. I think a |
It seems there's a linker issue (ld) in the building docker image. I've checked Dockerfile.dev. There you are specifying cc compilers per target. Following the links, I think it could be x86_64-linux-musl-cross.tgz it needs. Although I'm not sure I've never used them like that before. I've either used the target directly, or installed cross and used that. Will check with a local build using rust docker. |
So freebsd approach wise likely want to use CLANG rather normal gcc. The best sample I can get is from https://github.com/smartmontools/docker-build/blob/master/Dockerfile#L77. That in simple term use clang, fetch freebsd libs. Then following suit to development file
Maybe just clang? or clang++? Trial error begins. There is also https://github.com/marketplace/actions/freebsd-vm but this route gonna be start from scratch. Additional ref |
Thanks for the details, checked the smartmontools and the Wezm repo too. Unfortunately ran into several linked problems while tried to build one. In this direction this seems to most up-to-date Docker x86_64-unknown-freebsd by mcandre. Honestly pervious projects I tried to get a FreeBSD build, were constucted different from Github actions point of view, editing only the YAML files of github action to add target x86_64-unknown-freebsd was simply enough. Here I had to go under the hood, so there are three ways:
|
When freebsd-cc will complicate stuff as it needs to rebuild many things just to achieve the x86_64 platform, thankfully musl had cross cc available. I also want to suggest using cross action, but instead doing inside this main yml. Do it separately and use workflow call to build freebsd on this main yml.
|
I have successful complete builds for FreeBSD by downloading/updating the actual Dockerfile.dev:
Help me out: how can I find what actions/upload-artifact@v4 do, or how the additional fonts and bootstrap files get into under app/static & app/pkg for a release? The modified Dockerfile.dev is in another temporary repo, to not contaminate this PR Right now it is out of the way of current static build, but can be integrated:
Finally: is this important, or is it this LICENCE file it is talking about? |
Yeah, had similar idea, but were thinking about extending the original static-build YAML, just see the above. What I didn't catch yet really, how the existing static build dockers called in life and by what. If there's no issue with running them via mapping /var/run/docker.sock into them to do DinD, that seems to be the simplest extension for this. However if you do have some more details on the freebsd-cc way to share with, I'm interested in that too, it could help the BSD/SunOS/IllumOS area further.
|
Provide service capabilities for FreeBSD. Copy to to exist as /usr/local/etc/rc.d/lldap
Fix wrong upload
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #856 +/- ##
==========================================
+ Coverage 86.28% 86.32% +0.03%
==========================================
Files 50 50
Lines 10925 10956 +31
==========================================
+ Hits 9427 9458 +31
Misses 1498 1498 |
Separates "linux-musl" cargo builds from x86_64-unknown-freebsd cross build. Needs cross install -> in Dockerfile.dev
FreeBSD build needs 'cross build' instead of 'cargo build'
Kindly check the run result https://github.com/lldap/lldap/actions/runs/8360008854 |
PR closed due weird issue, freebsd rc.d taken as binary rather than text. |
Add x86_64-unknown-freebsd static build, create tar.gz from static builds