Notes on the Debian packaging of Dart Sass ========================================== Three binary packages --------------------- sass architecture: all; owns the generic command name /usr/bin/sass and its manual page, and depends on "dart-sass | node-sass". The command is a shell wrapper that runs dart-sass when it is installed and the JavaScript build otherwise. dart-sass the compiler as a self-contained native executable, installed as /usr/bin/dart-sass. It is built for the architectures dart-sdk supports -- amd64, arm64, armhf and riscv64 as of 3.13.4 -- and debian/control carries that same list, so the two stay in step. node-sass the dart2js build of the same compiler: the Node.js module "sass" under /usr/share/nodejs/sass for bundlers such as webpack's sass-loader, and the command line compiler next to it as sass.js. Why the generic name has its own package ---------------------------------------- ruby-sass installed /usr/bin/sass and was architecture: all, so every architecture had a Sass compiler. ruby-sass 3.7.4-7 (2026-09-28) dropped its command line tools, and its replacement, dart-sass, exists only where the Dart SDK is ported to: four architectures. Anything that shells out to sass lost the compiler on i386, loong64, ppc64el and s390x. Both builds are the same Dart sources compiled two ways, so the way out is to let each architecture use the build it can have. An architecture: all package is the only kind that exists everywhere, hence Depends: dart-sass | node-sass which resolves to the native build on the four architectures it is built for and to the JavaScript build elsewhere. The latter needs Node.js, which is available on every release architecture, and is slower: the compiler is JavaScript rather than an AOT snapshot. dart-sass Recommends: sass, so systems that had the symlink get the wrapper on upgrade. The name stays a plain file of ours rather than an update-alternatives entry: alternatives would have to be maintained by both compiler packages, and would still leave /usr/bin/sass unowned when neither is installed. This package takes over /usr/bin/sass and its manual page from the older ruby-sass, and makes apt upgrade ruby-sass first: Breaks: ruby-sass (<< 3.7.4-7~) Replaces: ruby-sass (<< 3.7.4-7~) /usr/bin/scss and /usr/bin/sass-convert are Ruby Sass specific and have no Dart Sass equivalent; they left the archive with ruby-sass 3.7.4-7. What the JavaScript build does not do ------------------------------------- Both builds accept the same options, from the same sources; the difference is in the platform layer, and there is exactly one feature gap. --embedded, the embedded protocol used by the sass-embedded clients of the JavaScript ecosystem, is only compiled into the native build; the JavaScript build prints "sass --embedded is unavailable in pure JS mode." and exits 1. sass --version also differs: the JavaScript build appends " compiled with dart2js ", because -Dnode=true is passed to dart2js as upstream does. The JavaScript build is wrapped, not just compiled -------------------------------------------------- dart2js output is not directly usable from Node.js. Upstream wraps it with its build tool cli_pkg, which cannot run during a Debian build (its tasks drive npm), so debian/make-node-module.py reproduces the same wrapper: it inlines the node_preamble, injects the require()s the Dart code performs, and writes the CommonJS/ESM entry points and the executable launcher listed in upstream's tool/grind.dart. cli_pkg also generates the entry point it compiles, which puts the library and the command line compiler into a single bundle. debian/sass_npm.dart stands in for it: it imports both, runs the library's main() and exports the compiler's main() as cli_pkg_main_0_, which sass.js calls with the command line arguments. TypeScript definitions are not shipped -------------------------------------- Upstream's npm package also contains types/*.d.ts. Those are not part of this source package: upstream copies them out of a second repository (the sass/sass specification repository, see _fetchJSTypes() in tool/grind.dart) at build time, which a Debian build cannot do. The "types" and "exports.types" fields are therefore absent from the generated package.json. -- Emfox Zhou , Sun, 15 Nov 2026 20:20:00 +0800