From 09d4bba25b46328dd038fb842264eca981e00f1a Mon Sep 17 00:00:00 2001 From: Dominic Rubas <1042243+rubas@users.noreply.github.com> Date: Thu, 24 Sep 2026 22:07:53 +0200 Subject: [PATCH] chore: drop devenv, take the toolchain from the host rubas/dev is retired. The Taskfile now sets EXMPEG_BUILD=1, and AGENTS.md names the host packages a source build needs, the same way our other NIF libraries do. --- .gitignore | 6 ----- AGENTS.md | 10 ++++++-- README.md | 3 ++- Taskfile.yml | 5 ++++ devenv.lock | 65 ---------------------------------------------------- devenv.nix | 31 ------------------------- 6 files changed, 15 insertions(+), 105 deletions(-) delete mode 100644 devenv.lock delete mode 100644 devenv.nix diff --git a/.gitignore b/.gitignore index 3439cd6..e3dc140 100644 --- a/.gitignore +++ b/.gitignore @@ -23,11 +23,5 @@ test/fixtures/* .hex-home/ .mix-home/ -# devenv runtime state (devenv.lock is checked in) -.dev/ -.devenv/ -.direnv/ -devenv.yaml - # Claude .claude/ diff --git a/AGENTS.md b/AGENTS.md index 756ff65..a62f1f6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,8 +22,14 @@ change to a demux, mux, or codec path. CI runs it on every pull request and on every push to `main`. The first `task compile` builds the NIF from source and takes several -minutes. devenv sets `EXMPEG_BUILD=1`, so a local build never pulls a -precompiled artefact. +minutes. The Taskfile sets `EXMPEG_BUILD=1`, so a local build never pulls +a precompiled artefact. + +The toolchain comes from the host: the Elixir, OTP, and Rust versions in +`.github/workflows/ci.yml`, plus FFmpeg 9 with its headers, `pkg-config`, +and libclang for bindgen. On Arch that is `pacman -S ffmpeg clang`. A +distro with an older FFmpeg builds 9 from source the way +`.github/actions/setup/action.yml` does. ## Layout diff --git a/README.md b/README.md index be524a5..5bc07ed 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,8 @@ To build the NIF from source, install Rust 1.98 or newer and set - Access to GitHub: the NIF builds on [our rsmpeg fork](https://github.com/rubas/rsmpeg) until an rsmpeg release on crates.io supports FFmpeg 9, so Cargo fetches it from there. -- Rust 1.98+ for source builds. +- Rust 1.98+ for source builds, and libclang for `bindgen`. Set + `LIBCLANG_PATH` when libclang is not in a default library path. - Elixir 1.17+ / OTP 26+ (the NIF targets Erlang NIF version 2.17). ## Runtime requirements (precompiled NIF consumers) diff --git a/Taskfile.yml b/Taskfile.yml index 84c44d9..0205d5b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -4,6 +4,11 @@ version: "3" vars: CARGO_MANIFEST: native/exmpeg_native/Cargo.toml +# Local builds compile the NIF from source; only Hex consumers fetch a +# precompiled artefact. +env: + EXMPEG_BUILD: "1" + tasks: setup: desc: Install Elixir deps diff --git a/devenv.lock b/devenv.lock deleted file mode 100644 index 82fbd1c..0000000 --- a/devenv.lock +++ /dev/null @@ -1,65 +0,0 @@ -{ - "nodes": { - "devenv": { - "locked": { - "dir": "src/modules", - "lastModified": 1789991752, - "narHash": "sha256-SiH+H00IutELZBg7BBNo6r5DU6E+DG7DjrbeX5+QLa0=", - "owner": "cachix", - "repo": "devenv", - "rev": "1c57b5dea0d400af97053fdd1a536fca17378f73", - "type": "github" - }, - "original": { - "dir": "src/modules", - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "nixpkgs": { - "inputs": { - "nixpkgs-src": "nixpkgs-src" - }, - "locked": { - "lastModified": 1789506231, - "narHash": "sha256-vNkJbtmqyBfFhn/HnzQo4ROuoyYWuy/allqTfJb4kMY=", - "owner": "cachix", - "repo": "devenv-nixpkgs", - "rev": "c2f38fe7f9e04d9aadd354d380f2bd40531d9737", - "type": "github" - }, - "original": { - "owner": "cachix", - "ref": "rolling", - "repo": "devenv-nixpkgs", - "type": "github" - } - }, - "nixpkgs-src": { - "flake": false, - "locked": { - "lastModified": 1789370336, - "narHash": "sha256-6RSEDHIWQtesQKWSu5qRai8L2h4KgCgMEfJHstW99G4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c7def046b9a883d46974757852106483d741586f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "devenv": "devenv", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} \ No newline at end of file diff --git a/devenv.nix b/devenv.nix deleted file mode 100644 index 64f50e8..0000000 --- a/devenv.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ pkgs, lib, ... }: -{ - imports = [ - ../dev/modules/elixir.nix - ../dev/modules/rust.nix - ]; - - # rsmpeg drives bindgen against the system FFmpeg headers. Bindgen - # needs libclang plus the libc include path; pkg-config (provided by - # the elixir module) locates the FFmpeg .pc files. rsmpeg binds - # FFmpeg 9, which is the nixpkgs `ffmpeg`. - # - # `pkgs.glibc` is undefined on Darwin, so the glibc.dev package and - # its BINDGEN env entry are gated to Linux. On Darwin the system SDK - # headers cover the same role and bindgen finds them automatically. - packages = [ - pkgs.ffmpeg - pkgs.libclang - ] - ++ lib.optional pkgs.stdenv.isLinux pkgs.glibc.dev; - - env = { - LIBCLANG_PATH = "${pkgs.libclang.lib}/lib"; - # Force a from-source NIF build during development - precompiled - # artefacts are only fetched by published-Hex consumers. - EXMPEG_BUILD = "1"; - } - // lib.optionalAttrs pkgs.stdenv.isLinux { - BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include"; - }; -}