[Pkg-javascript-devel] Bug#1135146: emscripten: emcc: error: babel was not found!

Frank Heckenbach f.heckenbach at fh-soft.de
Wed Apr 29 12:24:42 BST 2026


Hi,

> Le mar. 28 avr. 2026 à 11:23, Frank Heckenbach <f.heckenbach at fh-soft.de> a
> écrit :
> 
> > Package: emscripten
> > Version: 3.1.69+dfsg-3
> > Severity: normal
> >
> > I don't know much about emscripten. I was just trying to build the
> > web version of sgt-puzzles. This worked under bookworm.
> >
> > The message tells me to report a bug, so that's what I'm doing.
> >
> > If I need to install some package (which? There are many packages
> > with "babel" in their name) or need to do something differently,
> > please let me know (or better, include it in the message).
> >
> > Here's how to reproduce:
> >
> > mkdir emscripten-test
> > cd emscripten-test
> > apt-get source sgt-puzzles/forky
> > cd */.
> > emcmake cmake .
> > cmake  --build .
> >
> 
> it seems you are not trying to build a Debian package at all.
> Right ?

I'm trying to use the Debian package of emcc to build something that
is not a Debian package.

> If so, your problem is not a problem in the emscripten debian
> package.

Well, if I used, say, gcc to compile some program I wrote myself,
and gcc failed with an internal compiler error, it would still be a
bug in gcc (possibly also a bug in my code, but definitely a bug in
gcc). Especially seeing that the message explicitly says:

  Please report this as a bug against emscripten

Which I did.

> If you need babel, you can "apt install node-babel7",

Didn't help unfortunately.

> but it might install
> a version that sgt-puzzles doesn't expect.

I don't think sgt-puzzles expects any of this. In fact, their
sources don't mention babel at all ("grep -ie babel .").

To me it looks like babel is something interenally used by emcc
(to continue the example above, if the problem was in libgcc, it
would still be a bug in gcc plus its environment, not necessarily in
my code).

In fact, I grepped the sources of emscripten. The bookworm version
didn't mention babel at all, except for some comments like "At some
point we may want to look into using this as way to convert to ES5
but babel is perhaps a better tool for that.", whereas the trixie
version contains many references to babel. So it seems emscripten
made this change proposed in that comment, sometime between bookworm
and trixie, but it doesn't work. Whether it's just a missing
dependency or a deeper issue, I have no idea.

With "cmake --verbose", I see the failing command:

/usr/share/emscripten/emcc \
  -fmacro-prefix-map=/tmp/sgt-puzzles-20250730.a7c7826=/puzzles \
  -fmacro-prefix-map=/tmp/sgt-puzzles-20250730.a7c7826=/build -s \
  ALLOW_MEMORY_GROWTH=1 -s ENVIRONMENT=web -s \
  EXPORTED_FUNCTIONS='["_mouseup","_mousedown","_mousemove","_key","_timer_callback","_command","_get_text_format","_free_text_format","_get_save_file","_free_save_file","_load_game","_dlg_return_sval","_dlg_return_ival","_resize_puzzle","_restore_puzzle_size","_rescale_puzzle","_prefs_load_callback","_malloc","_free","_main"]' \
  -s EXPORTED_RUNTIME_METHODS='[cwrap]' \
  -s MIN_FIREFOX_VERSION=68 -s MIN_SAFARI_VERSION=150000 -s MIN_CHROME_VERSION=57 \
  -s MIN_NODE_VERSION=0x7FFFFFFF -s STRICT_JS=1 -s WASM=1 -s WASM_BIGINT @CMakeFiles/bridges.dir/objects1.rsp -o bridges.js @CMakeFiles/bridges.dir/linkLibs.rsp

After some trial and error I found that it works if I remove this:

  -s MIN_FIREFOX_VERSION=68 -s MIN_SAFARI_VERSION=150000 -s MIN_CHROME_VERSION=57 \

As I said, I don't know much about emscripten, just trying to use
it. From what I could google, it seems that it tries to transpile
the code to work with older browsers using babel, and that fails.

By removing these settings, it apparently won't do this, so the
generated code will probably only work on the newest browsers, like
half of the web anyway, so whatever ...



More information about the Pkg-javascript-devel mailing list