Skip to content

Commit

Permalink
Deps: Drop the experimental support for n2 builds
Browse files Browse the repository at this point in the history
n2 is missing some features and doesn't seem as actively maintained as ninja itself. Sadly, the speedup from "better incremental builds" isn't very noticeable in practice. On the other hand, using n2 instead of ninja in the CI workflow adds a full minute for building Rust code with `cargo`.

I'm not too happy about the Rust toolchain dependency in general (although it's also required for wgpu-native currently), so that's another reason to stick with ninja for the time being. It can still be used with an alias if needed, but I don't know that it's worth supporting two mostly identical build tools when I'd actually prefer to have zero.
  • Loading branch information
rdw-software committed Jan 7, 2025
1 parent f8bddd5 commit 3086c3b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ jobs:
- name: Install Ninja
run: sudo apt-get install ninja-build

- name: Install n2
run: cargo install --git https://github.com/evmar/n2

# Can't actually be used on CI runners, but we need the headers for embedding webview
- name: Install WebKitGTK
run: sudo apt-get install gtk+-3.0-dev webkit2gtk-4.1-dev --yes
Expand Down
10 changes: 1 addition & 9 deletions unixbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,7 @@ $LUAJIT_EXE ninjabuild.lua
# LuaJIT's jit module is implemented in Lua and needs to be loaded via LUA_PATH for bytecode generation
export LUA_PATH="$BUILD_DIR/?.lua;./?.lua"

if which n2 > /dev/null; then # Using n2 speeds up local development as it has better change detection
BUILD_TOOL=n2
else # Ninja works just as well and is expected to be installed in all cases (required for building deps via CMake)
BUILD_TOOL=ninja
fi

echo "Selected build tool: $BUILD_TOOL"

# This will only work after the dependencies have been built! (Run the deps/build-X.sh scripts manually at least once)
# The reason this is excluded from the ninja build is to eliminate propagated errors that are difficult to debug/misleading
# It's much easier to see if the dependencies could be built independently and they don't usually need rebuilding anyway
$BUILD_TOOL
ninja

0 comments on commit 3086c3b

Please sign in to comment.