Skip to content
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

[pull] main from imazen:main #10

Open
wants to merge 284 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
284 commits
Select commit Hold shift + click to select a range
ae9e567
woe is me
lilith Aug 23, 2024
0bc8003
bash isn't common enough for you arm???
lilith Aug 23, 2024
36f4026
Improve scaling algorithm speed
lilith Aug 29, 2024
35b1201
Move WOA to separate workflow, nasm and arm setup to actions
lilith Sep 5, 2024
d124959
Merge branch 'main' of https://github.com/imazen/imageflow
lilith Sep 5, 2024
01908ef
Fix action naming
lilith Sep 5, 2024
68e789c
Fix win-arm-64 naming
lilith Sep 5, 2024
c8ee27d
Try to set missing env vars
lilith Sep 5, 2024
90713c2
Provide better diagnostics on libpng unexpectedeof
lilith Sep 5, 2024
259e738
Add clear downloads utility script
lilith Sep 5, 2024
0a25255
Update WoA test
lilith Sep 5, 2024
be28a9d
Fix libpng diagnostics for unexpctedeof
lilith Sep 5, 2024
c0746d4
Update test_woa.yml to not set vars
lilith Sep 6, 2024
24ce9d9
Try feeding libpng as many bytes as remain, rather than panicking if …
lilith Oct 30, 2024
a64929e
Update action.yml
lilith Oct 30, 2024
0bd1f69
--accept-source-agreements --accept-package-agreements for winget nasm
lilith Oct 30, 2024
0a4f30a
Print the number of bytes fetched after a file is successfully downlo…
lilith Oct 30, 2024
2481b9d
test_tool: Let Cargo tell us where imageflow_tool resides (#650)
andersk Nov 19, 2024
3112c23
Add laptop efficiency testing script
lilith Dec 11, 2024
513cd84
Update laptop efficiency tool to prevent sleep, detect sleep, estimat…
lilith Dec 11, 2024
e89dfa1
Improve rust_perf_battery
lilith Dec 11, 2024
4566146
Prevent energy saver during benchmark, etc
lilith Dec 11, 2024
751de5f
rust_perf_battery, show ram use each cycle
lilith Dec 11, 2024
b62e0f3
Add process interference reporting to rust_perf_battery
lilith Dec 11, 2024
96527bb
Improve process reporting in rust_perf_battery.ps1
lilith Dec 11, 2024
0ac9944
Fix bad rounding for scaling a 1200x400 image to 100x33
lilith Jan 18, 2025
16b6772
Add codelldb in .cargo
lilith Jan 18, 2025
c03047b
Add get_pixel_bgra8, for checking encoding outputs
lilith Jan 18, 2025
0bc4aa6
Add test_problematic_png_crushed (commented out for now)
lilith Jan 18, 2025
cf55347
Fixes #656 fully, will test coverage, and invalid test_scale expectat…
lilith Jan 18, 2025
e55a280
Fixes #655
lilith Jan 18, 2025
07a3e12
Fix build error cargo check didn't catch
lilith Jan 19, 2025
0825ebd
Fixes #654, adds full test coverage
lilith Jan 19, 2025
7aa4318
Whitespace detection: improve unit tests, error messages, small optim…
lilith Jan 19, 2025
cf63cb1
ci: trie f.sync_all
lilith Jan 19, 2025
46115d2
Give macos the png it wants
lilith Jan 19, 2025
8861477
Improve WOA action, use vs preview, git-arm, newer windows sdk, minim…
lilith Jan 20, 2025
76c6e36
Upgrade nasm fallback version
lilith Jan 20, 2025
59b5439
Update GitHub Actions workflow to use actions/checkout@v4 and integra…
lilith Jan 20, 2025
42d4003
Update test CI workflow: replace macOS 11 with macOS 13, remove haswe…
lilith Jan 20, 2025
a73dae8
Add ubuntu-arm64 and osx-aarch64 nuget packages, drop _haswell packa…
lilith Jan 20, 2025
85b9a1e
ci: try Swatinem cache, only rust test not rust check/build
lilith Jan 20, 2025
01350b9
Update CI workflows to use actions/checkout@v4 and Swatinem rust-cach…
lilith Jan 20, 2025
0ee1f12
Combine win32 and other tests
lilith Jan 20, 2025
5551f1d
Add mimalloc feature for musl
lilith Jan 21, 2025
39e9aeb
Switch test_ci.yml to houseabsolute/actions-rust-cross
lilith Jan 21, 2025
f520d8d
fix syntax error
lilith Jan 21, 2025
7d68ca2
CI: fix syntax error
lilith Jan 21, 2025
a2c5c06
test_ci: drop extra cache key data, will make ubuntu 20/22 share
lilith Jan 21, 2025
7a34472
Fix cargo.toml
lilith Jan 21, 2025
2d316d9
Update test_ci.yml to use matrix.target instead of matrix.platform.ta…
lilith Jan 21, 2025
d821406
Drop wasm32 for now
lilith Jan 21, 2025
339cf4d
ci: only use cross where needed
lilith Jan 21, 2025
54bcfb0
woa: list new dirs
lilith Jan 21, 2025
84894de
cargo update
lilith Jan 21, 2025
5d8e2d6
test_ci
lilith Jan 21, 2025
16d1265
Update dependencies and improve hashing implementation
lilith Jan 21, 2025
ecc1a25
Remove obsolete merge .cargo/config, .cargo/config.toml
lilith Jan 21, 2025
0f929d5
Add quotes in test_ci
lilith Jan 21, 2025
378a146
fix test skipping
lilith Jan 21, 2025
25438a7
Use ubuntu-24-arm-32gb for aarch64-unknown-linux-musl too
lilith Jan 21, 2025
15ac8fb
Move mimalloc feature to imageflow_helpers and fix conflict with syst…
lilith Jan 21, 2025
e38f120
Revert to cross on 64 for aarch64-musl
lilith Jan 21, 2025
7dceb3f
woa install action
lilith Jan 21, 2025
48a09bb
Prevent imageflow_tool self tests from crashing due to duplicate test…
lilith Jan 21, 2025
b59778d
Improve error messages when --bundle-to dir exists
lilith Jan 21, 2025
f2c7524
Make libwebp neon an opt-in feature
lilith Jan 21, 2025
8c26fc4
woa setup: fixup path/env vars
lilith Jan 21, 2025
49affc0
woa ci cleanup
lilith Jan 21, 2025
b62d02b
Cleanup, disable aarch64 musl for now
lilith Jan 21, 2025
1c7c191
Update CI configuration: change Windows OS version to 2022, restore a…
lilith Jan 21, 2025
eb73af3
Refactor win32 into main release_ci.yml
lilith Jan 21, 2025
4c4984e
test_ci improve test names
lilith Jan 21, 2025
3dd818e
Fix woa for cache restoration
lilith Jan 21, 2025
90f4c6c
Enhance Windows ARM64 setup action: add installation steps for winget…
lilith Jan 21, 2025
d64fb00
Update CI workflow: refine job naming format and upgrade rust-cross a…
lilith Jan 21, 2025
73206df
Enhance CI configuration: add environment variable passthrough for bu…
lilith Jan 21, 2025
717cd7d
action.yml
lilith Jan 21, 2025
5c1cd87
woa action.yml
lilith Jan 21, 2025
889f1ca
Fix ci job naming
lilith Jan 21, 2025
45493cb
Fix --target in release_ci.yml
lilith Jan 21, 2025
0a10434
winget on woa produces garbage output
lilith Jan 21, 2025
9cd8c1d
Make test image fetching do retries
lilith Jan 21, 2025
c114e4a
Update NASM installation action: print installed NASM version, don't…
lilith Jan 21, 2025
9690646
woa: Drop set execution policy
lilith Jan 21, 2025
5bfa0e0
tweak job names
lilith Jan 21, 2025
5cb3d00
pack.sh Fix mixed slashes in BINARIES_DIR
lilith Jan 21, 2025
e14e421
vendor openssl on musl
lilith Jan 21, 2025
c1af0ee
Refactor build.rs for improved architecture-specific compilation
lilith Jan 21, 2025
878ea4f
Test_ci with +crt-static and nuget pack
lilith Jan 21, 2025
0ec9e55
ci_release crt-static and fix paths
lilith Jan 21, 2025
0e4b79b
test_ci specify --target
lilith Jan 21, 2025
6b3bc62
Update CI configuration for improved build and test processes
lilith Jan 21, 2025
b37492b
release_ci: fix RELATIVE_ARTIFACT_ARCHIVE and REPO_NAME
lilith Jan 21, 2025
4959790
woa: Try to cache the vs installer
lilith Jan 21, 2025
0c2f511
ci fixes
lilith Jan 21, 2025
72d0149
test_ci - Add cargo build
lilith Jan 21, 2025
473e469
ci :(
lilith Jan 21, 2025
13112e9
release_ci: add build-exclude
lilith Jan 21, 2025
03b2477
create unified ci.yml
lilith Jan 21, 2025
ebf0a39
ci.yml: provide better feedback
lilith Jan 21, 2025
2353f7e
Turn off release_ci and test_ci
lilith Jan 21, 2025
e1f9881
woa: can't cache build tools
lilith Jan 21, 2025
7a12472
ci.yml: cache normally with woa
lilith Jan 21, 2025
545b2f3
test_woa - test with release flags
lilith Jan 21, 2025
07eb1b2
ci: fix cross build musl
lilith Jan 21, 2025
a27e2de
ci: Replace broken shopify action with xresloader/upload-to-github-re…
lilith Jan 21, 2025
e337ff3
ci: Comment out target-feature -crt-static for cross builds in CI wor…
lilith Jan 21, 2025
87ed241
Add zip.ps1 for woa pack.sh
lilith Jan 21, 2025
9d25840
ci: win32 doesn't like any target-cpu specified
lilith Jan 21, 2025
330ecbd
disable test_woa
lilith Jan 21, 2025
7700a29
ci: test before build
lilith Jan 21, 2025
521cbf3
remove `release_ci.yml` `test_ci.yml` and `test_woa.yml`
lilith Jan 21, 2025
8aa1ae8
Fail builds if glibc is above 2.17 for linux
lilith Jan 21, 2025
85b9b56
Fix zip.ps1
lilith Jan 21, 2025
401bcb3
Run linux builds using cross: true (which might not enable cross)
lilith Jan 21, 2025
2076a2e
produce imageflow_abi on musl targets
lilith Jan 21, 2025
5eb1143
Update CI workflow and packaging script to handle empty NuGet output …
lilith Jan 21, 2025
4c15edd
Try strip=true inside imageflow_abi
lilith Jan 21, 2025
803dee5
fix ci.yml syntax
lilith Jan 21, 2025
52a8617
Enhance CI workflow for artifact management and packaging
lilith Jan 21, 2025
52291e1
Merge branch 'main' of https://github.com/imazen/imageflow
lilith Jan 21, 2025
92812c8
ci: Refactor static lib upload and naming
lilith Jan 21, 2025
c6a2c06
typo: ci.yml
lilith Jan 21, 2025
082ebd0
Adjust imageflow_abi cargo.toml for musl
lilith Jan 21, 2025
f895026
ci: sed imageflow_abi/Cargo.toml since target doesn't work
lilith Jan 21, 2025
a573d76
fix: ci.yml echo
lilith Jan 21, 2025
88bebb7
ci: move strip/lto to root cargo.toml
lilith Jan 21, 2025
3eabe42
fix: update ci.yml to use environment variables for REL_BINARIES_DIR …
lilith Jan 21, 2025
4b1cad9
Update ci.yml
lilith Jan 22, 2025
3fcb65c
Imageflow_abi should default to cdylib
lilith Jan 22, 2025
8e53318
Update ci.yml - use matrix.max-glibc
lilith Jan 22, 2025
2c06529
Imageflow.NativeRuntim.*.osx-aarch64 is now arm64 (and *linux-arm64 i…
lilith Jan 22, 2025
4c2b065
Add libimageflow.a to github release
lilith Jan 22, 2025
e63bc18
ci: factor out check-glibc.sh and expect 2.34 instead of 2.39 for lin…
lilith Jan 22, 2025
a1fc452
ci: fix create zip/tar script syntax
lilith Jan 22, 2025
b7d10ba
ci: refactor out pack_artifacts.sh
lilith Jan 22, 2025
4fb1008
Test pack_artifacts.sh during test
lilith Jan 22, 2025
20658fd
pack_artifacts.sh: allow missing docs, don't allow missing install.sh…
lilith Jan 22, 2025
890d04c
ci.yml: refactor
lilith Jan 22, 2025
c0b82ae
ci fix: cp: target './artifacts/staging/headers/' is not a directory
lilith Jan 22, 2025
f2f016a
ci fix: pack docks
lilith Jan 22, 2025
eb1b8aa
ci fix: musl fix syntax error
lilith Jan 22, 2025
cbcb1bd
ci fix: don't pack nativeruntime for musl
lilith Jan 22, 2025
37071fb
fix ci: bucket and url handling
lilith Jan 22, 2025
130872f
fix ci.yml: use vars. instead of .env during env:
lilith Jan 24, 2025
d75268c
ci fix: use vars. inside root env:
lilith Jan 24, 2025
99bd77d
Important: When Context is dropped, and self.codecs.clear() fails, ep…
lilith Jan 24, 2025
00ee295
Important: ensure wrap_png_decoder_destroy cannot be called twice, an…
lilith Jan 24, 2025
8910642
mozjpeg: add a few more defensive null checks
lilith Jan 24, 2025
f2d89b1
zip.ps1: fix slashes for rename operation
lilith Jan 24, 2025
e722903
Eliminate the remainder of dead C code
lilith Jan 24, 2025
42d8ea2
Update ci.yml
lilith Jan 25, 2025
e2a10b4
Update ci.yml
lilith Jan 25, 2025
0483aaf
Drop dead code
lilith Jan 24, 2025
8d1babc
Add safe bitmap window splitting and scanline iteration. Split Surfac…
lilith Jan 25, 2025
241aa2b
zip.ps1: fix slashes for all input
lilith Jan 25, 2025
1b46d33
deprecate flow_bitmap_bgra_fill_rect
lilith Jan 25, 2025
10a3678
rust: reduce use of unsafe code
lilith Jan 25, 2025
1a1df60
fix asinine powershell issue
lilith Jan 25, 2025
40abfa0
rust: move more codepaths to safe
lilith Jan 25, 2025
cee19fa
rust: Fix flaw where rectangles could be drawn without changing the c…
lilith Jan 25, 2025
2b97d0c
rust: Refactor bitmap and rectangle copy operations to use safe methods
lilith Jan 27, 2025
30fac01
rust: Add Color32::from_rgba method for creating colors
lilith Jan 27, 2025
fb2476e
rust: Remove unused diff_bitmap_bytes function
lilith Jan 27, 2025
7a5dc2d
rust: Enhance ScanlineIterMut with reverse iteration and improved safety
lilith Jan 27, 2025
d52fc50
rust: Refactor bitmap flip operations to use safe methods
lilith Jan 27, 2025
815c79c
rust: Refactor whitespace detection to use safe bitmap methods
lilith Jan 27, 2025
6b82a78
rust: Remove redundant color matrix processing for 3-channel images
lilith Jan 27, 2025
813a96f
Dramatically improve flip_h performance while simplifying it
lilith Jan 28, 2025
0038598
Reduce unsafe in webp encoding/decoding
lilith Jan 28, 2025
2eab053
Eliminate unsafe in gif decoder/encoder and unused jpeg_decoder
lilith Jan 28, 2025
2eeba67
Massive refactor and new features in bitmaps.rs
lilith Jan 29, 2025
6f47942
Refactor most codecs (and color/scaling) to use less unsafe{}
lilith Jan 29, 2025
5c6af48
Add BGRA f32 slice retrieval and improve bitmap slice access safety
lilith Jan 29, 2025
93c1e21
Add visual tests for white balance and color filters
lilith Jan 29, 2025
a4f9f5c
Make color matrix and white balance safer
lilith Jan 29, 2025
8daa483
Purge BitmapBgra from existence
lilith Jan 29, 2025
cecc6a5
Purge BitmapFloat, convolutions, luv.rs
lilith Jan 29, 2025
185e9a6
End conflation of channels with items_per_pixel
lilith Jan 29, 2025
fbc447e
item_stride -> t_stride, items_per_pixel -> t_per_pixel
lilith Jan 29, 2025
bd67193
Fix & test zip.ps1
lilith Jan 29, 2025
b02b52f
Replace chashmap with dashmap
lilith Jan 29, 2025
644f3f5
nuget: target netstandard2.0 as well as netstandard1.0
lilith Feb 7, 2025
3101e65
nuget: drop netstandard1.0 dependency
lilith Feb 7, 2025
59f5b08
Overhaul nuget packages, might fix win-arm64
lilith Feb 7, 2025
afbf54e
Nuget packing should now work better on windows/bash combos
lilith Feb 8, 2025
53c8ad8
Refactor nuget package creation & add meta package creation
lilith Feb 11, 2025
375cc90
Reduce unsafe code
lilith Feb 11, 2025
35f126c
Add Imageflow.Net.All* meta packages.
lilith Feb 11, 2025
d807b5f
chmod +x
lilith Feb 11, 2025
a708727
build(deps): bump openssl from 0.10.68 to 0.10.70 (#659)
dependabot[bot] Feb 11, 2025
faa2b1e
test_pack now tests all RIDs
lilith Feb 11, 2025
857ca0a
Fix build
lilith Feb 11, 2025
c145ad4
Refactor away more unsafe
lilith Feb 11, 2025
27015d8
Update library file names in test_pack script
lilith Feb 11, 2025
2f00e00
Fix cross-platform compatibility in NuGet packaging scripts
lilith Feb 11, 2025
d384fd2
Backport pack_meta.sh to Bash 3 (osx)
lilith Feb 11, 2025
dcd118c
ci: create artifacts/nuget dir first
lilith Feb 11, 2025
74d88d2
cI: fix nuget-meta-packages job
lilith Feb 11, 2025
30cee97
feat (ci) start uploading musl artifacts on release
lilith Feb 11, 2025
66e4cfa
Add some cursor rules
lilith Feb 11, 2025
b04a63d
ci: Improve & test pack_artifacts, change s3 commits/sha/win-x86_64 -…
lilith Feb 12, 2025
9aac7a0
MASS DELETE of outdated docker & script stuff
lilith Feb 12, 2025
0e402b6
Delete more outdated scripts
lilith Feb 12, 2025
d276a69
docs: Update README with download link and Rust binding notes
lilith Feb 12, 2025
e277649
ci: Enhance Docker image build for imageflow_tool
lilith Feb 12, 2025
3fa0194
fix (ci): ci.yml
lilith Feb 12, 2025
e817e6e
fix (ci): Correct typo in IMAGEFLOW_TOOL environment variable assignment
lilith Feb 12, 2025
04a774f
ci: Refine CI workflow and artifact packaging script
lilith Feb 12, 2025
ce65daf
ci: Refine IMAGEFLOW_TOOL environment variable configuration
lilith Feb 12, 2025
d7e9de5
nuget: fix, add icon, add s3 uploads
lilith Feb 12, 2025
18421aa
ci: use centos so glibc req is 2.17
lilith Feb 17, 2025
ad535c5
Try rustls-tls on centos to fix openssl
lilith Feb 17, 2025
833aa9c
Try to avoid openssl another way
lilith Feb 17, 2025
1713a60
replace http stack with shelling out, or optional feature ureq
lilith Feb 17, 2025
00ff302
ci: fix cross
lilith Feb 17, 2025
534a0e2
ci: pages.yml
lilith Feb 17, 2025
24dd27b
ci: force-use-cross default to false
lilith Feb 17, 2025
2d5d58d
ci: only force cross on x64, use runner glibc for linux aarch64
lilith Feb 17, 2025
cd9033a
ci: linux-arm64 - bump max glibc version from 2.17 to 2.34
lilith Feb 17, 2025
9791dbf
drop a bunch of dependencies by trimming 'zip' and moving to imageflo…
lilith Feb 17, 2025
ab59b7b
faster: only run systeminfo.exe when CI_RELEASE=true
lilith Feb 17, 2025
f03806e
use regex_lite instead of regex to cut build time
lilith Feb 17, 2025
d43ce8b
build: Comment out unused header generation targets for speed
lilith Feb 17, 2025
637f685
build.rs scripts now parallelize with rayon (not sure of tradeoff)
lilith Feb 17, 2025
05d68bb
nuget: Fix archive creation to prevent extra subdirs, add verificatio…
lilith Feb 18, 2025
15cd8fe
ci: windows must rename .nupkg to .zip to extract.
lilith Feb 18, 2025
bc7c82e
ci: windows nuget verification needs to handle /c/
lilith Feb 18, 2025
6774d70
ci: verify_nupkg: when renaming, show files
lilith Feb 18, 2025
21c0afc
ci: Add github actions version updater
lilith Feb 18, 2025
ceedf1d
ci: for WOA, split up git install from the rest so checks can run soo…
lilith Feb 18, 2025
5e350b1
ci: use Rename-Item with second argument not being a path, just filename
lilith Feb 18, 2025
2a98e60
ci: fix github actions warning about ::set-output
lilith Feb 18, 2025
c09da1c
ci: WOA: add checks to ensure git/bash are in path
lilith Feb 18, 2025
1586ba6
ci: WOA setup-git needs to use legacy powershell syntax
lilith Feb 18, 2025
b2c9f97
ci: powershell Get-Item requires existence, use System.IO.Path
lilith Feb 18, 2025
0266492
ci: fix zip.ps1 and test_zip.ps1
lilith Feb 19, 2025
1ca541f
ci: zip.ps1 syntax oops
lilith Feb 19, 2025
4489d6f
ci: fix test_zip.ps1, make compression level adjustable
lilith Feb 19, 2025
a475d0e
ci: run nuget tests fast to slow order
lilith Feb 19, 2025
5500f21
ci: .nuspec now needs <licenseUrl>https://aka.ms/deprecateLicenseUrl<…
lilith Feb 19, 2025
1702903
ci: fix docker push tags, labels
lilith Feb 19, 2025
1db56df
ci: Allow pass even if docker upload fails; set docker image to imaze…
lilith Feb 19, 2025
0ff408f
ci: if nuget upload fails, print error response
lilith Feb 19, 2025
a1e78e2
ci: upload metadata packages to s3 for analysis
lilith Feb 19, 2025
8d6a3a0
ci: rename nuget packages: ubuntu-arm64->linux-arm64, add linux-x4 to…
lilith Feb 19, 2025
d61d0a5
ci: Update test_pack_artifacts.sh
lilith Feb 19, 2025
5a40f00
ci: fix pack_meta.sh to properly expand dependencies, and do a verifi…
lilith Feb 19, 2025
ab3a293
ci: update nuget readme, add utility
lilith Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/codelldb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
code --open-url "vscode://vadimcn.vscode-lldb/launch/command?LD_LIBRARY_PATH=$LD_LIBRARY_PATH&$*"

Check warning on line 2 in .cargo/codelldb.sh

View workflow job for this annotation

GitHub Actions / Spell checking

`vadimcn` is not a recognized word. (unrecognized-spelling)
13 changes: 13 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# ring isn't even supposed to be compiled - it's not in cargo tree -
# but we can't build unless ring can find llvm/cland and it's terrible at finding it

Check warning on line 3 in .cargo/config.toml

View workflow job for this annotation

GitHub Actions / Spell checking

`cland` is not a recognized word. (unrecognized-spelling)
# ring is the one project with a worse build system than openssl...
# Might replace reqwest with shelling out to wget for unit test fixtures instead.
[env]
PATH = { value = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\Llvm\\ARM64\\bin;${PATH}", relative = false }

#[target.x86_64-unknown-linux-gnu]
#runner = ".cargo/codelldb.sh"

Check warning on line 10 in .cargo/config.toml

View workflow job for this annotation

GitHub Actions / Spell checking

`codelldb` is not a recognized word. (unrecognized-spelling)

#finds the current target triple
#rustc -vV | sed -n 's|host: ||p'
58 changes: 58 additions & 0 deletions .cursor/rules/bash.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
description: Rules for working on bash scripts and their tests
globs: *.sh, *.yml
---
# Goal: Enforce cross-platform bash script guidelines
# Reasoning:
# 1. We want all .sh scripts to work with Bash 3.2 on macOS, Git Bash on Windows, WSL2, Ubuntu 22–24. cygpath is never available.

Check warning on line 7 in .cursor/rules/bash.mdc

View workflow job for this annotation

GitHub Actions / Spell checking

`WSL` is not a recognized word. (unrecognized-spelling)

Check warning on line 7 in .cursor/rules/bash.mdc

View workflow job for this annotation

GitHub Actions / Spell checking

`cygpath` is not a recognized word. (unrecognized-spelling)
# 2. We need to ensure each .sh script has a corresponding test_ script. test_scripts should create a unique directory to contain all their filesystem work, remove it on pass/fail, and restore the current directory and env vars to what they were before it ran.
# 3. For Windows, we assume a fresh install with only Git available; use powershell.exe if needed (no pwsh).

Check warning on line 9 in .cursor/rules/bash.mdc

View workflow job for this annotation

GitHub Actions / Spell checking

`pwsh` is not a recognized word. (unrecognized-spelling)
# 4. Powershell automatically handles slash conversions, but /c/ must become C:/. Create tests for powershell files
# 5. Use set -e and set -o pipefail for bash. Avoid silent failure.

Check warning on line 11 in .cursor/rules/bash.mdc

View workflow job for this annotation

GitHub Actions / Spell checking

`pipefail` is not a recognized word. (unrecognized-spelling)
# 6. For both powerhshell files and bash files, use functions and DRY things as much as possible.

Check warning on line 12 in .cursor/rules/bash.mdc

View workflow job for this annotation

GitHub Actions / Spell checking

`powerhshell` is not a recognized word. (unrecognized-spelling)
# 7. Add verification checks for all inputs, whether files, dirs, or variables, and make contractual boundaries and division of responsibility clear.

<rule>
name: cross_platform_bash_scripts
description: Ensures that all bash scripts are cross-platform compatible and have matching test scripts
filters:
# Match any .sh file outside of test_ prefixed scripts
- type: file_extension
pattern: "\\.sh$"
- type: filename
pattern: "^(?!test_).+\\.sh$"

actions:
- type: reject
conditions:
# Reject any .sh file without a matching test_ script of the same name
- pattern: "^(?!test_)(.+)\\.sh$"
message: |
Found a bash script without a corresponding test script.
Please add a test_ script to ensure thorough testing across platforms.

- type: suggest
message: |
Ensure compatibility with:
• Bash 3.2 on macOS
• Git Bash on Windows (use powershell.exe where appropriate)
• WSL2
• Ubuntu 22–24
• x64 and arm64 architectures
Please provide a test_ script that verifies the script on each platform.
Use set -e and set -o pipefail for bash
For both powerhshell files and bash files, use functions and DRY things as much as possible.
Add verification checks for all inputs, whether files, dirs, or variables, and make contractual boundaries and division of responsibility clear.
examples:
- input: |
# Good scenario:
build.sh and test_build.sh
deploy.sh and test_deploy.sh

# Bad scenario:
build.sh (no test script)
output: "All .sh files have matching test_ scripts for cross-platform testing"
metadata:
priority: high
version: 1.0
</rule>
75 changes: 75 additions & 0 deletions .cursor/rules/creating-rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
description: Cursor Rules Location
globs: *.mdc

Check warning on line 3 in .cursor/rules/creating-rules.mdc

View workflow job for this annotation

GitHub Actions / Spell checking

`mdc` is not a recognized word. (unrecognized-spelling)
---
# Cursor Rules Location

Rules for placing and organizing Cursor rule files in the repository.

<rule>
name: cursor_rules_location
description: Standards for placing Cursor rule files in the correct directory
filters:
# Match any .mdc files
- type: file_extension
pattern: "\\.mdc$"
# Match files that look like Cursor rules
- type: content
pattern: "(?s)<rule>.*?</rule>"
# Match file creation events
- type: event
pattern: "file_create"

actions:
- type: reject
conditions:
- pattern: "^(?!\\.\\/\\.cursor\\/rules\\/.*\\.mdc$)"
message: "Cursor rule files (.mdc) must be placed in the .cursor/rules directory"

- type: suggest
message: |
When creating Cursor rules:

1. Always place rule files in PROJECT_ROOT/.cursor/rules/:
```
.cursor/rules/
├── your-rule-name.mdc
├── another-rule.mdc
└── ...
```

2. Follow the naming convention:
- Use kebab-case for filenames
- Always use .mdc extension
- Make names descriptive of the rule's purpose

3. Directory structure:
```
PROJECT_ROOT/
├── .cursor/
│ └── rules/
│ ├── your-rule-name.mdc
│ └── ...
└── ...
```

4. Never place rule files:
- In the project root
- In subdirectories outside .cursor/rules
- In any other location

examples:
- input: |
# Bad: Rule file in wrong location
rules/my-rule.mdc
my-rule.mdc
.rules/my-rule.mdc

# Good: Rule file in correct location
.cursor/rules/my-rule.mdc
output: "Correctly placed Cursor rule file"

metadata:
priority: high
version: 1.0
</rule>
75 changes: 75 additions & 0 deletions .cursor/rules/git-commits.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
description: Git Conventional Commits
globs:
---
Rule for automatically committing changes made by CursorAI using conventional commits format.

<rule>
name: conventional_commits
description: Automatically commit changes made by CursorAI using conventional commits format
filters:
- type: event
pattern: "build_success"
- type: file_change
pattern: "*"

actions:
- type: execute
command: |
# Extract the change type and scope from the changes
CHANGE_TYPE=""
case "$CHANGE_DESCRIPTION" in
*"add"*|*"create"*|*"implement"*) CHANGE_TYPE="feat";;
*"fix"*|*"correct"*|*"resolve"*) CHANGE_TYPE="fix";;
*"refactor"*|*"restructure"*) CHANGE_TYPE="refactor";;
*"test"*) CHANGE_TYPE="test";;
*"doc"*|*"comment"*) CHANGE_TYPE="docs";;
*"style"*|*"format"*) CHANGE_TYPE="style";;
*"perf"*|*"optimize"*) CHANGE_TYPE="perf";;
*) CHANGE_TYPE="chore";;
esac

Check warning on line 30 in .cursor/rules/git-commits.mdc

View workflow job for this annotation

GitHub Actions / Spell checking

`esac` is not a recognized word. (unrecognized-spelling)

# Extract scope from file path
SCOPE=$(dirname "$FILE" | tr '/' '-')W

# Commit the changes
git add "$FILE"
git commit -m "$CHANGE_TYPE($SCOPE): $CHANGE_DESCRIPTION"

- type: suggest
message: |
Changes should be committed using conventional commits format:

Format: <type>(<scope>): <description>

Types:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests or correcting existing tests
- chore: Changes to the build process or auxiliary tools

The scope should be derived from the file path or affected component.
The description should be clear and concise, written in imperative mood.
For anything in .github or ci folders, (ci) is the correct scope.

examples:
- input: |
# After adding a new function
CHANGE_DESCRIPTION="add user authentication function"
FILE="src/auth/login.ts"
output: "feat(src-auth): add user authentication function"

- input: |
# After fixing a bug
CHANGE_DESCRIPTION="fix incorrect date parsing"
FILE="lib/utils/date.js"
output: "fix(lib-utils): fix incorrect date parsing"

metadata:
priority: high
version: 1.0
</rule>
4 changes: 4 additions & 0 deletions .cursor/rules/rust.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
description: Run cargo fmt after making changes
globs: *.rs
---
33 changes: 33 additions & 0 deletions .github/actions/install-nasm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Install NASM'
description: 'Install NASM (Netwide Assembler) on various platforms'
runs:
using: "composite"
steps:
- name: Install NASM on macOS
if: runner.os == 'macOS'
shell: bash
run: brew install nasm

- name: Install NASM on Ubuntu
if: runner.os == 'Linux'
shell: bash
run: sudo apt-get install -y nasm || sudo apt-get update && sudo apt-get install -y nasm

- name: Install NASM on Windows
if: runner.os == 'Windows'
shell: powershell
run: |
try {
winget install NASM.NASM --accept-source-agreements --accept-package-agreements
} catch {
Write-Host "Winget installation failed, falling back to manual installation"
$url = "https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/win64/nasm-2.16.03-installer-x64.exe"
Invoke-WebRequest -Uri $url -OutFile nasminst.exe
Start-Process -FilePath .\nasminst.exe -ArgumentList "/S" -Wait
}
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files (x86)\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Print installed NASM version
shell: bash
run: nasm -v
53 changes: 53 additions & 0 deletions .github/actions/setup-git-win-arm64/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Setup Git for Windows ARM64'
description: 'Set up Git for Windows ARM64 environment with necessary tools'
# maybe switch to winget someday?
# Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
runs:
using: "composite"
steps:

- name: Check if Git is installed, returning step variable
shell: powershell
id: git-installed
run: |
if (Test-Path "C:\Program Files\Git\bin\git.exe") {
Write-Host "Git is already installed. Skipping installation."
echo "git-installed=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
} else {
Write-Host "Git is not installed"
echo "git-installed=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
}


- name: Install Git
shell: powershell
run: |
echo "Installing Git"
$url = "https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.2/Git-2.47.1.2-arm64.exe"
Invoke-WebRequest -Uri $url -OutFile git-installer.exe
Start-Process -FilePath .\git-installer.exe -ArgumentList "/VERYSILENT", "/NORESTART" -Wait
if: steps.git-installed.outputs.git-installed == 'false'


- name: Add Git and GNU tools (required for actions/cache to work (tar is needed)) to PATH
shell: powershell
run: |
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
ls "C:\Program Files\Git\bin\"


- name: Verify Git and Bash are in PATH
shell: powershell
run: |
echo "PATH: $env:PATH"
echo "git --version"
git --version
echo "bash --version"
bash --version

- name: Verify bash steps now work
shell: bash
run: |
echo "shell: bash works"

67 changes: 67 additions & 0 deletions .github/actions/setup-win-arm64/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: 'Setup Windows ARM64'
description: 'Set up Windows ARM64 environment with necessary tools'
# maybe switch to winget someday?
# Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
runs:
using: "composite"
steps:
# - name: Cache tools
# uses: actions/cache@v4
# id: cache-tools
# with:
# path: |
# C:\Users\runneradmin\.rustup
# C:\Users\runneradmin\.cargo
# key: ${{ runner.os }}-arm64-tools-v3

- name: Setup Git
uses: ./.github/actions/setup-git-win-arm64

- name: Install Visual Studio Build Tools (Preview)
shell: powershell
run: |
$url = "https://aka.ms/vs/17/release/vs_buildtools.exe"
Invoke-WebRequest -Uri $url -OutFile vs_buildtools.exe
Start-Process -FilePath .\vs_buildtools.exe -ArgumentList "--quiet", "--wait", "--norestart", "--nocache", `
"--installPath", "C:\BuildTools", `
"--channelUri", "https://aka.ms/vs/17/pre/channel", ` #https://aka.ms/vs/17/release/channel
"--add", "Microsoft.VisualStudio.Component.VC.Tools.ARM64", `
"--add", "Microsoft.VisualStudio.Component.Windows11SDK.22621" `
-NoNewWindow -Wait

- name: Install Rust
shell: powershell
run: |
$url = "https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe"
Invoke-WebRequest -Uri $url -OutFile rustup-init.exe
.\rustup-init.exe -y --default-host aarch64-pc-windows-msvc --profile minimal


- name: Install NASM
uses: ./.github/actions/install-nasm

- name: List tool directories
shell: powershell
run: |
echo listing tool directories
ls "C:\BuildTools\Common7\Tools\"
ls "C:\Program Files\Git\bin\"
ls "C:\BuildTools\VC\Tools\MSVC\"
ls "C:\Program Files (x86)\Windows Kits\10\include\"
ls "C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt"
- name: Adding tools to PATH/INCLUDE/LIB/LIBPATH
shell: powershell
env:
msvc_ver: "14.43.34618"
sdk_ver: "10.0.22621.0"

run: |
echo "Adding tools to PATH"
echo "C:\BuildTools\Common7\Tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\BuildTools\VC\Tools\MSVC\$msvc_ver\bin\Hostx64\arm64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\BuildTools\VC\Tools\MSVC\$msvc_ver\bin\Hostx64\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "Setting up INCLUDE, LIB, LIBPATH environment variables"
echo "INCLUDE=C:\BuildTools\VC\Tools\MSVC\$msvc_ver\include;C:\Program Files (x86)\Windows Kits\10\include\$sdk_ver\ucrt" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "LIB=C:\BuildTools\VC\Tools\MSVC\$msvc_ver\lib\arm64;C:\Program Files (x86)\Windows Kits\10\lib\$sdk_ver\ucrt\arm64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "LIBPATH=C:\BuildTools\VC\Tools\MSVC\$msvc_ver\lib\arm64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Loading
Loading