7 Commits

Author SHA1 Message Date
Tom Alexander
9fde1c8989 Fix tekton pipelines. 2026-06-19 00:03:14 -04:00
Tom Alexander
27342b0a44 Merge branch 'nix' 2026-06-18 23:49:09 -04:00
Tom Alexander
76ecd25002 Add support for building organic via nix. 2026-06-18 23:16:57 -04:00
Tom Alexander
482d5ecfa3 Switch to local-path-provisioner.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
foreign-document-test Build foreign-document-test has succeeded
2025-08-31 19:51:03 -04:00
Tom Alexander
84b8ddb582 Merge branch 'add_jump_to_line_number' 2025-02-01 21:55:43 -05:00
Tom Alexander
113bb5888a Add a test with a tramp link.
Some checks failed
rust-test Build rust-test has started
format Build format has succeeded
clippy Build clippy has failed
2025-02-01 19:19:05 -05:00
Tom Alexander
bf5fe6920b Add a test for jump to line number.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has failed
2025-02-01 18:42:10 -05:00
14 changed files with 1726 additions and 15 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,3 @@
/target
Cargo.lock
TODO.org
/result

View File

@@ -677,7 +677,7 @@ spec:
- name: git-source
volumeClaimTemplate:
spec:
storageClassName: "nfs-client"
storageClassName: "local-path"
accessModes:
- ReadWriteOnce
resources:

View File

@@ -277,7 +277,7 @@ spec:
- name: git-source
volumeClaimTemplate:
spec:
storageClassName: "nfs-client"
storageClassName: "local-path"
accessModes:
- ReadWriteOnce
resources:

View File

@@ -54,11 +54,13 @@ spec:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
value: https://code.fizz.buzz/mirror/git-clone.git # mirror of https://github.com/tektoncd-catalog/git-clone.git
# - name: revision
# value: c3498c69cf6de9583e1c667e723fd8626af1b33c
- name: ref
value: "v1.7.0"
- name: pathInRepo
value: task/git-clone/0.9/git-clone.yaml
value: task/git-clone/git-clone.yaml
workspaces:
- name: output
workspace: git-source
@@ -310,7 +312,7 @@ spec:
- name: git-source
volumeClaimTemplate:
spec:
storageClassName: "nfs-client"
storageClassName: "local-path"
accessModes:
- ReadWriteOnce
resources:

View File

@@ -289,7 +289,7 @@ spec:
- name: git-source
volumeClaimTemplate:
spec:
storageClassName: "nfs-client"
storageClassName: "local-path"
accessModes:
- ReadWriteOnce
resources:

View File

@@ -288,7 +288,7 @@ spec:
- name: git-source
volumeClaimTemplate:
spec:
storageClassName: "nfs-client"
storageClassName: "local-path"
accessModes:
- ReadWriteOnce
resources:

1446
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
# cargo-features = ["profile-rustflags"]
cargo-features = ["codegen-backend"]
[package]
name = "organic"
@@ -104,9 +103,5 @@ inherits = "release"
lto = true
strip = true
[profile.dev]
codegen-backend = "cranelift"
[profile.dev.package."*"]
codegen-backend = "llvm"
opt-level = 3

48
flake.lock generated Normal file
View File

@@ -0,0 +1,48 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1780749050,
"narHash": "sha256-3av0pIjlOWQ6rDbNOmpUSvbNnJkGORQKKjb4LtCZsIY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a799d3e3886da994fa307f817a6bc705ae538eeb",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1781407245,
"narHash": "sha256-VzJq4MmD0uyNDAceudSe1hHqcQMe9Tau0U4S+5iRGh0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d5f483210eb016d66102eef22baa128b3b3233fc",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

139
flake.nix Normal file
View File

@@ -0,0 +1,139 @@
{
description = "Organic Org parser";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs =
{
self,
nixpkgs,
rust-overlay,
}:
let
forAllSystems =
func:
builtins.listToAttrs (
map (system: {
name = system;
value = func system;
}) nixpkgs.lib.systems.flakeExposed
);
in
{
devShells = forAllSystems (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain =
(pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override
{ targets = [ "wasm32-unknown-unknown" ]; };
in
{
default = pkgs.mkShell {
nativeBuildInputs = [
rustToolchain
];
buildInputs = with pkgs; [
wasm-bindgen-cli
];
};
}
);
packages = forAllSystems (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
build_wasm =
{
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
rec {
all = pkgs.symlinkJoin {
name = "all";
paths = [
library
devTools
wasm_bundler
wasm_web
];
};
library = (pkgs.callPackage ./nix/package.nix { buildLib = true; }).overrideAttrs (
old:
let
in
{
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 {
name = "organic";
paths = with pkgs; [
devTools
bash
uutils-coreutils-noprefix
# toybox # Smaller than uutils-coreutils?
];
};
default = all;
}
);
};
}

75
nix/package.nix Normal file
View File

@@ -0,0 +1,75 @@
{
hello,
lib,
makeRustPlatform,
pkgsBuildHost,
targetBins ? [ ],
features ? [ ],
cargoBuildTarget ? null,
buildType ? null,
buildLib ? false,
}:
let
cargoToml = (lib.importTOML ../Cargo.toml);
rustToolchain = (pkgsBuildHost.rust-bin.fromRustupToolchainFile ../rust-toolchain.toml).override (
if cargoBuildTarget != null then
{
targets = [ cargoBuildTarget ];
}
else
{ }
);
baseRustPlatform = (
makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
}
);
rustPlatform =
if cargoBuildTarget != null then
baseRustPlatform.overrideScope (
final: prev: {
cargoBuildHook = prev.cargoBuildHook.overrideDerivation (_: {
rustcTargetSpec = cargoBuildTarget;
});
cargoInstallHook = hello;
}
)
else
baseRustPlatform;
in
rustPlatform.buildRustPackage (
{
pname = "organic";
version = cargoToml.package.version;
src = lib.cleanSource ../.;
cargoLock.lockFile = ../Cargo.lock;
cargoBuildFlags = builtins.concatLists [
(builtins.concatMap (targetBin: [
"--bin"
targetBin
]) targetBins)
(if buildLib then [ "--lib" ] else [ ])
(
if features != [ ] then
[
"--features"
(builtins.concatStringsSep " " features)
]
else
[ ]
)
];
}
// (
if buildType != null then
{
buildType = buildType;
}
else
{ }
)
)

View File

@@ -0,0 +1 @@
[[file:simple.org::2]]

View File

@@ -0,0 +1 @@
[[/ssh:admin@test.example:important/file.pdf]]

4
rust-toolchain.toml Normal file
View File

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