9 Commits

Author SHA1 Message Date
Tom Alexander
f7938bf7c3 Switch to buildah for the foreign document test.
All checks were successful
foreign-document-test Build foreign-document-test has succeeded
BuildKit is having issues with caching which is causing problems with long builds like compiling emacs from source.
2026-09-09 23:13:32 -04:00
Tom Alexander
336b5d3d54 Update build workflow.
Some checks failed
rust-test Build rust-test has started
foreign-document-test Build foreign-document-test has started
build Build build has started
format Build format has succeeded
clippy Build clippy has failed
2026-07-17 18:38:11 -04:00
Tom Alexander
cef89303b1 Pin a specific version of rust.
Some checks failed
format Build format has succeeded
rust-test Build rust-test has started
clippy Build clippy has failed
build Build build has failed
foreign-document-test Build foreign-document-test has failed
2026-07-11 18:36:52 -04:00
Tom Alexander
842a77fb2b Pass in rust-overlay for creating rust-bin.
Some checks failed
rust-test Build rust-test has started
format Build format has succeeded
clippy Build clippy has failed
build Build build has succeeded
foreign-document-test Build foreign-document-test has failed
2026-07-10 21:55:12 -04:00
Tom Alexander
957bb3a5c8 Remove pkgsBuildHost from devShell. 2026-07-10 21:55:12 -04:00
Tom Alexander
de6739f9b6 Add an overlay to the flake.
Some checks failed
foreign-document-test Build foreign-document-test has started
rust-test Build rust-test has started
format Build format has succeeded
clippy Build clippy has failed
build Build build has succeeded
2026-07-10 20:21:38 -04:00
Tom Alexander
656e26e26f Use ADD command for pulling git repos.
This is to fix buildkit caching.
2026-07-09 22:39:35 -04:00
Tom Alexander
49fbb17672 Update builder image for buildkit.
Some checks are pending
rust-test Build rust-test has started
foreign-document-test Build foreign-document-test has started
format Build format has succeeded
clippy Build clippy has started
build Build build has started
2026-07-09 21:29:47 -04:00
Tom Alexander
8c8152bbfc Fix the build pipeline.
Some checks failed
foreign-document-test Build foreign-document-test has started
rust-test Build rust-test has started
clippy Build clippy has failed
format Build format has succeeded
build Build build has succeeded
2026-07-09 19:38:26 -04:00
10 changed files with 220 additions and 169 deletions

View File

@@ -2,6 +2,8 @@ apiVersion: tekton.dev/v1
kind: PipelineRun kind: PipelineRun
metadata: metadata:
name: build name: build
labels:
pdb: protect
spec: spec:
timeouts: timeouts:
pipeline: "2h0m0s" pipeline: "2h0m0s"
@@ -62,7 +64,7 @@ spec:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: "296c1602f4827d75701663f614e09df933c15336" value: "dda7b690195b43e8b9859d1caf5dcbf48588ade1"
- name: pathInRepo - name: pathInRepo
value: task/git-clone/0.1/git-clone.yaml value: task/git-clone/0.1/git-clone.yaml
resolver: git resolver: git
@@ -101,7 +103,7 @@ spec:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: 296c1602f4827d75701663f614e09df933c15336 value: dda7b690195b43e8b9859d1caf5dcbf48588ade1
- name: pathInRepo - name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params: params:
@@ -148,8 +150,7 @@ spec:
default: alpine:3.20 default: alpine:3.20
stepTemplate: stepTemplate:
image: alpine:3.20 image: alpine:3.20
name: "" computeResources:
resources:
requests: requests:
cpu: 10m cpu: 10m
memory: 60Mi memory: 60Mi
@@ -193,8 +194,7 @@ spec:
default: alpine:3.20 default: alpine:3.20
stepTemplate: stepTemplate:
image: alpine:3.20 image: alpine:3.20
name: "" computeResources:
resources:
requests: requests:
cpu: 10m cpu: 10m
memory: 60Mi memory: 60Mi
@@ -238,8 +238,7 @@ spec:
default: alpine:3.20 default: alpine:3.20
stepTemplate: stepTemplate:
image: alpine:3.20 image: alpine:3.20
name: "" computeResources:
resources:
requests: requests:
cpu: 10m cpu: 10m
memory: 60Mi memory: 60Mi
@@ -283,8 +282,7 @@ spec:
default: alpine:3.20 default: alpine:3.20
stepTemplate: stepTemplate:
image: alpine:3.20 image: alpine:3.20
name: "" computeResources:
resources:
requests: requests:
cpu: 10m cpu: 10m
memory: 60Mi memory: 60Mi
@@ -328,8 +326,7 @@ spec:
default: alpine:3.20 default: alpine:3.20
stepTemplate: stepTemplate:
image: alpine:3.20 image: alpine:3.20
name: "" computeResources:
resources:
requests: requests:
cpu: 10m cpu: 10m
memory: 60Mi memory: 60Mi
@@ -373,8 +370,7 @@ spec:
default: alpine:3.20 default: alpine:3.20
stepTemplate: stepTemplate:
image: alpine:3.20 image: alpine:3.20
name: "" computeResources:
resources:
requests: requests:
cpu: 10m cpu: 10m
memory: 60Mi memory: 60Mi
@@ -423,8 +419,7 @@ spec:
default: alpine:3.20 default: alpine:3.20
stepTemplate: stepTemplate:
image: alpine:3.20 image: alpine:3.20
name: "" computeResources:
resources:
requests: requests:
cpu: 10m cpu: 10m
memory: 60Mi memory: 60Mi
@@ -473,8 +468,7 @@ spec:
default: alpine:3.20 default: alpine:3.20
stepTemplate: stepTemplate:
image: alpine:3.20 image: alpine:3.20
name: "" computeResources:
resources:
requests: requests:
cpu: 10m cpu: 10m
memory: 60Mi memory: 60Mi
@@ -529,8 +523,7 @@ spec:
default: alpine:3.20 default: alpine:3.20
stepTemplate: stepTemplate:
image: alpine:3.20 image: alpine:3.20
name: "" computeResources:
resources:
requests: requests:
cpu: 10m cpu: 10m
memory: 60Mi memory: 60Mi

View File

@@ -2,6 +2,8 @@ apiVersion: tekton.dev/v1
kind: PipelineRun kind: PipelineRun
metadata: metadata:
name: foreign-document-test name: foreign-document-test
labels:
pdb: protect
spec: spec:
timeouts: timeouts:
pipeline: "2h0m0s" pipeline: "2h0m0s"
@@ -62,7 +64,7 @@ spec:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: "296c1602f4827d75701663f614e09df933c15336" value: "dda7b690195b43e8b9859d1caf5dcbf48588ade1"
- name: pathInRepo - name: pathInRepo
value: task/git-clone/0.1/git-clone.yaml value: task/git-clone/0.1/git-clone.yaml
resolver: git resolver: git
@@ -101,35 +103,39 @@ spec:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: 296c1602f4827d75701663f614e09df933c15336 value: 9c6d3bc418dc2f54d73bdfa984bce3eb6c65fd60
- name: pathInRepo - name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml value: task/buildah-rootless-daemonless/0.1/buildah-rootless-daemonless.yaml
params: params:
- name: OUTPUT - name: OUTPUT
value: >- value: >-
type=image,"name=$(params.image-name):latest,$(params.image-name):$(tasks.fetch-repository.results.commit)",push=true,compression=zstd,compression-level=22,oci-mediatypes=true $(params.image-name):$(tasks.fetch-repository.results.commit)
- name: CONTEXT - name: CONTEXT
value: $(params.path-to-image-context) value: $(params.path-to-image-context)
- name: DOCKERFILE - name: DOCKERFILE
value: $(params.path-to-dockerfile) value: $(params.path-to-dockerfile)
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--opt" - "--target"
- "target=$(params.target-name)" - "$(params.target-name)"
- --import-cache - --cache-from
- "type=registry,ref=$(params.image-name):buildcache" - "$(params.image-name)-buildcache"
- --export-cache - --cache-to
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true" - "$(params.image-name)-buildcache"
- --opt - name: REGISTRIES_CONF
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- name: BUILDKITD_TOML
value: | value: |
debug = true unqualified-search-registries = ["docker.io"]
[registry."docker.io"]
mirrors = ["dockerhub.dockerhub.svc.cluster.local"] [[registry]]
[registry."dockerhub.dockerhub.svc.cluster.local"] location = "dockerhub.dockerhub.svc.cluster.local"
http = true insecure = true
insecure = true
[[registry]]
location = "docker.io"
[[registry.mirror]]
location = "dockerhub.dockerhub.svc.cluster.local" # Replace with your mirror URL
insecure = true
workspaces: workspaces:
- name: source - name: source
workspace: git-source workspace: git-source
@@ -176,7 +182,7 @@ spec:
- build-image - build-image
params: params:
- name: docker-image - name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])" value: "$(tasks.build-image.results.IMAGE_URL[0])"
finally: finally:
- name: report-success - name: report-success
when: when:
@@ -273,7 +279,7 @@ spec:
workspace: cargo-cache workspace: cargo-cache
params: params:
- name: docker-image - name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])" value: "$(tasks.build-image.results.IMAGE_URL[0])"
workspaces: workspaces:
- name: git-source - name: git-source
- name: docker-credentials - name: docker-credentials
@@ -303,4 +309,4 @@ spec:
- name: path-to-image-context - name: path-to-image-context
value: docker/organic_test/ value: docker/organic_test/
- name: path-to-dockerfile - name: path-to-dockerfile
value: docker/organic_test/ value: docker/organic_test/Dockerfile

View File

@@ -2,6 +2,8 @@ apiVersion: tekton.dev/v1
kind: PipelineRun kind: PipelineRun
metadata: metadata:
name: rust-format name: rust-format
labels:
pdb: protect
spec: spec:
timeouts: timeouts:
pipeline: "2h0m0s" pipeline: "2h0m0s"
@@ -62,7 +64,7 @@ spec:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: "296c1602f4827d75701663f614e09df933c15336" value: "dda7b690195b43e8b9859d1caf5dcbf48588ade1"
- name: pathInRepo - name: pathInRepo
value: task/git-clone/0.1/git-clone.yaml value: task/git-clone/0.1/git-clone.yaml
resolver: git resolver: git
@@ -101,7 +103,7 @@ spec:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: 296c1602f4827d75701663f614e09df933c15336 value: dda7b690195b43e8b9859d1caf5dcbf48588ade1
- name: pathInRepo - name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params: params:

View File

@@ -2,6 +2,8 @@ apiVersion: tekton.dev/v1
kind: PipelineRun kind: PipelineRun
metadata: metadata:
name: rust-clippy name: rust-clippy
labels:
pdb: protect
spec: spec:
taskRunTemplate: taskRunTemplate:
serviceAccountName: build-bot serviceAccountName: build-bot
@@ -62,7 +64,7 @@ spec:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: "296c1602f4827d75701663f614e09df933c15336" value: "dda7b690195b43e8b9859d1caf5dcbf48588ade1"
- name: pathInRepo - name: pathInRepo
value: task/git-clone/0.1/git-clone.yaml value: task/git-clone/0.1/git-clone.yaml
resolver: git resolver: git
@@ -101,7 +103,7 @@ spec:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: 296c1602f4827d75701663f614e09df933c15336 value: dda7b690195b43e8b9859d1caf5dcbf48588ade1
- name: pathInRepo - name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params: params:

View File

@@ -2,6 +2,8 @@ apiVersion: tekton.dev/v1
kind: PipelineRun kind: PipelineRun
metadata: metadata:
name: rust-test name: rust-test
labels:
pdb: protect
spec: spec:
timeouts: timeouts:
pipeline: "2h0m0s" pipeline: "2h0m0s"
@@ -62,7 +64,7 @@ spec:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: "296c1602f4827d75701663f614e09df933c15336" value: "dda7b690195b43e8b9859d1caf5dcbf48588ade1"
- name: pathInRepo - name: pathInRepo
value: task/git-clone/0.1/git-clone.yaml value: task/git-clone/0.1/git-clone.yaml
resolver: git resolver: git
@@ -101,7 +103,7 @@ spec:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: 296c1602f4827d75701663f614e09df933c15336 value: dda7b690195b43e8b9859d1caf5dcbf48588ade1
- name: pathInRepo - name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params: params:

View File

@@ -1,31 +1,31 @@
version = "0.0.1" version = "0.0.1"
[[push]] # [[push]]
name = "rust-test" # name = "rust-test"
source = "pipeline-rust-test.yaml" # source = "pipeline-rust-test.yaml"
clone_uri = "git@code.fizz.buzz:talexander/organic.git" # clone_uri = "git@code.fizz.buzz:talexander/organic.git"
skip_branches = [ "^v[0-9]+\\.[0-9]+\\.[0-9]+$" ] # skip_branches = [ "^v[0-9]+\\.[0-9]+\\.[0-9]+$" ]
[[push]] [[push]]
name = "foreign-document-test" name = "foreign-document-test"
source = "pipeline-foreign-document-test.yaml" source = "pipeline-foreign-document-test.yaml"
clone_uri = "git@code.fizz.buzz:talexander/organic.git" clone_uri = "git@code.fizz.buzz:talexander/organic.git"
branches = [ "^main$", "^master$" ] branches = [ "^main$", "^master$", "^buildah$" ]
[[push]] # [[push]]
name = "clippy" # name = "clippy"
source = "pipeline-rust-clippy.yaml" # source = "pipeline-rust-clippy.yaml"
clone_uri = "git@code.fizz.buzz:talexander/organic.git" # clone_uri = "git@code.fizz.buzz:talexander/organic.git"
skip_branches = [ "^v[0-9]+\\.[0-9]+\\.[0-9]+$" ] # skip_branches = [ "^v[0-9]+\\.[0-9]+\\.[0-9]+$" ]
[[push]] # [[push]]
name = "format" # name = "format"
source = "pipeline-format.yaml" # source = "pipeline-format.yaml"
clone_uri = "git@code.fizz.buzz:talexander/organic.git" # clone_uri = "git@code.fizz.buzz:talexander/organic.git"
skip_branches = [ "^v[0-9]+\\.[0-9]+\\.[0-9]+$" ] # skip_branches = [ "^v[0-9]+\\.[0-9]+\\.[0-9]+$" ]
[[push]] # [[push]]
name = "build" # name = "build"
source = "pipeline-build-hash.yaml" # source = "pipeline-build-hash.yaml"
clone_uri = "git@code.fizz.buzz:talexander/organic.git" # clone_uri = "git@code.fizz.buzz:talexander/organic.git"
branches = [ "^main$", "^master$" ] # branches = [ "^main$", "^master$" ]

View File

@@ -17,15 +17,27 @@ RUN apk add --no-cache build-base musl-dev git autoconf make texinfo gnutls-dev
FROM build AS build-emacs FROM build AS build-emacs
ARG EMACS_VERSION
ARG EMACS_REPO ARG EMACS_REPO
RUN git clone --depth 1 --branch $EMACS_VERSION $EMACS_REPO /root/emacs ARG EMACS_VERSION
RUN <<EOF
set -euo pipefail
IFS=$'\n\t'
mkdir -p /root/emacs
git -C /root/emacs init --initial-branch=main
git -C /root/emacs remote add origin $EMACS_REPO
git -C /root/emacs fetch origin $EMACS_VERSION
git -C /root/emacs checkout FETCH_HEAD
EOF
#ADD "$EMACS_REPO#$EMACS_VERSION" /root/emacs
WORKDIR /root/emacs WORKDIR /root/emacs
RUN mkdir /root/dist RUN <<EOF
RUN ./autogen.sh mkdir /root/dist
RUN ./configure --prefix /usr --without-x --without-sound --with-native-compilation=aot ./autogen.sh
RUN make ./configure --prefix /usr --without-x --without-sound --with-native-compilation=aot
RUN make DESTDIR="/root/dist" install make
make DESTDIR="/root/dist" install
EOF
FROM build AS build-org-mode FROM build AS build-org-mode
@@ -37,8 +49,10 @@ RUN mkdir /root/dist
RUN git clone $ORG_MODE_REPO /root/org-mode && git -C /root/org-mode checkout $ORG_VERSION RUN git clone $ORG_MODE_REPO /root/org-mode && git -C /root/org-mode checkout $ORG_VERSION
# RUN mkdir /root/org-mode && git -C /root/org-mode init --initial-branch=main && git -C /root/org-mode remote add origin $ORG_REPO && git -C /root/org-mode fetch origin $ORG_VERSION && git -C /root/org-mode checkout FETCH_HEAD # RUN mkdir /root/org-mode && git -C /root/org-mode init --initial-branch=main && git -C /root/org-mode remote add origin $ORG_REPO && git -C /root/org-mode fetch origin $ORG_VERSION && git -C /root/org-mode checkout FETCH_HEAD
WORKDIR /root/org-mode WORKDIR /root/org-mode
RUN make compile RUN <<EOF
RUN make DESTDIR="/root/dist" install make compile
make DESTDIR="/root/dist" install
EOF
FROM rustlang/rust:nightly-alpine$ALPINE_VERSION AS tester FROM rustlang/rust:nightly-alpine$ALPINE_VERSION AS tester
@@ -118,8 +132,10 @@ RUN mkdir -p $LITERATE_BUILD_EMACS_PATH && git -C $LITERATE_BUILD_EMACS_PATH ini
RUN rm $LITERATE_BUILD_EMACS_PATH/unused/aws.org RUN rm $LITERATE_BUILD_EMACS_PATH/unused/aws.org
FROM tester as foreign-document FROM tester as foreign-document
RUN apk add --no-cache bash coreutils RUN <<EOF
RUN mkdir /foreign_documents apk add --no-cache bash coreutils
mkdir /foreign_documents
EOF
COPY --link --from=foreign-document-gather /foreign_documents/howardabrams /foreign_documents/howardabrams COPY --link --from=foreign-document-gather /foreign_documents/howardabrams /foreign_documents/howardabrams
COPY --link --from=foreign-document-gather /foreign_documents/doomemacs /foreign_documents/doomemacs COPY --link --from=foreign-document-gather /foreign_documents/doomemacs /foreign_documents/doomemacs
COPY --link --from=foreign-document-gather /foreign_documents/worg /foreign_documents/worg COPY --link --from=foreign-document-gather /foreign_documents/worg /foreign_documents/worg

143
flake.nix
View File

@@ -35,9 +35,9 @@
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system overlays; inherit system overlays;
}; };
rustToolchain = rustToolchain = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override {
(pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override targets = [ "wasm32-unknown-unknown" ];
{ targets = [ "wasm32-unknown-unknown" ]; }; };
in in
{ {
default = pkgs.mkShell { default = pkgs.mkShell {
@@ -57,43 +57,10 @@
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system overlays; inherit system overlays;
}; };
build_wasm = appliedOverlay = self.overlays.default pkgs pkgs;
{
bindgenTarget ? null,
}:
(pkgs.callPackage ./nix/package.nix {
targetBins = [
"wasm"
];
features = [ "wasm" ];
cargoBuildTarget = "wasm32-unknown-unknown";
buildType = "wasm";
}).overrideAttrs
(
old:
let
bindgen_command = [
"${pkgs.wasm-bindgen-cli}/bin/wasm-bindgen"
"--target"
bindgenTarget
"--out-dir"
"target/wasm32-unknown-unknown/${bindgenTarget}"
"target/wasm32-unknown-unknown/wasm/wasm.wasm"
];
in
{
postBuild = ''
${pkgs.lib.escapeShellArgs bindgen_command}
'';
installPhase = ''
mkdir -p $out/share/${bindgenTarget}
cp target/wasm32-unknown-unknown/${bindgenTarget}/* $out/share/${bindgenTarget}
'';
}
);
in in
rec { rec {
default = all;
all = pkgs.symlinkJoin { all = pkgs.symlinkJoin {
name = "all"; name = "all";
paths = [ paths = [
@@ -103,37 +70,93 @@
wasm_web wasm_web
]; ];
}; };
library = (pkgs.callPackage ./nix/package.nix { buildLib = true; }).overrideAttrs ( inherit (appliedOverlay.organic)
old: library
let devTools
in wasm_bundler
{ wasm_web
installPhase = '' ;
mkdir -p $out/lib
cp target/*/release/liborganic.rlib $out/lib/
'';
}
);
devTools = pkgs.callPackage ./nix/package.nix {
targetBins = [
"parse"
"compare"
];
features = [ "compare" ];
};
wasm_bundler = build_wasm { bindgenTarget = "bundler"; };
wasm_web = build_wasm { bindgenTarget = "web"; };
docker_env = pkgs.buildEnv { docker_env = pkgs.buildEnv {
name = "organic"; name = "organic";
paths = with pkgs; [ paths = with pkgs; [
devTools appliedOverlay.organic.devTools
bash bash
uutils-coreutils-noprefix uutils-coreutils-noprefix
# toybox # Smaller than uutils-coreutils? # toybox # Smaller than uutils-coreutils?
]; ];
}; };
default = all;
} }
); );
overlays.default = final: prev: {
organic = final.lib.makeScope final.newScope (
organicScope:
let
build_wasm =
{
bindgenTarget ? null,
}:
(organicScope.callPackage ./nix/package.nix {
inherit rust-overlay;
targetBins = [
"wasm"
];
features = [ "wasm" ];
cargoBuildTarget = "wasm32-unknown-unknown";
buildType = "wasm";
}).overrideAttrs
(
old:
let
bindgen_command = [
"${final.wasm-bindgen-cli}/bin/wasm-bindgen"
"--target"
bindgenTarget
"--out-dir"
"target/wasm32-unknown-unknown/${bindgenTarget}"
"target/wasm32-unknown-unknown/wasm/wasm.wasm"
];
in
{
postBuild = ''
${final.lib.escapeShellArgs bindgen_command}
'';
installPhase = ''
mkdir -p $out/share/${bindgenTarget}
cp target/wasm32-unknown-unknown/${bindgenTarget}/* $out/share/${bindgenTarget}
'';
}
);
in
{
library =
(organicScope.callPackage ./nix/package.nix {
inherit rust-overlay;
buildLib = true;
}).overrideAttrs
(
old:
let
in
{
installPhase = ''
mkdir -p $out/lib
cp target/*/release/liborganic.rlib $out/lib/
'';
}
);
devTools = organicScope.callPackage ./nix/package.nix {
inherit rust-overlay;
targetBins = [
"parse"
"compare"
];
features = [ "compare" ];
};
wasm_bundler = build_wasm { bindgenTarget = "bundler"; };
wasm_web = build_wasm { bindgenTarget = "web"; };
}
);
};
}; };
} }

View File

@@ -1,8 +1,8 @@
{ {
hello, hello,
lib, lib,
makeRustPlatform, pkgs,
pkgsBuildHost, rust-overlay,
targetBins ? [ ], targetBins ? [ ],
features ? [ ], features ? [ ],
@@ -12,34 +12,41 @@
}: }:
let let
cargoToml = (lib.importTOML ../Cargo.toml); cargoToml = (lib.importTOML ../Cargo.toml);
rustToolchain = (pkgsBuildHost.rust-bin.fromRustupToolchainFile ../rust-toolchain.toml).override ( rustPlatformFor =
if cargoBuildTarget != null then pkgs:
{ let
targets = [ cargoBuildTarget ]; rust-bin = rust-overlay.lib.mkRustBin { } pkgs;
} rustToolchain = (rust-bin.fromRustupToolchainFile ../rust-toolchain.toml).override (
else if cargoBuildTarget != null then
{ } {
); targets = [ cargoBuildTarget ];
baseRustPlatform = ( }
makeRustPlatform { else
cargo = rustToolchain; { }
rustc = rustToolchain; );
} baseRustPlatform = (
); pkgs.makeRustPlatform {
rustPlatform = cargo = rustToolchain;
if cargoBuildTarget != null then rustc = rustToolchain;
baseRustPlatform.overrideScope (
final: prev: {
cargoBuildHook = prev.cargoBuildHook.overrideDerivation (_: {
rustcTargetSpec = cargoBuildTarget;
});
cargoInstallHook = hello;
} }
) );
else rustPlatform =
baseRustPlatform; if cargoBuildTarget != null then
baseRustPlatform.overrideScope (
final: prev: {
cargoBuildHook = prev.cargoBuildHook.overrideDerivation (_: {
rustcTargetSpec = cargoBuildTarget;
});
cargoInstallHook = hello;
}
)
else
baseRustPlatform;
in
rustPlatform;
in in
rustPlatform.buildRustPackage ( (rustPlatformFor pkgs).buildRustPackage (
# rustPlatform.buildRustPackage (
{ {
pname = "organic"; pname = "organic";
version = cargoToml.package.version; version = cargoToml.package.version;

View File

@@ -1,4 +1,4 @@
[toolchain] [toolchain]
channel = "nightly" channel = "nightly-2026-05-23"
profile = "default" profile = "default"
components = ["clippy", "rustfmt"] components = ["clippy", "rustfmt"]