Skip to content

Commit b831d95

Browse files
authored
Bump (#1253)
* bump Signed-off-by: Jess Frazelle <[email protected]> * updates Signed-off-by: Jess Frazelle <[email protected]> * updates Signed-off-by: Jess Frazelle <[email protected]> * updates Signed-off-by: Jess Frazelle <[email protected]> --------- Signed-off-by: Jess Frazelle <[email protected]>
1 parent 75ee7ee commit b831d95

File tree

10 files changed

+170
-72
lines changed

10 files changed

+170
-72
lines changed

.github/workflows/nix.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Test Nix Flake
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
jobs:
13+
nix-flake-check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- uses: cachix/install-nix-action@v31
21+
with:
22+
nix_path: nixpkgs=channel:nixos-unstable
23+
24+
- name: nix flake check for all platforms
25+
run: |
26+
nix flake check --all-systems
27+
28+
nix-build-linux:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
submodules: recursive
34+
35+
- uses: cachix/install-nix-action@v31
36+
with:
37+
nix_path: nixpkgs=channel:nixos-unstable
38+
39+
- name: nix build . for x86_64-linux
40+
run: nix build .
41+
42+
nix-build-macos:
43+
runs-on: macos-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
with:
47+
submodules: recursive
48+
49+
- uses: cachix/install-nix-action@v31
50+
with:
51+
nix_path: nixpkgs=channel:nixos-unstable
52+
53+
- name: nix build . for x86_64-darwin
54+
run: nix build .
55+

Cargo.lock

Lines changed: 16 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "zoo"
3-
version = "0.2.109"
3+
version = "0.2.110"
44
edition = "2021"
55
build = "build.rs"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -22,9 +22,9 @@ git_rev = "0.1.0"
2222
heck = "0.5.0"
2323
http = "1"
2424
itertools = "0.12.1"
25-
kcl-lib = { version = "0.2.64", features = ["disable-println"] }
25+
kcl-lib = { version = "0.2.65", features = ["disable-println"] }
2626
#kcl-lib = { path = "../modeling-app/src/wasm-lib/kcl" }
27-
kcl-test-server = "0.1.64"
27+
kcl-test-server = "0.1.65"
2828
kittycad = { version = "0.3.34", features = ["clap", "tabled", "requests", "retry"] }
2929
kittycad-modeling-cmds = { version = "0.2.107", features = ["websocket", "convert_client_crate", "tabled"] }
3030
log = "0.4.27"

flake.nix

Lines changed: 73 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,86 @@
22
description = "cli development environment";
33

44
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
66
rust-overlay.url = "github:oxalica/rust-overlay";
7-
flake-utils.url = "github:numtide/flake-utils";
7+
naersk.url = "github:nix-community/naersk";
88
};
99

1010
outputs = {
1111
self,
1212
nixpkgs,
1313
rust-overlay,
14-
flake-utils,
15-
...
16-
}:
17-
flake-utils.lib.eachDefaultSystem (
18-
system: let
19-
overlays = [
20-
(import rust-overlay)
21-
(self: super: {
22-
rustToolchain = super.rust-bin.stable.latest.default.override {
23-
extensions = ["rustfmt" "clippy" "rust-src"];
24-
};
25-
26-
# stand-alone nightly formatter so we get the fancy unstable flags
27-
nightlyRustfmt = super.rust-bin.selectLatestNightlyWith (toolchain:
28-
toolchain.default.override {
29-
extensions = ["rustfmt"]; # just the formatter
30-
});
31-
})
32-
];
33-
pkgs = import nixpkgs {
34-
inherit system overlays;
14+
naersk,
15+
}: let
16+
overlays = [
17+
(import rust-overlay)
18+
(self: super: {
19+
rustToolchain = super.rust-bin.stable.latest.default.override {
20+
targets = ["wasm32-unknown-unknown"];
21+
extensions = ["rustfmt" "llvm-tools-preview" "rust-src"];
3522
};
36-
in {
37-
devShells.default = with pkgs;
38-
mkShell {
39-
nativeBuildInputs =
40-
(with pkgs; [
41-
rustToolchain
42-
nightlyRustfmt
43-
cargo-sort
44-
toml-cli
45-
openssl
46-
postgresql
47-
pkg-config
48-
])
49-
++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
50-
]);
51-
52-
RUSTFMT = "${pkgs.nightlyRustfmt}/bin/rustfmt";
23+
24+
# stand-alone nightly formatter so we get the fancy unstable flags
25+
nightlyRustfmt = super.rust-bin.selectLatestNightlyWith (toolchain:
26+
toolchain.default.override {
27+
extensions = ["rustfmt"]; # just the formatter
28+
});
29+
})
30+
];
31+
32+
allSystems = [
33+
"x86_64-linux"
34+
"aarch64-linux"
35+
"x86_64-darwin"
36+
"aarch64-darwin"
37+
];
38+
39+
forAllSystems = f:
40+
nixpkgs.lib.genAttrs allSystems (system:
41+
f {
42+
pkgs = import nixpkgs {
43+
inherit overlays system;
5344
};
54-
}
55-
);
45+
system = system;
46+
});
47+
in {
48+
devShells = forAllSystems ({pkgs, ...}: {
49+
default = pkgs.mkShell {
50+
packages =
51+
(with pkgs; [
52+
rustToolchain
53+
nightlyRustfmt
54+
cargo-sort
55+
toml-cli
56+
openssl
57+
postgresql
58+
pkg-config
59+
])
60+
++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
61+
]);
62+
63+
RUSTFMT = "${pkgs.nightlyRustfmt}/bin/rustfmt";
64+
};
65+
});
66+
67+
packages = forAllSystems ({
68+
pkgs,
69+
system,
70+
}: let
71+
naersk-lib = pkgs.callPackage naersk {
72+
cargo = pkgs.rustToolchain;
73+
rustc = pkgs.rustToolchain;
74+
};
75+
in {
76+
zoo = naersk-lib.buildPackage {
77+
pname = "zoo";
78+
version = "0.1.0";
79+
release = true;
80+
src = ./.;
81+
82+
buildInputs = [pkgs.openssl pkgs.pkg-config];
83+
};
84+
default = self.packages.${system}.zoo;
85+
});
86+
};
5687
}

tests/a_2x4_lego_brick.png

6.99 KB
Loading

tests/assembly-edit/main.kcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import "cube.gltf" as cube
22

33
model = cube
4+
|> appearance(color = '#0000ff')

tests/gear.kcl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pitchDiameter = module * nTeeth
1111
pressureAngle = 20
1212
addendum = module
1313
deddendum = 1.25 * module
14-
baseDiameter = pitchDiameter * cos(toRadians(pressureAngle))
14+
baseDiameter = pitchDiameter * cos(pressureAngle)
1515
tipDiameter = pitchDiameter + 2 * module
1616
gearHeight = 3
1717

@@ -28,15 +28,15 @@ rs = map(
2828
angles = map(
2929
rs,
3030
f = fn(r) {
31-
return toDegrees( acos(baseDiameter / 2 / r))
31+
return units::toDegrees( acos(baseDiameter / 2 / r))
3232
},
3333
)
3434

3535
// Calculate the involute function
3636
invas = map(
3737
angles,
3838
f = fn(a) {
39-
return tan(toRadians(a)) - toRadians(a)
39+
return tan(a) - units::toRadians(a)
4040
},
4141
)
4242

@@ -69,8 +69,8 @@ fn leftInvolute(i, sg) {
6969
}
7070

7171
fn rightInvolute(i, sg) {
72-
x = rs[i] * cos(toRadians(-toothAngle + toDegrees(atan(ys[i] / xs[i]))))
73-
y = -rs[i] * sin(toRadians(-toothAngle + toDegrees(atan(ys[i] / xs[i]))))
72+
x = rs[i] * cos(-toothAngle + units::toDegrees(atan(ys[i] / xs[i])))
73+
y = -rs[i] * sin(-toothAngle + units::toDegrees(atan(ys[i] / xs[i])))
7474
return line(sg, endAbsolute = [x, y])
7575
}
7676

@@ -106,7 +106,7 @@ keyWay = startSketchOn(body, face = END)
106106
|> xLine(length = keywayDepth)
107107
|> yLine(length = -keywayWidth)
108108
|> xLine(length = -keywayDepth)
109-
|> arc(angleStart = -1 * toDegrees(startAngle) + 360, angleEnd = 180, radius = holeRadius)
110-
|> arc(angleStart = 180, angleEnd = toDegrees(startAngle), radius = holeRadius)
109+
|> arc(angleStart = -1 * units::toDegrees(startAngle) + 360, angleEnd = 180, radius = holeRadius)
110+
|> arc(angleStart = 180, angleEnd = units::toDegrees(startAngle), radius = holeRadius)
111111
|> close()
112112
|> extrude(length = -gearHeight)

tests/nested-settings/subdir/gear.kcl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pitchDiameter = module * nTeeth
1111
pressureAngle = 20
1212
addendum = module
1313
deddendum = 1.25 * module
14-
baseDiameter = pitchDiameter * cos(toRadians(pressureAngle))
14+
baseDiameter = pitchDiameter * cos(pressureAngle)
1515
tipDiameter = pitchDiameter + 2 * module
1616
gearHeight = 3
1717

@@ -28,15 +28,15 @@ rs = map(
2828
angles = map(
2929
rs,
3030
f = fn(r) {
31-
return toDegrees( acos(baseDiameter / 2 / r))
31+
return units::toDegrees( acos(baseDiameter / 2 / r))
3232
},
3333
)
3434

3535
// Calculate the involute function
3636
invas = map(
3737
angles,
3838
f = fn(a) {
39-
return tan(toRadians(a)) - toRadians(a)
39+
return tan(a) - units::toRadians(a)
4040
},
4141
)
4242

@@ -69,8 +69,8 @@ fn leftInvolute(i, sg) {
6969
}
7070

7171
fn rightInvolute(i, sg) {
72-
x = rs[i] * cos(toRadians(-toothAngle + toDegrees(atan(ys[i] / xs[i]))))
73-
y = -rs[i] * sin(toRadians(-toothAngle + toDegrees(atan(ys[i] / xs[i]))))
72+
x = rs[i] * cos(-toothAngle + units::toDegrees(atan(ys[i] / xs[i])))
73+
y = -rs[i] * sin(-toothAngle + units::toDegrees(atan(ys[i] / xs[i])))
7474
return line(sg, endAbsolute = [x, y])
7575
}
7676

@@ -106,7 +106,7 @@ keyWay = startSketchOn(body, face = END)
106106
|> xLine(length = keywayDepth)
107107
|> yLine(length = -keywayWidth)
108108
|> xLine(length = -keywayDepth)
109-
|> arc(angleStart = -1 * toDegrees(startAngle) + 360, angleEnd = 180, radius = holeRadius)
110-
|> arc(angleStart = 180, angleEnd = toDegrees(startAngle), radius = holeRadius)
109+
|> arc(angleStart = -1 * units::toDegrees(startAngle) + 360, angleEnd = 180, radius = holeRadius)
110+
|> arc(angleStart = 180, angleEnd = units::toDegrees(startAngle), radius = holeRadius)
111111
|> close()
112112
|> extrude(length = -gearHeight)

tests/parse_error.kcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const part001 = startSketchAt([0.0000000000, 5.0000000000])
1+
part001 = startSketchAt([0.0000000000, 5.0000000000])
22
|> line([0.4900857016, -0.0240763666], %)
33
|> line([0.6804562304, 0.9087880491], %)
44
|> line([0.5711661314, -0.1430696680], %)

0 commit comments

Comments
 (0)