Skip to content

Update zig libraries and remove vendored copies from this repo #2769

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

Merged
merged 12 commits into from
Apr 14, 2025
Merged
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ COPY rcloud.packages rcloud.packages
COPY rcloud.support rcloud.support
COPY scripts scripts
COPY services services
COPY vendor vendor
COPY Gruntfile.js .
COPY LICENSE .
COPY package-lock.json .
Expand Down Expand Up @@ -197,7 +196,7 @@ COPY --from=build --chown=rcloud:rcloud /data/rcloud/zig-out /data/rcloud/
ENV ROOT=/data/rcloud

# Set R libs directories
ENV R_LIBS /data/rcloud/lib
ENV R_LIBS=/data/rcloud/lib

#
# runtime-simple: the single-user local RCloud installation
Expand Down
5 changes: 2 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn fetch_assets_and_build(
// we are doing a standard online build

// get the fetch-assets tool
const exe = b.dependency("r-build-zig", .{
const exe = b.dependency("r_build_zig", .{
.target = target,
.optimize = optimize,
}).artifact("fetch-assets");
Expand Down Expand Up @@ -132,7 +132,7 @@ fn generate_build_script(
target: ResolvedTarget,
optimize: OptimizeMode,
) !void {
const exe = b.dependency("r-build-zig", .{
const exe = b.dependency("r_build_zig", .{
.target = target,
.optimize = optimize,
}).artifact("generate-build");
Expand Down Expand Up @@ -217,7 +217,6 @@ fn add_all_source_files(b: *Build, wf: *WriteFile, dirname: []const u8) void {
_ = add_copy_directory(b, wf, "scripts", dirname, options);
_ = add_copy_directory(b, wf, "services", dirname, options);
_ = add_copy_directory(b, wf, "packages", dirname, options);
_ = add_copy_directory(b, wf, "vendor", dirname, options);

_ = add_copy_file(b, wf, "build-aux/config.json", dirname);
_ = add_copy_file(b, wf, "build-aux/generated/build.zig", dirname);
Expand Down
13 changes: 9 additions & 4 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
.{
.name = "rcloud",
.version = "0.0.0", // TODO: we can ignore this because we don't package for Zig?
.name = .rcloud,
.fingerprint = 0x356eca021c4a042,

// track version of r-build-zig, but nothing depends on this version
.version = "0.8.0",

.minimum_zig_version = "0.14.0",
.dependencies = .{
.@"r-build-zig" = .{
.path = "vendor/r-build-zig-0.5.0-no-deps",
.r_build_zig = .{
.url = "https://github.com/mocompute/r-build-zig/archive/refs/tags/v0.8.0.tar.gz",
.hash = "r_build_zig-0.8.0-5sLw3oAcAQC3PiA1WqhNa8LV0Ebr5WWCLe3t9Fs6A2S2",
},
},
.paths = .{
Expand Down
86 changes: 79 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";

zig.url = "github:mitchellh/zig-overlay";
zig.inputs.nixpkgs.follows = "nixpkgs";

flake-utils.url = "github:numtide/flake-utils";
};

outputs = { flake-utils, nixpkgs, ... } @ inputs:
outputs = { flake-utils, nixpkgs, zig, ... } @ inputs:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [
zig.overlays.default
];

pkgs = import nixpkgs {
Expand Down Expand Up @@ -45,6 +49,7 @@
rPackages.codetools
rPackages.Matrix
wget
zig.packages.${system}."0.14.0"
];

LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [ openssl ];
Expand Down
2 changes: 0 additions & 2 deletions vendor/r-build-zig-0.5.0-no-deps/.gitignore

This file was deleted.

Loading