-
Notifications
You must be signed in to change notification settings - Fork 5
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
AlpineLinux apk Package #55
Comments
@rvalle I don't use Alpine myself, but if you need anything done in the library or have any questions, I will help. IIRC, the only hard runtime dependency is talloc, although you'll probably also want json-c. This was designed mainly as a library for implementing bindings in other languages, although it is possible to execute templates via the binary. |
I was trying yesterday, first to make it build in AlpineLinux.... talloc does not seems to be a problem, or it seems found by the configure script. The configure script is failing with:
I believe this is used for testing... I have installed check-0.11.0-r0, but still fails. I am unfamiliar with automake/autoconf. After it builds, I will try to build the package. Do you use vagrant? I can try to generate the package inside a box, so you can also try it out.
I totally understand your original intent. However, I think this use case is very powerful. Docker allows you to run your service with minimal OS dependencies. AlpineLinux is been a fantastic choice to build images because its "minimal root filesystem" is just 1.9 Mbytes to download. Ruby, Nodejs, Python, etc, are really heavyweight in this world. Your handlebars implementation seems absolutely perfect to me as it is :) |
pkgconfig does need to be installed to detect check. I believe I may remove the version check for check. |
I think it is installed. you think it might be misinterpreting the version num? |
Ok, I have commented out the check check and the ./configure phase completes now ok. |
I had picked wrong check packages, there is a check-dev, that was required. Now all compilation process works just fine. I have only 1 test failing and 1 with error. Will investigate. |
@rvalle I tried compiling it in vagrant on alpine 3.6 but the tests were locking up for me. Do you have a working build process? |
@jbboehr try with this Dockerfile
|
@rvalle tests pass with |
@jbboehr thanks! I am now reviewing the packaging system for Alpine Linux. Seems to rely on a source tarball. |
@rvalle I assume the structure would be similar to this: https://github.com/alpinelinux/aports/pull/1382/files I will tag a new release with the changes I just made. |
@jbboehr yes. That pretty much solves the questions I had. Will test the package building today. |
@jbboehr I can see now where to get the source tarball from, and also how to deal with submodules. I notice that submodules have more than one level of recursion, but I guess only the first level is required to build. I did a quick test, and it seems to build check out only the first level. If that is the case, the structure of the pkgbuild would be the same. I am reviewing the Alpine naming conventions and your work on the APT repository. I think the build should generate 2 packages: handlebarsc with the command line utility, matching the same of the binary. |
@rvalle Yes, you should only need the two submodules of the I'm not sure how it is in alpine, but, typically, in debian there would be three packages (names are examples):
AFAICT the PR I linked contains only a single library package that contains all installable files for So, I'm not sure what would be appropriate here. |
@jbboehr yes, you are absolutely right. I didn't notice the dynamic lib, thought handlebarsc was statically linked. Will look into it. I saw some examples that generate more than one package. Will try today. |
@jbboehr got some progress with the package build process. Getting the sources, building and testing is now working, I am looking into the multi-package thing. You can test with this dockerfile:
|
@jbboehr with regards to naming:
is the "0" because if the major release? I guess you are foreseeing a major 1.x that might be non-backward compatible. |
@jbboehr , with regars to naming:
Also in line with what I see in many other Alpine Linux packages, looks like the most appropriate naming would be:
many other packages have drop the "lib" prefix. for example most dependencies: talloc, yaml, json-c, etc. there are some packages that use major versioning on the name, thou they tend to start by 1. It seems to be building the subpackages... lets see if they work. |
@jbboehr I think we have a candidate. apkbuild seem to do a lot of the work by itself. Like splitting -dev subpackage, detecting dependencies, etc. you can test with the dockerfile above. I am also trying to test the package release on an arm target (raspberry pi 3). You can use the same dockerfiles just change:
|
@rvalle Sweet. The Does it not require an ARM device? The ARM test failure is due to my hash table implementation's text fixture using a 64bit integer, I believe. |
@jbboehr yes, you require a arm device, I tested on a docker on raspbian, on raspberry pi 3. If you don't have a testing environment I can facilitate, just send me an SSH pk. But you might not need, it also fails on x86. You can reproduce with
Since x86_64 kernels can also run i386 binaries, I made a quick test and it is failing in the same way. I think. |
@jbboehr just make a quick pull/build/test on arm and your patch fixes also this target. |
@jbboehr I have tested produced packages on: x86, x86_64 and armhf and all seem to work. I guess next steps are:
Please review the APKBUILD, check if all is OK. |
@rvalle I've just tagged v0.6.2 with the test changes
Is lmdb compiled in statically? It's not required for your use case or for Incidentally, I don't recommend the I've been using handlebars.c with Otherwise it looks good to me. |
I see, most of the footprint is this library.
Yes, it is being included as it is present and detected during configuration. However, if I remove it, some tests fail:
I think we should remove the library, as Alpine Linux is so focused on reduced footprint. But we need that those tests are ignored rather than failing. there must be a define somewhere.... I guess... |
Another option, which may not be ideal is, if it's possible to link lmdb dynamically in alpine, is to not mark lmdb as a runtime dependency. This would reduce the size of the library, but you would get an error if you tried to use the lmdb backend and the library was not installed. |
Actually, I don't believe this would work without going through dlopen, and I don't particular want to mess with that. |
In any case, I don't think there's any good reason to use the lmdb backend anyway, so let's remove (the tests for) it. |
@rvalle Can you think of anything else before I tag another release? |
No, I think that is all... I tested your patch with all 3 archs, and seems fine. Please tag, and we pull request them. |
@rvalle I just tagged v0.6.3 |
@jbboehr currently git handlebars spec submodule is linked by commit hash. @ jirutka suggests using semantic version tags instead, in order to follow Alpines package build best practice. coud you? tag handlebars_spec submodule, and release a 0.6.4 with that reference? |
@rvalle I believe he just wants it to use a git tag. You can use this one for that purpose: https://github.com/jbboehr/handlebars-spec/releases/tag/v4.0.5-p1 The commit linked in this repository should be functionally identical, I had just updated the submodule in my feature branches but didn't update the commit after merging them into master. I will do that today and double-check that it works. |
I have now tested the package and it is distributed via the edge/testing package. |
Hi!
Lots of Docker images are based on Alpine Linux, because is extremely lightweight.
Many of those images come with spaghetti code to turn docker variables into configuration files.
That is why I searched for Handlebars in C, and I found this project.
I think it would be great to make an apk package. is there support planned?
I offer help.
I will also check to integrate ansible->docker->handlebars.c->happy microservice.
I think this project could work very well for that use case.
The text was updated successfully, but these errors were encountered: