From c943c31f5d5e0d7e207e2d67e191a78644a24596 Mon Sep 17 00:00:00 2001 From: LeSingh1 Date: Mon, 18 May 2026 00:06:07 -0700 Subject: [PATCH] build: enable line tables in release builds (fixes #103) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stack traces from release-built tiktoken wheels do not include file or line numbers, which makes debugging panics that surface through the Python extension harder than it needs to be (cf. #103). Set `debug = "line-tables-only"` for the release profile. This adds just enough DWARF for backtraces to resolve file:line, without the binary-size cost of full `debug = true`. Optimization level is unaffected, so the original concern that motivated stripping debug info — runtime performance — is preserved (the benchmark in #103 showed identical throughput before/after enabling debug). --- Cargo.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index df3235c5..8bb74085 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,3 +24,9 @@ fancy-regex = "0.17.0" regex = "1.10.3" rustc-hash = "2" bstr = "1.5.0" + +[profile.release] +# Keep line tables in release builds so panic stack traces include +# file/line numbers without significantly inflating wheel size or +# affecting runtime performance. +debug = "line-tables-only"