Compare commits

...

12 Commits

Author SHA1 Message Date
7ddea61953 Clean up for review 2025-05-12 11:39:37 -04:00
3a5df99af8 Merge branch 'main' into pierremtb/issue6749-Change-nightly-builds-to-deploy-from-each-push-to-main-and-change-name 2025-05-12 08:13:34 -07:00
270436f404 Fix: clearSceneAndBustCache when rust panics because it can load a stale cache (#6809)
* fix: clear scene and bust cache if rust panics

* fix: pr clean up

* fix: huh? cargo fmt doesn't do this?
2025-05-12 10:08:54 -05:00
57e61632a9 Fix to remove extraneous from package.json (#6868) 2025-05-12 14:50:44 +00:00
884191b8bb Bump kcl (#6865) 2025-05-12 14:18:55 +00:00
21b92f5f13 fix cache multi-file (#6844)
* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* bump kittycad.rs i need this for cli

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* bump the version so i can fix cli

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* clippy

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-12 09:07:18 -05:00
bcab005098 Clean up VERSION_NO_V 2025-05-11 06:50:04 -04:00
4902eb08fc Try to upload to bucket 2025-05-10 19:44:44 -04:00
479a6de9cb Quick things 2025-05-10 19:07:25 -04:00
8581085e92 Quick fix 2025-05-10 16:22:30 -04:00
5bc18a01e0 Continued changes 2025-05-10 13:36:57 -04:00
24c46c70fe WIP: Change nightly builds to deploy from each push to main (and change name)
Fixes #6749
2025-05-10 13:15:55 -04:00
40 changed files with 240 additions and 206 deletions

View File

@ -7,11 +7,10 @@ on:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'nightly-v[0-9]+.[0-9]+.[0-9]+'
env:
IS_RELEASE: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
IS_NIGHTLY: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'nightly-v') }}
IS_STAGING: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@ -92,12 +91,16 @@ jobs:
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
run: "npm run build:wasm"
- name: Set nightly version, product name, release notes, and icons
if: ${{ env.IS_NIGHTLY == 'true' }}
- name: Set staging version, product name, release notes, and icons
if: ${{ env.IS_STAGING == 'true' }}
run: |
export VERSION=${GITHUB_REF_NAME#nightly-v}
COMMIT=$(git rev-parse --short HEAD)
DATE=$(date +'%-y.%-m.%-d')
# TODO: add commit count today on main
OFFSET=$(date +'%H%M')
export VERSION=$DATE-staging.$OFFSET+$COMMIT
npm run files:set-version
npm run files:flip-to-nightly
npm run files:flip-to-staging
- name: Set release version
if: ${{ env.IS_RELEASE == 'true' }}
@ -117,7 +120,7 @@ jobs:
assets/icon.png
- id: export_version
run: echo "version=`cat package.json | jq -r '.version'`" >> "$GITHUB_OUTPUT"
run: echo "version=`cat package.json | jq -r '.version' | cut -f1 -d"+"`" >> "$GITHUB_OUTPUT"
- id: export_notes
run: echo "notes=`cat release-notes.md`" >> "$GITHUB_OUTPUT"
@ -177,7 +180,7 @@ jobs:
- run: npm install
- name: Prepare certificate and variables (Windows only)
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
if: ${{ (env.IS_RELEASE == 'true' || env.IS_STAGING == 'true') && matrix.os == 'windows-2022' }}
run: |
echo "${{secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
cat /d/Certificate_pkcs12.p12
@ -192,7 +195,7 @@ jobs:
shell: bash
- name: Setup certicate with SSM KSP (Windows only)
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
if: ${{ (env.IS_RELEASE == 'true' || env.IS_STAGING == 'true') && matrix.os == 'windows-2022' }}
run: |
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o smtools-windows-x64.msi
msiexec /i smtools-windows-x64.msi /quiet /qn
@ -201,22 +204,17 @@ jobs:
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
smksp_cert_sync.exe
smctl windows certsync
# This last line `smctl windows certsync` was added after windows codesign failures started happening
# with nightly-v25.4.10. It looks like `smksp_cert_sync.exe` used to do the sync to the local cert store,
# but stopped doing it overnight. This extra call that I randomly got from this azure-related doc page
# https://docs.digicert.com/en/digicert-keylocker/code-signing/sign-with-third-party-signing-tools/windows-applications/sign-azure-apps-with-signtool-using-ksp-library.html#sync-certificates--windows-only--618365
# seems to be doing that extra sync that we need for scripts/sign-win.js to work.
# TODO: we still need to make sign-win.js errors fail the workflow, see issue #6276
shell: cmd
- name: Build the app (debug)
if: ${{ env.IS_RELEASE == 'false' && env.IS_NIGHTLY == 'false' }}
if: ${{ env.IS_RELEASE == 'false' && env.IS_STAGING == 'false' }}
# electron-builder doesn't have a concept of release vs debug,
# this is just not doing any codesign or release yml generation, and points to dev infra
run: npm run tronb:package:dev
- name: Build the app (release)
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
if: ${{ env.IS_RELEASE == 'true' || env.IS_STAGING == 'true' }}
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
@ -226,7 +224,7 @@ jobs:
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
run: npm run tronb:package:prod
run: npm run tronb:package:${{ env.IS_RELEASE == 'true' && 'prod' || 'dev' }}
- name: List artifacts in out/
run: ls -R out
@ -250,13 +248,13 @@ jobs:
out/*-x86_64-linux.*
- uses: actions/upload-artifact@v4
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
if: ${{ env.IS_RELEASE == 'true' || env.IS_STAGING == 'true' }}
with:
name: out-yml-${{ matrix.platform }}
path: |
out/latest*.yml
# TODO: add the 'Build for Mac TestFlight (nightly)' stage back
# TODO: add the 'Build for Mac TestFlight' stage back
# The steps below are for updater-test builds, only on release
@ -306,7 +304,8 @@ jobs:
runs-on: ubuntu-22.04
permissions:
contents: write
if: ${{ github.ref_type == 'tag' }}
# Equivalent to IS_RELEASE || IS_STAGING (but we can't access those env vars here)
if: ${{ github.ref_type == 'tag' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
env:
VERSION_NO_V: ${{ needs.prepare-files.outputs.version }}
VERSION: ${{ format('v{0}', needs.prepare-files.outputs.version) }}
@ -363,8 +362,8 @@ jobs:
env:
NOTES: ${{ needs.prepare-files.outputs.notes }}
PUB_DATE: ${{ github.event.repository.updated_at }}
WEBSITE_DIR: ${{ env.IS_NIGHTLY == 'true' && 'dl.zoo.dev/releases/modeling-app/nightly' || 'dl.zoo.dev/releases/modeling-app' }}
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Design%20Studio%20%28Nightly%29' || 'Zoo%20Design%20Studio' }}
WEBSITE_DIR: ${{ env.IS_STAGING == 'true' && 'dl.zoo.dev/releases/modeling-app/staging' || 'dl.zoo.dev/releases/modeling-app' }}
URL_CODED_NAME: ${{ env.IS_STAGING == 'true' && 'Zoo%20Design%20Studio%20%28Staging%29' || 'Zoo%20Design%20Studio' }}
run: |
RELEASE_DIR=https://${WEBSITE_DIR}
jq --null-input \
@ -412,38 +411,27 @@ jobs:
- name: List artifacts
run: "ls -R out"
- name: Set more complete nightly release notes
if: ${{ env.IS_NIGHTLY == 'true' }}
run: |
# Note: preferred going this way instead of a full clone in the checkout step,
# see https://github.com/actions/checkout/issues/1471
git fetch --prune --unshallow --tags
export TAG="nightly-${VERSION}"
export PREVIOUS_TAG=$(git tag --list --sort=-committerdate "nightly-v[0-9]*" | head -n2 | tail -n1)
export NOTES=$(./scripts/get-nightly-changelog.sh)
npm run files:set-notes
- name: Authenticate to Google Cloud
if: ${{ env.IS_NIGHTLY == 'true' }}
if: ${{ env.IS_STAGING == 'true' }}
uses: 'google-github-actions/auth@v2.1.8'
with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
- name: Set up Google Cloud SDK
if: ${{ env.IS_NIGHTLY == 'true' }}
if: ${{ env.IS_STAGING == 'true' }}
uses: google-github-actions/setup-gcloud@v2.1.4
with:
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
- name: Upload nightly files to public bucket
if: ${{ env.IS_NIGHTLY == 'true' }}
- name: Upload staging files to public bucket
if: ${{ env.IS_STAGING == 'true' }}
uses: google-github-actions/upload-cloud-storage@v2.2.2
with:
path: out
glob: '*'
parent: false
destination: 'dl.kittycad.io/releases/modeling-app/nightly'
destination: 'dl.kittycad.io/releases/modeling-app/staging'
- name: Invalidate bucket cache on latest*.yml and last_download.json files
if: ${{ env.IS_NIGHTLY == 'true' }}
run: npm run files:invalidate-bucket:nightly
if: ${{ env.IS_STAGING == 'true' }}
run: npm run files:invalidate-bucket:staging

View File

@ -1,39 +0,0 @@
name: tag-nightly
permissions:
contents: write
on:
schedule:
- cron: '0 4 * * *'
# Daily at 04:00 AM UTC
# Will checkout the last commit from the default branch (main as of 2023-10-04)
jobs:
tag-nightly:
runs-on: ubuntu-22.04
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: npm install
- name: Push tag
run: |
VERSION_NO_V=$(date +'%-y.%-m.%-d')
TAG="nightly-v$VERSION_NO_V"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag $TAG
git push origin tag $TAG

View File

@ -42,8 +42,6 @@ The 3D view in Design Studio is just a video stream from our hosted geometry eng
We recommend downloading the latest application binary from our [releases](https://github.com/KittyCAD/modeling-app/releases) page. If you don't see your platform or architecture supported there, please file an issue.
If you'd like to try out upcoming changes sooner, you can also download those from our [nightly releases](https://zoo.dev/modeling-app/download/nightly) page.
## Developing
Finally, if you'd like to run a development build or contribute to the project, please visit our [contributor guide](CONTRIBUTING.md) to get started.

View File

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

View File

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 259 KiB

View File

@ -117,10 +117,10 @@
"circular-deps:diff:nodejs": "npm run circular-deps:diff || node ./scripts/diff.js",
"files:set-version": "echo \"$(jq --arg v \"$VERSION\" '.version=$v' package.json --indent 2)\" > package.json",
"files:set-notes": "./scripts/set-files-notes.sh",
"files:flip-to-nightly": "./scripts/flip-files-to-nightly.sh",
"files:flip-to-nightly:windows": "powershell -ExecutionPolicy Bypass -File ./scripts/flip-files-to-nightly.ps1",
"files:flip-to-staging": "./scripts/flip-files-to-staging.sh",
"files:flip-to-staging:windows": "powershell -ExecutionPolicy Bypass -File ./scripts/flip-files-to-staging.ps1",
"files:invalidate-bucket": "./scripts/invalidate-files-bucket.sh",
"files:invalidate-bucket:nightly": "./scripts/invalidate-files-bucket.sh --nightly",
"files:invalidate-bucket:staging": "./scripts/invalidate-files-bucket.sh --staging",
"postinstall": "electron-rebuild",
"generate:machine-api": "npx openapi-typescript ./openapi/machine-api.json -o src/lib/machine-api.d.ts",
"generate:samples-manifest": "cd public/kcl-samples && node generate-manifest.js",

24
rust/Cargo.lock generated
View File

@ -1815,7 +1815,7 @@ dependencies = [
[[package]]
name = "kcl-bumper"
version = "0.1.68"
version = "0.1.69"
dependencies = [
"anyhow",
"clap",
@ -1826,7 +1826,7 @@ dependencies = [
[[package]]
name = "kcl-derive-docs"
version = "0.1.68"
version = "0.1.69"
dependencies = [
"Inflector",
"anyhow",
@ -1845,7 +1845,7 @@ dependencies = [
[[package]]
name = "kcl-directory-test-macro"
version = "0.1.68"
version = "0.1.69"
dependencies = [
"proc-macro2",
"quote",
@ -1854,7 +1854,7 @@ dependencies = [
[[package]]
name = "kcl-language-server"
version = "0.2.68"
version = "0.2.69"
dependencies = [
"anyhow",
"clap",
@ -1875,7 +1875,7 @@ dependencies = [
[[package]]
name = "kcl-language-server-release"
version = "0.1.68"
version = "0.1.69"
dependencies = [
"anyhow",
"clap",
@ -1895,7 +1895,7 @@ dependencies = [
[[package]]
name = "kcl-lib"
version = "0.2.68"
version = "0.2.69"
dependencies = [
"anyhow",
"approx 0.5.1",
@ -1970,7 +1970,7 @@ dependencies = [
[[package]]
name = "kcl-python-bindings"
version = "0.3.68"
version = "0.3.69"
dependencies = [
"anyhow",
"kcl-lib",
@ -1985,7 +1985,7 @@ dependencies = [
[[package]]
name = "kcl-test-server"
version = "0.1.68"
version = "0.1.69"
dependencies = [
"anyhow",
"hyper 0.14.32",
@ -1998,7 +1998,7 @@ dependencies = [
[[package]]
name = "kcl-to-core"
version = "0.1.68"
version = "0.1.69"
dependencies = [
"anyhow",
"async-trait",
@ -2012,7 +2012,7 @@ dependencies = [
[[package]]
name = "kcl-wasm-lib"
version = "0.1.68"
version = "0.1.69"
dependencies = [
"anyhow",
"bson",
@ -2042,9 +2042,9 @@ dependencies = [
[[package]]
name = "kittycad"
version = "0.3.36"
version = "0.3.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a345fd2a4cb16205f32bd1aa41715045830c59d78c59927fca6580e2a651ac9"
checksum = "b48a9698d68c791df76aa020b596c324177a614e38ff3dd67eedd04db76e222f"
dependencies = [
"anyhow",
"async-trait",

View File

@ -35,7 +35,7 @@ console_error_panic_hook = "0.1.7"
dashmap = { version = "6.1.0" }
http = "1"
indexmap = "2.9.0"
kittycad = { version = "0.3.36", default-features = false, features = ["js", "requests"] }
kittycad = { version = "0.3.37", default-features = false, features = ["js", "requests"] }
kittycad-modeling-cmds = { version = "0.2.117", features = ["ts-rs", "websocket"] }
lazy_static = "1.5.0"
miette = "7.5.0"

View File

@ -1,7 +1,7 @@
[package]
name = "kcl-bumper"
version = "0.1.68"
version = "0.1.69"
edition = "2021"
repository = "https://github.com/KittyCAD/modeling-api"
rust-version = "1.76"

View File

@ -1,7 +1,7 @@
[package]
name = "kcl-derive-docs"
description = "A tool for generating documentation from Rust derive macros"
version = "0.1.68"
version = "0.1.69"
edition = "2021"
license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -1,7 +1,7 @@
[package]
name = "kcl-directory-test-macro"
description = "A tool for generating tests from a directory of kcl files"
version = "0.1.68"
version = "0.1.69"
edition = "2021"
license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -1,6 +1,6 @@
[package]
name = "kcl-language-server-release"
version = "0.1.68"
version = "0.1.69"
edition = "2021"
authors = ["KittyCAD Inc <kcl@kittycad.io>"]
publish = false

View File

@ -42,7 +42,7 @@ impl Build {
.to_string();
if !stable {
version = format!("{}-nightly", version);
version = format!("{}-staging", version);
}
let release_tag = if stable {
@ -53,7 +53,7 @@ impl Build {
.replace("refs/tags/", "")
.to_string()
} else {
"nightly".to_string()
"staging".to_string()
};
if stable && !release_tag.contains(&version) {

View File

@ -2,7 +2,7 @@
name = "kcl-language-server"
description = "A language server for KCL."
authors = ["KittyCAD Inc <kcl@kittycad.io>"]
version = "0.2.68"
version = "0.2.69"
edition = "2021"
license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -1,7 +1,7 @@
[package]
name = "kcl-lib"
description = "KittyCAD Language implementation and tools"
version = "0.2.68"
version = "0.2.69"
edition = "2021"
license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -3,6 +3,7 @@
use kcl_lib::{bust_cache, ExecError, ExecOutcome};
use kcmc::{each_cmd as mcmd, ModelingCmd};
use kittycad_modeling_cmds as kcmc;
use pretty_assertions::assert_eq;
#[derive(Debug)]
struct Variation<'a> {
@ -247,8 +248,11 @@ extrude(profile001, length = 100)"#
)
.await;
result.first().unwrap();
result.last().unwrap();
let first = result.first().unwrap();
let last = result.last().unwrap();
assert!(first.1 == last.1, "The images should be the same");
assert_eq!(first.2, last.2, "The outcomes should be the same");
}
#[cfg(feature = "artifact-graph")]
@ -550,3 +554,64 @@ extrude(profile001, length = 100)
"The outcomes artifact graphs should be different"
);
}
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_cache_multi_file_same_code_dont_reexecute_settings_only_change() {
let code = r#"import "toBeImported.kcl" as importedCube
importedCube
sketch001 = startSketchOn(XZ)
profile001 = startProfile(sketch001, at = [-134.53, -56.17])
|> angledLine(angle = 0, length = 79.05, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 76.28)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $seg01)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close()
extrude001 = extrude(profile001, length = 100)
sketch003 = startSketchOn(extrude001, face = seg02)
sketch002 = startSketchOn(extrude001, face = seg01)
"#;
let other_file = (
std::path::PathBuf::from("toBeImported.kcl"),
r#"sketch001 = startSketchOn(XZ)
profile001 = startProfile(sketch001, at = [281.54, 305.81])
|> angledLine(angle = 0, length = 123.43, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 85.99)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude(profile001, length = 100)"#
.to_string(),
);
let result = cache_test(
"multi_file_same_code_dont_reexecute_settings_only_change",
vec![
Variation {
code,
other_files: vec![other_file.clone()],
settings: &kcl_lib::ExecutorSettings {
show_grid: false,
..Default::default()
},
},
Variation {
code,
other_files: vec![other_file],
settings: &kcl_lib::ExecutorSettings {
show_grid: true,
..Default::default()
},
},
],
)
.await;
let first = result.first().unwrap();
let last = result.last().unwrap();
assert!(first.1 != last.1, "The images should be different for the grid");
assert_eq!(first.2, last.2, "The outcomes should be the same");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

View File

@ -559,7 +559,7 @@ impl From<KclError> for pyo3::PyErr {
}
/// An error which occurred during parsing, etc.
#[derive(Debug, Clone, Serialize, Deserialize, ts_rs::TS)]
#[derive(Debug, Clone, Serialize, Deserialize, ts_rs::TS, PartialEq, Eq)]
#[ts(export)]
pub struct CompilationError {
#[serde(rename = "sourceRange")]

View File

@ -118,7 +118,6 @@ pub(super) async fn get_changed_program(old: CacheInformation<'_>, new: CacheInf
// We know they have the same imports because the ast is the same.
// If we have no imports, we can skip this.
if !old.ast.has_import_statements() {
println!("No imports, no need to check.");
return CacheResult::NoAction(reapply_settings);
}

View File

@ -64,7 +64,7 @@ pub mod typed_path;
pub(crate) mod types;
/// Outcome of executing a program. This is used in TS.
#[derive(Debug, Clone, Serialize, ts_rs::TS)]
#[derive(Debug, Clone, Serialize, ts_rs::TS, PartialEq)]
#[ts(export)]
#[serde(rename_all = "camelCase")]
pub struct ExecOutcome {
@ -385,6 +385,7 @@ impl ExecutorContext {
let (ws, _headers) = client
.modeling()
.commands_ws(
None,
None,
None,
if settings.enable_ssao {
@ -653,14 +654,22 @@ impl ExecutorContext {
keys.sort();
for key in keys {
let (_, id, _, _) = &new_universe[key];
let old_source = old_state.get_source(*id);
let new_source = new_exec_state.get_source(*id);
if old_source != new_source {
clear_scene = true;
break;
if let (Some(source0), Some(source1)) =
(old_state.get_source(*id), new_exec_state.get_source(*id))
{
if source0.source != source1.source {
clear_scene = true;
break;
}
}
}
if !clear_scene {
// Return early we don't need to clear the scene.
let outcome = old_state.to_exec_outcome(result_env).await;
return Ok(outcome);
}
(
clear_scene,
crate::Program {
@ -2244,7 +2253,7 @@ w = f() + f()
|> line(end = [0, 0])
|> close()
}
sketch = startSketchOn(XY)
|> startProfile(at = [0,0])
|> line(end = [0, 10])

View File

@ -1,6 +1,6 @@
[package]
name = "kcl-python-bindings"
version = "0.3.68"
version = "0.3.69"
edition = "2021"
repository = "https://github.com/kittycad/modeling-app"
exclude = ["tests/*", "files/*", "venv/*"]

View File

@ -1,7 +1,7 @@
[package]
name = "kcl-test-server"
description = "A test server for KCL"
version = "0.1.68"
version = "0.1.69"
edition = "2021"
license = "MIT"

View File

@ -1,7 +1,7 @@
[package]
name = "kcl-to-core"
description = "Utility methods to convert kcl to engine core executable tests"
version = "0.1.68"
version = "0.1.69"
edition = "2021"
license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -1,6 +1,6 @@
[package]
name = "kcl-wasm-lib"
version = "0.1.68"
version = "0.1.69"
edition = "2021"
repository = "https://github.com/KittyCAD/modeling-app"
rust-version = "1.83"

View File

@ -1,20 +0,0 @@
$VERSION=$(Get-Date -Format "yy.M.d")
$COMMIT=$(git rev-parse --short HEAD)
$PRODUCT_NAME="Zoo Design Studio (Nightly)"
# package.json
yq -i '.version = env(VERSION)' -p=json -o=json package.json
yq -i '.productName = env(PRODUCT_NAME)' -p=json -o=json package.json
yq -i '.name = "zoo-modeling-app-nightly"' -p=json -o=json package.json
# electron-builder.yml
yq -i '.publish[0].url = "https://dl.zoo.dev/releases/modeling-app/nightly"' electron-builder.yml
yq -i '.appId = "dev.zoo.modeling-app-nightly"' electron-builder.yml
yq -i '.nsis.include = "./scripts/installer-nightly.nsh"' electron-builder.yml
# Release notes
echo "Nightly build $VERSION (commit $COMMIT)" > release-notes.md
# icons
cp assets/icon-nightly.png assets/icon.png
cp assets/icon-nightly.ico assets/icon.ico

View File

@ -1,19 +0,0 @@
#!/bin/bash
export COMMIT=$(git rev-parse --short HEAD)
# package.json
PACKAGE=$(jq '.productName="Zoo Design Studio (Nightly)" | .name="zoo-modeling-app-nightly"' package.json --indent 2)
echo "$PACKAGE" > package.json
# electron-builder.yml
yq -i '.publish[0].url = "https://dl.zoo.dev/releases/modeling-app/nightly"' electron-builder.yml
yq -i '.appId = "dev.zoo.modeling-app-nightly"' electron-builder.yml
yq -i '.nsis.include = "./scripts/installer-nightly.nsh"' electron-builder.yml
# Release notes
echo "Nightly build (commit $COMMIT)" > release-notes.md
# icons
cp assets/icon-nightly.png assets/icon.png
cp assets/icon-nightly.ico assets/icon.ico

View File

@ -0,0 +1,20 @@
$COMMIT=$(git rev-parse --short HEAD)
$VERSION=$(Get-Date -Format "yy.M.d-staging.1-$COMMIT")
$PRODUCT_NAME="Zoo Design Studio (Staging)"
# package.json
yq -i '.version = env(VERSION)' -p=json -o=json package.json
yq -i '.productName = env(PRODUCT_NAME)' -p=json -o=json package.json
yq -i '.name = "zoo-modeling-app-staging"' -p=json -o=json package.json
# electron-builder.yml
yq -i '.publish[0].url = "https://dl.zoo.dev/releases/modeling-app/staging"' electron-builder.yml
yq -i '.appId = "dev.zoo.modeling-app-staging"' electron-builder.yml
yq -i '.nsis.include = "./scripts/installer-staging.nsh"' electron-builder.yml
# Release notes
echo "Staging build $VERSION (commit $COMMIT)" > release-notes.md
# icons
cp assets/icon-staging.png assets/icon.png
cp assets/icon-staging.ico assets/icon.ico

View File

@ -0,0 +1,19 @@
#!/bin/bash
export COMMIT=$(git rev-parse --short HEAD)
# package.json
PACKAGE=$(jq '.productName="Zoo Design Studio (Staging)" | .name="zoo-modeling-app-staging"' package.json --indent 2)
echo "$PACKAGE" > package.json
# electron-builder.yml
yq -i '.publish[0].url = "https://dl.zoo.dev/releases/modeling-app/staging"' electron-builder.yml
yq -i '.appId = "dev.zoo.modeling-app-staging"' electron-builder.yml
yq -i '.nsis.include = "./scripts/installer-staging.nsh"' electron-builder.yml
# Release notes
echo "Staging build (commit $COMMIT)" > release-notes.md
# icons
cp assets/icon-staging.png assets/icon.png
cp assets/icon-staging.ico assets/icon.ico

View File

@ -1,5 +0,0 @@
#!/bin/bash
echo "## What's Changed"
git log ${PREVIOUS_TAG}..HEAD --oneline --pretty=format:%s | grep -v Bump | awk '{print "* "toupper(substr($0,0,1))substr($0,2)}'
echo ""
echo "**Full Changelog**: https://github.com/KittyCAD/modeling-app/compare/${PREVIOUS_TAG}...${TAG}"

View File

@ -1,8 +1,8 @@
!macro preInit
SetRegView 64
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Zoo Design Studio (Nightly)"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Zoo Design Studio (Nightly)"
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Zoo Design Studio (Staging)"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Zoo Design Studio (Staging)"
SetRegView 32
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Zoo Design Studio (Nightly)"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Zoo Design Studio (Nightly)"
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Zoo Design Studio (Staging)"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Zoo Design Studio (Staging)"
!macroend

View File

@ -1,7 +1,7 @@
#!/bin/bash
base_dir="/releases/modeling-app"
if [[ $1 = "--nightly" ]]; then
base_dir="/releases/modeling-app/nightly"
if [[ $1 = "--staging" ]]; then
base_dir="/releases/modeling-app/staging"
fi
echo "Invalidating json and yml files at $base_dir in the download bucket"

View File

@ -30,7 +30,7 @@ import {
settingsActor,
useSettings,
} from '@src/lib/singletons'
import { APP_VERSION, IS_NIGHTLY, getReleaseUrl } from '@src/routes/utils'
import { APP_VERSION, getReleaseUrl } from '@src/routes/utils'
import {
acceptOnboarding,
catchOnboardingWarnError,
@ -276,25 +276,6 @@ export const AllSettingsFields = forwardRef(
, and start a discussion if you don't see it! Your feedback will
help us prioritize what to build next.
</p>
{!IS_NIGHTLY && (
<p className="max-w-2xl mt-6">
Want to experience the latest and (hopefully) greatest from our
main development branch?{' '}
<a
onClick={openExternalBrowserIfDesktop(
'https://zoo.dev/modeling-app/download/nightly'
)}
href="https://zoo.dev/modeling-app/download/nightly"
target="_blank"
rel="noopener noreferrer"
>
Click here to grab Zoo Design Studio (Nightly)
</a>
. It can be installed side-by-side with the stable version
you're running now. But careful there, a lot less testing is
involved in their release 🤖.
</p>
)}
</div>
</div>
</div>

View File

@ -426,6 +426,7 @@ export class KclManager {
EXECUTE_AST_INTERRUPT_ERROR_MESSAGE
)
// Exit early if we are already executing.
return
}
@ -437,6 +438,7 @@ export class KclManager {
this.isExecuting = true
await this.ensureWasmInit()
const { logs, errors, execState, isInterrupted } = await executeAst({
ast,
path: this.singletons.codeManager.currentFilePath || undefined,

View File

@ -16,7 +16,7 @@ import type {
StateMachineCommandSetSchema,
} from '@src/lib/commandTypes'
import { isDesktop } from '@src/lib/isDesktop'
import { IS_NIGHTLY_OR_DEBUG } from '@src/routes/utils'
import { IS_STAGING_OR_DEBUG } from '@src/routes/utils'
interface CreateMachineCommandProps<
T extends AnyStateMachine,
@ -86,7 +86,7 @@ export function createMachineCommand<
} else if ('status' in commandConfig) {
const { status } = commandConfig
if (status === 'inactive') return null
if (status === 'development' && !(DEV || IS_NIGHTLY_OR_DEBUG)) return null
if (status === 'development' && !(DEV || IS_STAGING_OR_DEBUG)) return null
}
const icon = ('icon' in commandConfig && commandConfig.icon) || undefined

View File

@ -25,7 +25,7 @@ import type { FileEntry, FileMetadata, Project } from '@src/lib/project'
import { err } from '@src/lib/trap'
import type { DeepPartial } from '@src/lib/types'
import { getInVariableCase } from '@src/lib/utils'
import { IS_NIGHTLY } from '@src/routes/utils'
import { IS_STAGING } from '@src/routes/utils'
export async function renameProjectDirectory(
projectPath: string,
@ -461,8 +461,8 @@ export async function writeProjectSettingsFile(
// Important for saving settings.
// TODO: should be pulled from electron-builder.yml
const APP_ID = IS_NIGHTLY
? 'dev.zoo.modeling-app-nightly'
const APP_ID = IS_STAGING
? 'dev.zoo.modeling-app-staging'
: 'dev.zoo.modeling-app'
const getAppFolderName = () => {
@ -470,7 +470,7 @@ const getAppFolderName = () => {
return APP_ID
}
// TODO: we need to make linux use the same convention this is weird
// This variable below gets the -nightly suffix on nightly too thru scripts/flip-files-to-nightly.sh
// This variable below gets the -staging suffix on staging too thru scripts/flip-files-to-staging.sh
// But it should be consistent with the reserve domain app id we use on Windows and Linux
return window.electron.packageJson.name
}

View File

@ -1,8 +1,9 @@
import toast from 'react-hot-toast'
import { kclManager } from '@src/lib/singletons'
import { kclManager, rustContext } from '@src/lib/singletons'
import { reportRejection } from '@src/lib/trap'
import { getModule, reloadModule } from '@src/lib/wasm_lib_wrapper'
import { jsAppSettings } from '@src/lib/settings/settingsUtils'
let initialized = false
@ -16,7 +17,11 @@ export const initializeWindowExceptionHandler = () => {
if (window && !initialized) {
window.addEventListener('error', (event) => {
void (async () => {
if (matchImportExportErrorCrash(event.message)) {
if (
matchImportExportErrorCrash(event.message) ||
matchUnreachableErrorCrash(event.message) ||
matchGenericWasmRuntimeHeuristicErrorCrash(event)
) {
// do global singleton cleanup
kclManager.executeAstCleanUp()
toast.error(
@ -25,6 +30,19 @@ export const initializeWindowExceptionHandler = () => {
try {
await reloadModule()
await getModule().default()
/**
* If I do not cache bust, swapping between files when a rust runtime error happens
* it will cache the result of the crashed result and not re executing a new good file
* CacheResult::NoAction(false) => {
* let outcome = old_state.to_exec_outcome(result_env).await;
* return Ok(outcome);
* }
* ^-- this is the block of code that returns which prevents it from running a new execute
*/
await rustContext?.clearSceneAndBustCache(
await jsAppSettings(),
undefined
)
} catch (e) {
console.error('Failed to initialize wasm_lib')
console.error(e)
@ -50,3 +68,20 @@ const matchImportExportErrorCrash = (message: string): boolean => {
const substringError = '`Result::unwrap_throw()` on an `Err` value'
return message.indexOf(substringError) !== -1 ? true : false
}
const matchUnreachableErrorCrash = (message: string): boolean => {
const substringError = `Uncaught RuntimeError: unreachable`
return message.indexOf(substringError) !== -1 ? true : false
}
const matchGenericWasmRuntimeHeuristicErrorCrash = (
error: ErrorEvent
): boolean => {
const stack = error?.error?.stack || null
if (typeof stack === 'string') {
const substringError = `WebAssembly.instantiate:wasm-function`
return stack.indexOf(substringError) !== -1 ? true : false
}
return false
}

View File

@ -469,9 +469,9 @@ function OnboardingConclusion() {
We highly encourage you to{' '}
<a
onClick={openExternalBrowserIfDesktop(
`${VITE_KC_SITE_BASE_URL}/modeling-app/download/nightly`
`${VITE_KC_SITE_BASE_URL}/modeling-app/download`
)}
href="https://zoo.dev/modeling-app/download/nightly"
href="https://zoo.dev/modeling-app/download"
target="_blank"
rel="noopener noreferrer"
>

View File

@ -15,7 +15,7 @@ import { Themes, getSystemTheme } from '@src/lib/theme'
import { reportRejection } from '@src/lib/trap'
import { toSync } from '@src/lib/utils'
import { authActor, useSettings } from '@src/lib/singletons'
import { APP_VERSION, IS_NIGHTLY } from '@src/routes/utils'
import { APP_VERSION } from '@src/routes/utils'
const subtleBorder =
'border border-solid border-chalkboard-30 dark:border-chalkboard-80'
@ -106,7 +106,7 @@ const SignIn = () => {
<Logo className="text-primary h-10 lg:h-12 xl:h-16 relative translate-y-1 mr-4 lg:mr-6 xl:mr-8" />
<h1 className="text-3xl lg:text-4xl xl:text-5xl">{APP_NAME}</h1>
<span className="px-3 py-1 text-base rounded-full bg-primary/10 text-primary self-start">
{IS_NIGHTLY ? 'nightly' : ''} v{APP_VERSION}
v{APP_VERSION}
</span>
</div>
<p className="my-4 text-lg xl:text-xl">

View File

@ -16,13 +16,14 @@ export const PACKAGE_NAME = isDesktop()
? window.electron.packageJson.name
: 'zoo-modeling-app'
export const IS_NIGHTLY = PACKAGE_NAME.indexOf('-nightly') > -1
export const IS_STAGING = PACKAGE_NAME.indexOf('-staging') > -1
export const IS_NIGHTLY_OR_DEBUG =
IS_NIGHTLY || APP_VERSION === '0.0.0' || APP_VERSION === '11.22.33'
export const IS_STAGING_OR_DEBUG =
IS_STAGING || APP_VERSION === '0.0.0' || APP_VERSION === '11.22.33'
export function getReleaseUrl(version: string = APP_VERSION) {
// TODO: fix for staging and point to commit instead of release
return `https://github.com/KittyCAD/modeling-app/releases/tag/${
IS_NIGHTLY ? 'nightly-' : ''
IS_STAGING ? 'staging-' : ''
}v${version}`
}