mirror of
https://github.com/NilsIrl/dockerc.git
synced 2025-09-27 03:15:58 +08:00
Add CI
This commit is contained in:
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@@ -7,4 +7,20 @@ jobs:
|
|||||||
- uses: goto-bus-stop/setup-zig@v2
|
- uses: goto-bus-stop/setup-zig@v2
|
||||||
with:
|
with:
|
||||||
version: 0.13.0
|
version: 0.13.0
|
||||||
- run: zig fmt --check .
|
- run: zig fmt --check .
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: 'recursive'
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.22.6'
|
||||||
|
- uses: goto-bus-stop/setup-zig@v2
|
||||||
|
with:
|
||||||
|
version: 0.13.0
|
||||||
|
- run: sudo apt install autoconf libtool pkg-config make libzstd-dev libfuse3-dev
|
||||||
|
- run: zig build -Doptimize=ReleaseSafe -Dtarget=x86_64-linux-musl
|
||||||
|
- run: zig-out/bin/dockerc --image docker://hello-world --output enlo
|
||||||
|
- run: ./enlo
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -6,7 +6,8 @@
|
|||||||
url = https://github.com/containers/skopeo.git
|
url = https://github.com/containers/skopeo.git
|
||||||
[submodule "crun"]
|
[submodule "crun"]
|
||||||
path = crun
|
path = crun
|
||||||
url = https://github.com/containers/crun.git
|
url = https://github.com/NilsIrl/crun.git
|
||||||
|
branch = dockerc
|
||||||
[submodule "squashfs-tools"]
|
[submodule "squashfs-tools"]
|
||||||
path = squashfs-tools
|
path = squashfs-tools
|
||||||
url = https://github.com/plougher/squashfs-tools.git
|
url = https://github.com/plougher/squashfs-tools.git
|
||||||
|
31
build.zig
31
build.zig
@@ -57,7 +57,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
fuse_fss.addIncludePath(b.path("zstd/lib"));
|
fuse_fss.addIncludePath(b.path("zstd/lib"));
|
||||||
|
|
||||||
fuse_fss.addIncludePath(b.path("libfuse/include"));
|
fuse_fss.addIncludePath(b.path("libfuse/include"));
|
||||||
fuse_fss.addIncludePath(b.path("libfuse/build"));
|
fuse_fss.addIncludePath(b.path("libfuse_include"));
|
||||||
|
|
||||||
fuse_fss.addCSourceFiles(.{
|
fuse_fss.addCSourceFiles(.{
|
||||||
.files = &[_][]const u8{
|
.files = &[_][]const u8{
|
||||||
@@ -137,6 +137,13 @@ pub fn build(b: *std.Build) void {
|
|||||||
.target = target,
|
.target = target,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const cc = std.fmt.allocPrint(
|
||||||
|
b.allocator,
|
||||||
|
// TODO: find exact zig location
|
||||||
|
"zig cc --target={s}",
|
||||||
|
.{target.result.zigTriple(b.allocator) catch @panic("OOM")},
|
||||||
|
) catch @panic("OOM");
|
||||||
|
|
||||||
const squashfuse_autogen = b.addSystemCommand(&[_][]const u8{
|
const squashfuse_autogen = b.addSystemCommand(&[_][]const u8{
|
||||||
"./autogen.sh",
|
"./autogen.sh",
|
||||||
});
|
});
|
||||||
@@ -172,21 +179,6 @@ pub fn build(b: *std.Build) void {
|
|||||||
overlayfs_configure.setCwd(b.path("fuse-overlayfs"));
|
overlayfs_configure.setCwd(b.path("fuse-overlayfs"));
|
||||||
overlayfs_configure.step.dependOn(&overlayfs_autogen.step);
|
overlayfs_configure.step.dependOn(&overlayfs_autogen.step);
|
||||||
|
|
||||||
const libfuse_mkdir_build = b.addSystemCommand(&[_][]const u8{
|
|
||||||
"mkdir",
|
|
||||||
"-p",
|
|
||||||
"build",
|
|
||||||
});
|
|
||||||
libfuse_mkdir_build.setCwd(b.path("libfuse"));
|
|
||||||
|
|
||||||
const configure_libfuse = b.addSystemCommand(&[_][]const u8{
|
|
||||||
"meson",
|
|
||||||
"setup",
|
|
||||||
"..",
|
|
||||||
});
|
|
||||||
configure_libfuse.setCwd(b.path("libfuse/build"));
|
|
||||||
configure_libfuse.step.dependOn(&libfuse_mkdir_build.step);
|
|
||||||
|
|
||||||
const runtime = b.createModule(.{
|
const runtime = b.createModule(.{
|
||||||
.root_source_file = b.path("src/main.zig"),
|
.root_source_file = b.path("src/main.zig"),
|
||||||
.link_libc = true,
|
.link_libc = true,
|
||||||
@@ -195,6 +187,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
runtime.addImport("zstd", zstd);
|
runtime.addImport("zstd", zstd);
|
||||||
runtime.addImport("fuse-overlayfs", fuse_fss);
|
runtime.addImport("fuse-overlayfs", fuse_fss);
|
||||||
|
|
||||||
|
runtime.addIncludePath(b.path("crun_include"));
|
||||||
runtime.addIncludePath(b.path("crun"));
|
runtime.addIncludePath(b.path("crun"));
|
||||||
runtime.addIncludePath(b.path("crun/src"));
|
runtime.addIncludePath(b.path("crun/src"));
|
||||||
runtime.addIncludePath(b.path("crun/libocispec/src"));
|
runtime.addIncludePath(b.path("crun/libocispec/src"));
|
||||||
@@ -297,6 +290,10 @@ pub fn build(b: *std.Build) void {
|
|||||||
"--disable-caps",
|
"--disable-caps",
|
||||||
"--disable-seccomp",
|
"--disable-seccomp",
|
||||||
});
|
});
|
||||||
|
crun_configure.setEnvironmentVariable(
|
||||||
|
"CC",
|
||||||
|
cc,
|
||||||
|
);
|
||||||
crun_configure.setCwd(b.path("crun"));
|
crun_configure.setCwd(b.path("crun"));
|
||||||
crun_configure.step.dependOn(&crun_autogen.step);
|
crun_configure.step.dependOn(&crun_autogen.step);
|
||||||
|
|
||||||
@@ -320,12 +317,10 @@ pub fn build(b: *std.Build) void {
|
|||||||
runtime_x86_64.step.dependOn(&squashfuse_make_generate_swap.step);
|
runtime_x86_64.step.dependOn(&squashfuse_make_generate_swap.step);
|
||||||
runtime_x86_64.step.dependOn(&overlayfs_configure.step);
|
runtime_x86_64.step.dependOn(&overlayfs_configure.step);
|
||||||
runtime_x86_64.step.dependOn(&libocspec_generate_files.step);
|
runtime_x86_64.step.dependOn(&libocspec_generate_files.step);
|
||||||
runtime_x86_64.step.dependOn(&configure_libfuse.step);
|
|
||||||
|
|
||||||
runtime_aarch64.step.dependOn(&squashfuse_make_generate_swap.step);
|
runtime_aarch64.step.dependOn(&squashfuse_make_generate_swap.step);
|
||||||
runtime_aarch64.step.dependOn(&overlayfs_configure.step);
|
runtime_aarch64.step.dependOn(&overlayfs_configure.step);
|
||||||
runtime_aarch64.step.dependOn(&libocspec_generate_files.step);
|
runtime_aarch64.step.dependOn(&libocspec_generate_files.step);
|
||||||
runtime_aarch64.step.dependOn(&configure_libfuse.step);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const go_cpu_arch = switch (target.query.cpu_arch orelse target.result.cpu.arch) {
|
const go_cpu_arch = switch (target.query.cpu_arch orelse target.result.cpu.arch) {
|
||||||
|
2
crun
2
crun
Submodule crun updated: 05c4ea1941...fe982fafdd
3
crun_include/git-version.h
Normal file
3
crun_include/git-version.h
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#ifndef GIT_VERSION
|
||||||
|
# define GIT_VERSION "dockerc-hash"
|
||||||
|
#endif
|
44
libfuse_include/fuse_config.h
Normal file
44
libfuse_include/fuse_config.h
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Autogenerated by the Meson build system.
|
||||||
|
* Do not edit, your changes will be lost.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// not available in musl
|
||||||
|
// #define HAVE_BACKTRACE
|
||||||
|
|
||||||
|
#define HAVE_COPY_FILE_RANGE
|
||||||
|
|
||||||
|
#define HAVE_FALLOCATE
|
||||||
|
|
||||||
|
#define HAVE_FDATASYNC
|
||||||
|
|
||||||
|
#define HAVE_FORK
|
||||||
|
|
||||||
|
#define HAVE_FSTATAT
|
||||||
|
|
||||||
|
#define HAVE_ICONV
|
||||||
|
|
||||||
|
#define HAVE_OPENAT
|
||||||
|
|
||||||
|
#define HAVE_PIPE2
|
||||||
|
|
||||||
|
#define HAVE_POSIX_FALLOCATE
|
||||||
|
|
||||||
|
#define HAVE_READLINKAT
|
||||||
|
|
||||||
|
#define HAVE_SETXATTR
|
||||||
|
|
||||||
|
#define HAVE_SPLICE
|
||||||
|
|
||||||
|
#define HAVE_STRUCT_STAT_ST_ATIM
|
||||||
|
|
||||||
|
#undef HAVE_STRUCT_STAT_ST_ATIMESPEC
|
||||||
|
|
||||||
|
#define HAVE_UTIMENSAT
|
||||||
|
|
||||||
|
#define HAVE_VMSPLICE
|
||||||
|
|
||||||
|
#define PACKAGE_VERSION "3.17.0"
|
||||||
|
|
15
libfuse_include/libfuse_config.h
Normal file
15
libfuse_include/libfuse_config.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* Autogenerated by the Meson build system.
|
||||||
|
* Do not edit, your changes will be lost.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define FUSE_HOTFIX_VERSION 0
|
||||||
|
|
||||||
|
#define FUSE_MAJOR_VERSION 3
|
||||||
|
|
||||||
|
#define FUSE_MINOR_VERSION 17
|
||||||
|
|
||||||
|
#define LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS 1
|
||||||
|
|
Reference in New Issue
Block a user