#1058552 science.js: FTBFS: SyntaxError: Error parsing /<<PKGBUILDDIR>>/package.json: Unexpected end of JSON input

Package:
src:science.js
Source:
src:science.js
Submitter:
Lucas Nussbaum
Date:
2026-05-23 10:21:06 UTC
Severity:
normal
Tags:
#1058552#5
Date:
2023-12-12 20:52:59 UTC
From:
To:
Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.


Relevant part (hopefully):
The full build log is available from:
http://qa-logs.debian.net/2023/12/12/science.js_1.9.3+dfsg-3_unstable.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20231212;users=lucas@debian.org
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20231212&fusertaguser=lucas@debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please mark it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.

#1058552#10
Date:
2024-02-12 16:48:42 UTC
From:
To:
tags 1058552 patch
thanks

Here is a patch that fixes the build:

From: James Valleroy <jvalleroy@mailbox.org>
Date: Sun, 11 Feb 2024 07:40:16 -0500
Subject: Use a temp file for package.json contents
--- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c9e03c2..4cbfec9 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,9 @@ install: package.json: src/package.js @rm -f $@ - node src/package.js > $@ + TEMPFILE=mktemp + node src/package.js > "$TEMPFILE" + mv "$TEMPFILE" $@ @chmod a-w $@ clean:
#1058552#17
Date:
2024-03-28 08:08:30 UTC
From:
To:
[James Valleroy 2024-02-12]

Thank you.  Can you explain why changing the output from package.json to
mktemp and then moving the result to package.json will solve the build
problem?  I fail to understand how this could change anything.

Btw, did you mean TEMPFILE=$(shell mktemp) to get a random temp file
name?

#1058552#22
Date:
2024-04-04 14:13:07 UTC
From:
To:
The makefile receipe uses node to produce the content that will be
written to package.json. It seems that node is also trying to read in
and parse the contents of package.json. Apparently, writing the file is
not an atomic operation, so node is reading it before the write
operation has completed. So it reads some partially-written package.json
file, which is not yet valid JSON, and produces an error when trying to
parse it.

I don't know enough about node to say why it does this (reading in
package.json after it has started running the src/package.js script).

I'm not sure. It may also work, but there is a difference in when a
shell command runs. Some people recommend not to use shell in a
makefile: https://stackoverflow.com/a/76121578

#1058552#27
Date:
2024-04-04 17:01:58 UTC
From:
To:
Quoting James Valleroy (2024-04-04 16:13:07)

Each make target (i.e. each line indended by a tab) is executed within a
shell.  The point in the SO answer you reference is that calling the
make function $(shell ...) *inside* a make target effectively spawns a
shell within another shell, and *that* you rarely really want.

What Petter is talking about above is that "TEMPFILE=mktemp", because it
is a make target (i.e. on a TAB-indented line) is passed to a shell,
which will *not* set TEMPFILE to the output of the shell command mktemp,
but simply set TEMPFILE to the _string_ "mktemp" which is unlikely that
you want.


 - Jonas

#1058552#32
Date:
2024-04-06 01:21:34 UTC
From:
To:
I see, thanks for pointing that out. I think there isn't a need to use
mktemp here, so the patch can be simplified to this:


diff --git a/Makefile b/Makefile
index c9e03c2..f5a954b 100644
--- a/Makefile
+++ b/Makefile
@@ -77,7 +77,8 @@ install:

  package.json: src/package.js
  	@rm -f $@
-	node src/package.js > $@
+	node src/package.js > package.json.temp
+	mv package.json.temp $@
  	@chmod a-w $@

  clean:

#1058552#35
Date:
2024-04-13 14:58:44 UTC
From:
To:
Hello,

Bug #1058552 in science.js reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/js-team/science.js/-/commit/72d4064d48ae6a0f2c0886ea43cf99b1b2ac5754
------------------------------------------------------------------------
Fixed build race condition problem.

Patch from James Valleroy.

Closes: #1058552
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1058552

#1058552#42
Date:
2024-04-13 15:28:35 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
science.js, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1058552@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Petter Reinholdtsen <pere@debian.org> (supplier of updated science.js package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 13 Apr 2024 17:00:11 +0200
Source: science.js
Architecture: source
Version: 1.9.3+dfsg-4
Distribution: unstable
Urgency: medium
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Changed-By: Petter Reinholdtsen <pere@debian.org>
Closes: 1058552
Changes:
 science.js (1.9.3+dfsg-4) unstable; urgency=medium
 .
   [ Debian Janitor ]
   * Update standards version to 4.6.2, no changes needed.
 .
   [ Petter Reinholdtsen ]
   * Fixed build race condition problem (Closes: #1058552).
   * Updated Standards-Version from 4.6.2 to 4.7.0.
Checksums-Sha1:
 d7e595bce4e0c954c3d4e78a90cada1b83ecd39b 2146 science.js_1.9.3+dfsg-4.dsc
 9406112526b41036a185da1db7c313fc6e93e3f2 5204 science.js_1.9.3+dfsg-4.debian.tar.xz
 04d6f5deb9cb96e137c6a802eb06fe3bb5cacc81 9966 science.js_1.9.3+dfsg-4_source.buildinfo
Checksums-Sha256:
 9eb33e221b512be1d253c5a362687296107f2299d4307f5a41d7d54c7e8a02d4 2146 science.js_1.9.3+dfsg-4.dsc
 dd64f6806d8a0afbecc3d720ab2cf909c1f9cf0c77eb4bbaec4643c53f93f648 5204 science.js_1.9.3+dfsg-4.debian.tar.xz
 8e9eeca34908be64e5e21851f843d3ecf6638caa8f185e47c94e5a4decbf0a41 9966 science.js_1.9.3+dfsg-4_source.buildinfo
Files:
 3b3a6d7b7f38df5d4479a6d1f7f1f093 2146 javascript optional science.js_1.9.3+dfsg-4.dsc
 a8f885807956c7b32c3b188ee53ec8a0 5204 javascript optional science.js_1.9.3+dfsg-4.debian.tar.xz
 6b7fedb44e24fba2e9d8d8312fb7cd0c 9966 javascript optional science.js_1.9.3+dfsg-4_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEERqLf4owIeylOb9kkgSgKoIe6+w4FAmYankkACgkQgSgKoIe6
+w4l1g//VALAvPYdVcWWMMVciTEKt82izWauBBdG1vgS0iT9p5OV7AyD/X8JxcAn
SACDkUuBROPHVf7JOvi3FIyz+XKkkcJcjg4i4AodH3QOpZdQ3CpB8nnWKJ8VoNzx
YzrKo+QQbwRDINhtPWT37H2OuLi5H1Ng8dOQEUSszhT7M1AdiuirhYv0Qe6MIkc3
wIUGkbgGY+K5ZpFp2ZExq5onPXm9qoQSZJWPOjfXVYEMiqtYvZ60i65kazXziXAQ
6zX0tllT9o8JssDEnXs7XX6UJceTqdr5aETRwgGMZQFRcp8GlIQms/e8WiIz/9Tn
0FOdLPt4+KsUYhgd1kcpi5hGL4N0XhRAODBAkVjKvQikgcThRtGoHx/mfI2UwDZr
kLsD6H7GUL63hMDJ14CcCjR9JwPIRxia8GtKGwRNzDp5lkEzXzLkKI+ynmtyUVSK
ax+GDCUtjtphqRndCl1lT42FWGqc/oZqJ8yo/ct3YmhR1k6jFZMfsFJX35SjxDF2
POtWM+D3Iy4fL/sjh8e1AzaL5xTYVhpUEwnO7OjYwXwo6C+aSPxN7Z6vxW5LW5JI
qhH5abpZqF6bQjlCw/web856M56ZYEO+qV2se+KlrhG8M+/11wkj9MSBpeEAtCqq
6XMjehdD2v2v6UF2iBPjR/lyztwScaWVo/aAFHwJQO6ptOAy3Uk=
=eVlH
-----END PGP SIGNATURE-----

#1058552#57
Date:
2026-05-23 10:18:49 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
science.js, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1058552@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Santiago Vila <sanvila@debian.org> (supplier of updated science.js package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 20 May 2026 00:30:00 +0200
Source: science.js
Architecture: source
Version: 1.9.3+dfsg-3+deb12u1
Distribution: bookworm
Urgency: medium
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Changed-By: Santiago Vila <sanvila@debian.org>
Closes: 1058552 1078902
Changes:
 science.js (1.9.3+dfsg-3+deb12u1) bookworm; urgency=medium
 .
   * Team upload.
 .
   [ Petter Reinholdtsen ]
   * Fixed build race condition problem. Closes: #1058552, #1078902.
Checksums-Sha1:
 cb57170d069c5ec5a01e2d73a5846665c5fc1f86 1833 science.js_1.9.3+dfsg-3+deb12u1.dsc
 85f16e2d61c36847397c22aa6a9ca15808798df6 5236 science.js_1.9.3+dfsg-3+deb12u1.debian.tar.xz
 56261943e75dbbb51d8c96bf48ce7bba9fd32839 8123 science.js_1.9.3+dfsg-3+deb12u1_source.buildinfo
Checksums-Sha256:
 7a675fa46ce2d8d240391380905d31f9fd9d041548797f1f64bd364f752bc965 1833 science.js_1.9.3+dfsg-3+deb12u1.dsc
 8a91005fcd86166b9d30f658340f66698e385af7f6c9d082530b0f535204d46f 5236 science.js_1.9.3+dfsg-3+deb12u1.debian.tar.xz
 ae4c978edcda93f14df2486d2f9de1afd9d188241fd49498098ced49da1cb847 8123 science.js_1.9.3+dfsg-3+deb12u1_source.buildinfo
Files:
 227f179823e100ce05cc20a9d5d5375f 1833 javascript optional science.js_1.9.3+dfsg-3+deb12u1.dsc
 82df8757fae39b47de1077022c058e75 5236 javascript optional science.js_1.9.3+dfsg-3+deb12u1.debian.tar.xz
 bd3da2b1300ed133d953136426787891 8123 javascript optional science.js_1.9.3+dfsg-3+deb12u1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE1Uw7+v+wQt44LaXXQc5/C58bizIFAmoM7uYACgkQQc5/C58b
izJ5fgf/fNpyl8oUD8HiyExa4uL4sCC8jCwsqD4QC1EMRX5wHWlmuTQOWM3VUyYa
sRkLepCV+3NsreoKpP+fs6ISyqGQhVKtp4hksqu13X0rUlGXe8R0cROvHsxzdIsb
vbskP5UfDoRxykScXGtiHG3e8XJv/4/tAoSykUBAdLvX1jHuZ2gsZ1pcXizi3JQC
6YV1etwy6DZDVje1xI/yqsxhYjp95JD2bL34zryWAoSfNKenQSP1MStS2aotlpAJ
NWQnBCBSuHFo4kb5ny5x0bqMYmOZ9AG/SmweT/bTosM/Lc74VtLxZcGN96+kP+40
u5ywT1U7XyVYAl/KfIfQgnhKRI/tFA==
=mVKP
-----END PGP SIGNATURE-----

#1058552#62
Date:
2026-05-23 10:18:49 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
science.js, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1078902@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Santiago Vila <sanvila@debian.org> (supplier of updated science.js package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 20 May 2026 00:30:00 +0200
Source: science.js
Architecture: source
Version: 1.9.3+dfsg-3+deb12u1
Distribution: bookworm
Urgency: medium
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Changed-By: Santiago Vila <sanvila@debian.org>
Closes: 1058552 1078902
Changes:
 science.js (1.9.3+dfsg-3+deb12u1) bookworm; urgency=medium
 .
   * Team upload.
 .
   [ Petter Reinholdtsen ]
   * Fixed build race condition problem. Closes: #1058552, #1078902.
Checksums-Sha1:
 cb57170d069c5ec5a01e2d73a5846665c5fc1f86 1833 science.js_1.9.3+dfsg-3+deb12u1.dsc
 85f16e2d61c36847397c22aa6a9ca15808798df6 5236 science.js_1.9.3+dfsg-3+deb12u1.debian.tar.xz
 56261943e75dbbb51d8c96bf48ce7bba9fd32839 8123 science.js_1.9.3+dfsg-3+deb12u1_source.buildinfo
Checksums-Sha256:
 7a675fa46ce2d8d240391380905d31f9fd9d041548797f1f64bd364f752bc965 1833 science.js_1.9.3+dfsg-3+deb12u1.dsc
 8a91005fcd86166b9d30f658340f66698e385af7f6c9d082530b0f535204d46f 5236 science.js_1.9.3+dfsg-3+deb12u1.debian.tar.xz
 ae4c978edcda93f14df2486d2f9de1afd9d188241fd49498098ced49da1cb847 8123 science.js_1.9.3+dfsg-3+deb12u1_source.buildinfo
Files:
 227f179823e100ce05cc20a9d5d5375f 1833 javascript optional science.js_1.9.3+dfsg-3+deb12u1.dsc
 82df8757fae39b47de1077022c058e75 5236 javascript optional science.js_1.9.3+dfsg-3+deb12u1.debian.tar.xz
 bd3da2b1300ed133d953136426787891 8123 javascript optional science.js_1.9.3+dfsg-3+deb12u1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE1Uw7+v+wQt44LaXXQc5/C58bizIFAmoM7uYACgkQQc5/C58b
izJ5fgf/fNpyl8oUD8HiyExa4uL4sCC8jCwsqD4QC1EMRX5wHWlmuTQOWM3VUyYa
sRkLepCV+3NsreoKpP+fs6ISyqGQhVKtp4hksqu13X0rUlGXe8R0cROvHsxzdIsb
vbskP5UfDoRxykScXGtiHG3e8XJv/4/tAoSykUBAdLvX1jHuZ2gsZ1pcXizi3JQC
6YV1etwy6DZDVje1xI/yqsxhYjp95JD2bL34zryWAoSfNKenQSP1MStS2aotlpAJ
NWQnBCBSuHFo4kb5ny5x0bqMYmOZ9AG/SmweT/bTosM/Lc74VtLxZcGN96+kP+40
u5ywT1U7XyVYAl/KfIfQgnhKRI/tFA==
=mVKP
-----END PGP SIGNATURE-----