Hey folks,
I am getting the below error while building my docker image for my rescript project. Has anyone faced a similar issue before?
=> ERROR [13/15] RUN yarn bs:build 1.4s
------
> [13/15] RUN yarn bs:build:
#18 1.079 yarn run v1.22.17
#18 1.246 $ rescript build -with-deps
#18 1.399 Dependency on @rescript/react
#18 1.403 /node_modules/rescript/linux/ninja.exe: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
#18 1.403 Failure: /node_modules/rescript/linux/ninja.exe
#18 1.403 Location: /node_modules/@rescript/react/lib/bs
#18 1.390 error Command failed with exit code 2.
#18 1.391 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
As you can see from the error snippet above, the above issue comes when the command yarn bs: build
runs, which is essentially rescript build -with-deps
(Refer to the docker file below)
help/suggestions would be appreciated.
Cheers
Prateek
below is the snippet of my docker file
FROM node:12-alpine
LABEL maintainer="prateekpandey@porter.in"
RUN apk --update add bash vim git python3 g++ make gcc musl-dev m4 libgcc libstdc++ ncurses-libs
RUN ln -s /usr/bin/python3 /usr/bin/python
# To make re-formality ppx work
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.30-r0/glibc-2.30-r0.apk
RUN apk add glibc-2.30-r0.apk
ARG ENV
# Copy package.json, so that yarn install will only do a fresh installation of node modules if package.json is modified
ADD package.json .
ADD yarn.lock .
ARG GITHUB_READ_TOKEN
RUN echo -e "machine github.com\nlogin Prateek13727\npassword $GITHUB_READ_TOKEN" > ~/.netrc
RUN yarn install --ignore-engines --frozen-lockfile
RUN rm ~/.netrc
ADD . ./
RUN yarn bs:build
RUN yarn build:$ENV
# Expose the app port
EXPOSE 3003
COPY deploy/scripts/* /usr/bin/
ENTRYPOINT ["bash", "/usr/bin/run.sh"]
Sorry I don’t have any solutions for you, but could this be related?
opened 02:45PM - 08 Jul 19 UTC
closed 02:21AM - 26 Sep 21 UTC
Alpine 3.8
Seems to be an upstream issue with ninja
https://github.com/nin… ja-build/ninja/issues/1510
One possibility to "fix" this from bucklescript's side is to use the operating system supplied ninja if possible. This would also speed up builds.
https://pkgs.alpinelinux.org/packages?name=ninja&branch=v3.8
```
#!/bin/bash -eo pipefail
yarn install --non-interactive
yarn install v1.12.3
info No lockfile found.
[1/4] Resolving packages...
warning react-dates > react-addons-shallow-compare > fbjs > core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
warning Resolution field "react-dates@18.4.0" is incompatible with requested version "react-dates@^16.5.0"
warning @glennsl/bs-jest > jest > jest-cli > prompts > kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
warning @glennsl/bs-jest > jest > jest-cli > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
warning bs-dom-testing-library > dom-testing-library@3.19.4: 🚨 dom-testing-library has moved to @testing-library/dom. Please uninstall dom-testing-library and install @testing-library/dom instead, or use an older version of dom-testing-library. Learn more about this change here: https://github.com/testing-library/dom-testing-library/issues/260 Thanks! :)
warning bs-react-testing-library > react-testing-library@5.9.0: 🚨 react-testing-library has moved to @testing-library/react. Please uninstall react-testing-library and install @testing-library/react instead, or use an older version of react-testing-library. Learn more about this change here: https://github.com/testing-library/dom-testing-library/issues/260 Thanks! :)
warning bs-react-testing-library > react-testing-library > dom-testing-library@3.19.4: 🚨 dom-testing-library has moved to @testing-library/dom. Please uninstall dom-testing-library and install @testing-library/dom instead, or use an older version of dom-testing-library. Learn more about this change here: https://github.com/testing-library/dom-testing-library/issues/260 Thanks! :)
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > react-dates@18.4.0" has unmet peer dependency "moment@^2.18.1".
warning "react-dates > react-moment-proptypes@1.6.0" has unmet peer dependency "moment@>=1.6.0".
warning " > @ahrefs/bs-atdgen-codec-runtime@1.0.5" has incorrect peer dependency "bs-platform@^4.0.5".
warning " > @glennsl/bs-json@3.0.0" has incorrect peer dependency "bs-platform@^4.0.2".
warning " > @fuse/s3-browser@1.0.22" has incorrect peer dependency "react@16.8.4".
warning " > @fuse/s3-browser@1.0.22" has incorrect peer dependency "react-dom@16.8.4".
warning "@fuse/s3-browser > dotenv-webpack@1.7.0" has unmet peer dependency "webpack@^1 || ^2 || ^3 || ^4".
warning "@fuse/s3-browser > react-treebeard@3.2.4" has unmet peer dependency "@babel/runtime@>=7.0.0".
warning "@fuse/s3-browser > react-treebeard@3.2.4" has unmet peer dependency "@emotion/styled@^10.0.10".
warning " > bs-fetch@0.3.1" has incorrect peer dependency "bs-platform@^4.0.6".
warning " > re-classnames@4.0.0" has incorrect peer dependency "bs-platform@^5.0.0".
warning " > re-debouncer@2.0.0" has incorrect peer dependency "bs-platform@^5.0.0".
[4/4] Building fresh packages...
error /home/opam/project/node_modules/bs-platform: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments:
Directory: /home/opam/project/node_modules/bs-platform
Output:
ninja not compatible? Error: Command failed: "/home/opam/project/node_modules/bs-platform/lib/ninja.exe" --version
building ninja
.clang-format
.gitignore
.travis.yml
COPYING
HACKING.md
README
RELEASING
appveyor.yml
bootstrap.py
configure.py
doc/
doc/README.md
doc/dblatex.xsl
doc/docbook.xsl
doc/doxygen.config
doc/manual.asciidoc
doc/style.css
misc/
misc/afl-fuzz-tokens/
misc/afl-fuzz-tokens/kw_build
misc/afl-fuzz-tokens/kw_default
misc/afl-fuzz-tokens/kw_include
misc/afl-fuzz-tokens/kw_pool
misc/afl-fuzz-tokens/kw_rule
misc/afl-fuzz-tokens/kw_subninja
misc/afl-fuzz-tokens/misc_a
misc/afl-fuzz-tokens/misc_b
misc/afl-fuzz-tokens/misc_colon
misc/afl-fuzz-tokens/misc_cont
misc/afl-fuzz-tokens/misc_dollar
misc/afl-fuzz-tokens/misc_eq
misc/afl-fuzz-tokens/misc_indent
misc/afl-fuzz-tokens/misc_pipe
misc/afl-fuzz-tokens/misc_pipepipe
misc/afl-fuzz-tokens/misc_space
misc/afl-fuzz/
misc/afl-fuzz/build.ninja
misc/bash-completion
misc/ci.py
misc/inherited-fds.ninja
misc/long-slow-build.ninja
misc/measure.py
misc/ninja-mode.el
misc/ninja.vim
misc/ninja_syntax.py
misc/ninja_syntax_test.py
misc/output_test.py
misc/packaging/
misc/packaging/ninja.spec
misc/packaging/rpmbuild.sh
misc/write_fake_manifests.py
misc/zsh-completion
snapshot.js
src/
src/browse.cc
src/browse.h
src/browse.py
src/build.cc
src/build.h
src/build_log.cc
src/build_log.h
src/build_log_perftest.cc
src/build_log_test.cc
src/build_test.cc
src/canon_perftest.cc
src/clean.cc
src/clean.h
src/clean_test.cc
src/clparser.cc
src/clparser.h
src/clparser_perftest.cc
src/clparser_test.cc
src/debug_flags.cc
src/debug_flags.h
src/depfile_parser.cc
src/depfile_parser.h
src/depfile_parser.in.cc
src/depfile_parser_perftest.cc
src/depfile_parser_test.cc
src/deps_log.cc
src/deps_log.h
src/deps_log_test.cc
src/disk_interface.cc
src/disk_interface.h
src/disk_interface_test.cc
src/dyndep.cc
src/dyndep.h
src/dyndep_parser.cc
src/dyndep_parser.h
src/dyndep_parser_test.cc
src/edit_distance.cc
src/edit_distance.h
src/edit_distance_test.cc
src/eval_env.cc
src/eval_env.h
src/exit_status.h
src/gen_doxygen_mainpage.sh
src/getopt.c
src/getopt.h
src/graph.cc
src/graph.h
src/graph_test.cc
src/graphviz.cc
src/graphviz.h
src/hash_collision_bench.cc
src/hash_map.h
src/includes_normalize-win32.cc
src/includes_normalize.h
src/includes_normalize_test.cc
src/inline.sh
src/lexer.cc
src/lexer.h
src/lexer.in.cc
src/lexer_test.cc
src/line_printer.cc
src/line_printer.h
src/manifest_parser.cc
src/manifest_parser.h
src/manifest_parser_perftest.cc
src/manifest_parser_test.cc
src/metrics.cc
src/metrics.h
src/minidump-win32.cc
src/msvc_helper-win32.cc
src/msvc_helper.h
src/msvc_helper_main-win32.cc
src/msvc_helper_test.cc
src/ninja.cc
src/ninja_test.cc
src/parser.cc
src/parser.h
src/state.cc
src/state.h
src/state_test.cc
src/string_piece.h
src/string_piece_util.cc
src/string_piece_util.h
src/string_piece_util_test.cc
src/subprocess-posix.cc
src/subprocess-win32.cc
src/subprocess.h
src/subprocess_test.cc
src/test.cc
src/test.h
src/timestamp.h
src/util.cc
src/util.h
src/util_test.cc
src/version.cc
src/version.h
src/win32port.h
No prebuilt Ninja, building Ninja now
bootstrapping ninja...
./src/disk_interface.cc: In member function 'virtual TimeStamp RealDiskInterface::Stat(const string&, std::__cxx11::string*) const':
./src/disk_interface.cc:219:51: error: 'struct stat' has no member named 'st_mtimensec'; did you mean 'st_mtim'?
return (int64_t)st.st_mtime * 1000000000LL + st.st_mtimensec;
^~~~~~~~~~~~
warning: A compatible version of re2c (>= 0.11.3) was not found; changes to src/*.in.cc will not affect your build.
when running: g++ -MMD -MT build/disk_interface.o -MF build/disk_interface.o.d -g -Wall -Wextra -Wno-deprecated -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti -fno-exceptions -fvisibility=hidden -pipe '-DNINJA_PYTHON="python"' -O2 -DNDEBUG -fdiagnostics-color -DUSE_PPOLL -DNINJA_HAVE_BROWSE -I. -c ./src/disk_interface.cc -o build/disk_interface.o
Traceback (most recent call last):
File "./configure.py", line 514, in <module>
objs += cxx(name, variables=cxxvariables)
File "./configure.py", line 282, in cxx
return n.build(built(name + objext), 'cxx', src(name + '.cc'), **kwargs)
File "./configure.py", line 164, in build
self._run_command(self._expand(cmd, local_vars))
File "./configure.py", line 189, in _run_command
subprocess.check_call(cmdline, shell=True)
File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'g++ -MMD -MT build/disk_interface.o -MF build/disk_interface.o.d -g -Wall -Wextra -Wno-deprecated -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti -fno-exceptions -fvisibility=hidden -pipe '-DNINJA_PYTHON="python"' -O2 -DNDEBUG -fdiagnostics-color -DUSE_PPOLL -DNINJA_HAVE_BROWSE -I. -c ./src/disk_interface.cc -o build/disk_interface.o' returned non-zero exit status 1
child_process.js:656
throw err;
^
Error: Command failed: ./configure.py --bootstrap
at checkExecSyncError (child_process.js:616:11)
at Object.execSync (child_process.js:653:13)
at build_ninja (/home/opam/project/node_modules/bs-platform/scripts/install.js:60:8)
at provideNinja (/home/opam/project/node_modules/bs-platform/scripts/install.js:112:7)
at Object.<anonymous> (/home/opam/project/node_modules/bs-platform/scripts/install.js:373:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Exited with code 1```
There is also this recent thread: How to speed up ReScript in CI Server?
2 Likes
Sounds like it, yeah, thanks for the link. Taking the suggestions above, I just used a Debian based image, and whammo, it went from 25 minutes to 3. Given I suck at Docker, I was impressed.
1 Like