Debian Bug report logs - #1029307
node-katex: reproducible-builds: build path in .mjs files

Package: src:node-katex; Maintainer for src:node-katex is Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>;

Reported by: Vagrant Cascadian <vagrant@reproducible-builds.org>

Date: Sat, 21 Jan 2023 02:57:01 UTC

Severity: normal

Tags: patch

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>:
Bug#1029307; Package src:node-katex. (Sat, 21 Jan 2023 02:57:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
New Bug report received and forwarded. Copy sent to reproducible-bugs@lists.alioth.debian.org, Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>. (Sat, 21 Jan 2023 02:57:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: submit@bugs.debian.org
Subject: node-katex: reproducible-builds: build path in .mjs files
Date: Fri, 20 Jan 2023 18:53:56 -0800
[Message part 1 (text/plain, inline)]
Source: node-katex
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps kernel
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

The build path is embedded in various .mjs files:

  https://tests.reproducible-builds.org/debian/rb-pkg/bookworm/amd64/diffoscope-results/node-katex.html

  /usr/share/javascript/katex/contrib/auto-render.mjs

  import·katex·from·'/build/1st/node-katex-0.16.4+~cs6.1.0/contrib/katex.mjs';
  vs.
  import·katex·from·'/build/2/node-katex-0.16.4+~cs6.1.0/2nd/contrib/katex.mjs';

Obviously, the build path is not likely to be present on an installed
system, so these files are presumably not functional.

The attached patch fixes this in debian/rules by replacing the build
path to katex.mjs with the installed path of katex.mjs.

Alternately, dropping these non-functional .mjs files might fix the
issue?

Hopefully it might also be possible to fix the problem some other way;
my guess is that rollup.config.js is where the build path gets embedded,
though I am honestly not sure:

  https://sources.debian.org/src/node-katex/0.16.4%2B~cs6.1.0-1/rollup.config.js/#L18


According to my local tests, with this patch applied node-katex should
build reproducibly on tests.reproducible-builds.org!

Thanks for maintaining node-katex!

live well,
  vagrant
[0001-debian-rules-Replace-build-path-with-installed-path-.patch (text/x-diff, inline)]
From bb4205c0a9b6f045bb614b3b9d9212a7b7c4ffe9 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sat, 21 Jan 2023 02:41:10 +0000
Subject: [PATCH] debian/rules: Replace build path with installed path to
 katex.mjs in several contrib .mjs files.

---
 debian/rules | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/debian/rules b/debian/rules
index aba1567..9c3a32a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,3 +17,6 @@ override_dh_install:
 	# Remove useless files
 	rm -rf debian/katex/usr/share/nodejs/katex/src/metrics \
 		debian/katex/usr/share/nodejs/katex/src/fonts/generate_fonts.py
+	# Replace build path with installed path
+	sed -i -e "s,$(CURDIR)/contrib/katex.mjs,/usr/share/javascript/katex/katex.mjs,g" \
+		debian/*/usr/share/javascript/katex/contrib/*.mjs
-- 
2.39.0

[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed May 17 10:58:43 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.