Skip to content

Commit 70e2df0

Browse files
committed
Merge master
2 parents e4c78ef + 76ecdc8 commit 70e2df0

599 files changed

Lines changed: 51587 additions & 21694 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
},
77
"ghcr.io/devcontainers/features/node:1": {}
88
},
9-
"onCreateCommand": "cargo install wasm-pack cargo-watch cargo-about",
9+
"onCreateCommand": "cargo install cargo-watch wasm-pack cargo-about && cargo install -f wasm-bindgen-cli@0.2.100",
1010
"customizations": {
1111
"vscode": {
1212
// NOTE: Keep this in sync with `.vscode/extensions.json`
1313
"extensions": [
1414
// Rust
1515
"rust-lang.rust-analyzer",
1616
"tamasfe.even-better-toml",
17-
"serayuzgur.crates",
1817
// Web
1918
"dbaeumer.vscode-eslint",
2019
"svelte.svelte-vscode",

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake .nix

.github/workflows/build-dev-and-ci.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
9090
- name: 🧪 Run Rust tests
9191
run: |
92-
mold -run cargo test --all-features
92+
mold -run cargo test --all-features --workspace
9393
9494
# miri:
9595
# runs-on: self-hosted
@@ -108,17 +108,6 @@ jobs:
108108
- name: 📥 Clone and checkout repository
109109
uses: actions/checkout@v3
110110

111-
- name: 🔒 Check crate security advisories for root workspace
112-
uses: EmbarkStudios/cargo-deny-action@v2
113-
with:
114-
command: check advisories
115-
116-
- name: 🔒 Check crate security advisories for /libraries/rawkit
117-
uses: EmbarkStudios/cargo-deny-action@v2
118-
with:
119-
command: check advisories
120-
manifest-path: libraries/rawkit/Cargo.toml
121-
122111
- name: 📜 Check crate license compatibility for root workspace
123112
uses: EmbarkStudios/cargo-deny-action@v2
124113
with:

.github/workflows/cargo-deny.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Audit Security Advisories"
2+
3+
on:
4+
# Run once each day
5+
schedule:
6+
- cron: "0 0 * * *"
7+
8+
jobs:
9+
cargo-deny:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: 📥 Clone and checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: 🔒 Check crate security advisories for root workspace
17+
uses: EmbarkStudios/cargo-deny-action@v2
18+
with:
19+
command: check advisories
20+
21+
- name: 🔒 Check crate security advisories for /libraries/rawkit
22+
uses: EmbarkStudios/cargo-deny-action@v2
23+
with:
24+
command: check advisories
25+
manifest-path: libraries/rawkit/Cargo.toml

.github/workflows/comment-clippy-warnings.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ jobs:
99
clippy:
1010
name: Run Clippy
1111
runs-on: ubuntu-latest
12-
if: ${{ !github.event.pull_request.draft }}
12+
# TODO(Keavon): Find a workaround (passing the output text to a separate action with permission to read the secrets?) that allows this to work on fork PRs
13+
if: false
14+
# if: ${{ !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork }}
1315
permissions:
1416
contents: read
1517
pull-requests: write

.github/workflows/comment-profiling-changes.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ env:
99

1010
jobs:
1111
profile:
12-
# TODO(TrueDoctor): Fix and reenable this action
13-
if: false
1412
runs-on: ubuntu-latest
1513
steps:
1614
- uses: actions/checkout@v3
@@ -48,7 +46,7 @@ jobs:
4846
4947
- name: Run baseline benchmarks
5048
run: |
51-
cargo bench --bench compile_demo_art --features=iai -- --save-baseline=master
49+
cargo bench --bench compile_demo_art_iai -- --save-baseline=master
5250
5351
- name: Checkout PR branch
5452
run: |
@@ -57,7 +55,7 @@ jobs:
5755
- name: Run PR benchmarks
5856
id: benchmark
5957
run: |
60-
BENCH_OUTPUT=$(cargo bench --bench compile_demo_art --features=iai -- --baseline=master --output-format=json | jq -sc | sed 's/\\"//g')
58+
BENCH_OUTPUT=$(cargo bench --bench compile_demo_art_iai -- --baseline=master --output-format=json | jq -sc | sed 's/\\"//g')
6159
echo "BENCHMARK_OUTPUT<<EOF" >> $GITHUB_OUTPUT
6260
echo "$BENCH_OUTPUT" >> $GITHUB_OUTPUT
6361
echo "EOF" >> $GITHUB_OUTPUT

.github/workflows/website.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- website/**
1414
env:
1515
CARGO_TERM_COLOR: always
16-
INDEX_HTML_HEAD_INCLUSION: <script defer data-domain="graphite.rs" data-api="/visit/event" src="/visit/script.js"></script>
16+
INDEX_HTML_HEAD_INCLUSION: <script defer data-domain="graphite.rs" data-api="/visit/event" src="/visit/script.hash.js"></script>
1717

1818
jobs:
1919
build:
@@ -30,17 +30,20 @@ jobs:
3030
- name: 🕸 Install Zola
3131
uses: taiki-e/install-action@v2
3232
with:
33-
tool: zola@0.19.1
33+
tool: zola@0.20.0
3434

3535
- name: ✂ Replace template in <head> of index.html
3636
run: |
3737
# Remove the INDEX_HTML_HEAD_INCLUSION environment variable for build links (not master deploys)
3838
git rev-parse --abbrev-ref HEAD | grep master > /dev/null || export INDEX_HTML_HEAD_INCLUSION=""
3939
4040
- name: 🌐 Build Graphite website with Zola
41+
env:
42+
MODE: prod
4143
run: |
4244
cd website
43-
zola build
45+
npm run install-fonts
46+
zola --config config.toml build --minify
4447
4548
- name: 🔍 Check if `website/other` directory changed
4649
uses: dorny/paths-filter@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ target/
44
perf.data*
55
profile.json
66
flamegraph.svg
7+

.nix/flake.lock

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

.nix/flake.nix

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# This is a helper file for people using NixOS as their operating system.
2+
# If you don't know what this file does, you can safely ignore it.
3+
# This file defines both the development environment for the project.
4+
#
5+
# Development Environment:
6+
# - Provides all necessary tools for Rust/WASM development
7+
# - Includes Tauri dependencies for desktop app development
8+
# - Sets up profiling and debugging tools
9+
# - Configures mold as the default linker for faster builds
10+
#
11+
#
12+
# Usage:
13+
# - Development shell: `nix develop`
14+
# - Run in dev shell with direnv: add `use flake` to .envrc
15+
{
16+
description = "Development environment and build configuration";
17+
18+
inputs = {
19+
# This url should be changed to match your system packages if you work on tauri because you need to use the same graphics library versions as the ones used by your system
20+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
21+
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
22+
rust-overlay = {
23+
url = "github:oxalica/rust-overlay";
24+
inputs.nixpkgs.follows = "nixpkgs";
25+
};
26+
flake-utils.url = "github:numtide/flake-utils";
27+
};
28+
29+
outputs = { nixpkgs, nixpkgs-unstable, rust-overlay, flake-utils, ... }:
30+
flake-utils.lib.eachDefaultSystem (system:
31+
let
32+
overlays = [ (import rust-overlay) ];
33+
pkgs = import nixpkgs {
34+
inherit system overlays;
35+
};
36+
pkgs-unstable = import nixpkgs-unstable {
37+
inherit system overlays;
38+
};
39+
40+
rustc-wasm = pkgs.rust-bin.stable.latest.default.override {
41+
targets = [ "wasm32-unknown-unknown" ];
42+
extensions = [ "rust-src" "rust-analyzer" "clippy" "cargo" ];
43+
};
44+
45+
# Shared build inputs - system libraries that need to be in LD_LIBRARY_PATH
46+
buildInputs = with pkgs; [
47+
# System libraries
48+
openssl
49+
vulkan-loader
50+
mesa
51+
libraw
52+
53+
54+
# Tauri dependencies: keep in sync with https://v2.tauri.app/start/prerequisites/
55+
at-spi2-atk
56+
atkmm
57+
cairo
58+
gdk-pixbuf
59+
glib
60+
gtk3
61+
harfbuzz
62+
librsvg
63+
libsoup_3
64+
pango
65+
webkitgtk_4_1
66+
openssl
67+
];
68+
69+
# Development tools that don't need to be in LD_LIBRARY_PATH
70+
buildTools = [
71+
rustc-wasm
72+
pkgs.nodejs
73+
pkgs.nodePackages.npm
74+
pkgs.binaryen
75+
pkgs.wasm-bindgen-cli
76+
pkgs-unstable.wasm-pack
77+
pkgs.pkg-config
78+
pkgs.git
79+
pkgs.gobject-introspection
80+
pkgs-unstable.cargo-tauri
81+
pkgs-unstable.cargo-about
82+
83+
# Linker
84+
pkgs.mold
85+
];
86+
# Development tools that don't need to be in LD_LIBRARY_PATH
87+
devTools = with pkgs; [
88+
cargo-watch
89+
cargo-nextest
90+
cargo-expand
91+
92+
# Profiling tools
93+
gnuplot
94+
samply
95+
cargo-flamegraph
96+
97+
];
98+
in
99+
{
100+
# Development shell configuration
101+
devShells.default = pkgs.mkShell {
102+
packages = buildInputs ++ buildTools ++ devTools;
103+
104+
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
105+
GIO_MODULE_DIR="${pkgs.glib-networking}/lib/gio/modules/";
106+
XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS";
107+
108+
109+
shellHook = ''
110+
alias cargo='mold --run cargo'
111+
'';
112+
};
113+
}
114+
);
115+
}

0 commit comments

Comments
 (0)