Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

theia-rpm docker build : error of g++: error: unrecognized command line option '-std=c++17' #511

Open
tokenwind opened this issue Mar 16, 2022 · 2 comments
Labels

Comments

@tokenwind
Copy link


build log:
[5/5] Building fresh packages...
error /theia-app/node_modules/oniguruma: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /theia-app/node_modules/oniguruma
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 2.7.5 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/theia-app/node_modules/oniguruma/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/root/.cache/node-gyp/14.19.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/14.19.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/14.19.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/theia-app/node_modules/oniguruma',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory /theia-app/node_modules/oniguruma/build' CC(target) Release/obj.target/oniguruma/deps/onig/regcomp.o CC(target) Release/obj.target/oniguruma/deps/onig/regenc.o CC(target) Release/obj.target/oniguruma/deps/onig/regerror.o CC(target) Release/obj.target/oniguruma/deps/onig/regexec.o CC(target) Release/obj.target/oniguruma/deps/onig/regext.o CC(target) Release/obj.target/oniguruma/deps/onig/reggnu.o CC(target) Release/obj.target/oniguruma/deps/onig/regparse.o CC(target) Release/obj.target/oniguruma/deps/onig/regposerr.o CC(target) Release/obj.target/oniguruma/deps/onig/regposix.o CC(target) Release/obj.target/oniguruma/deps/onig/regsyntax.o CC(target) Release/obj.target/oniguruma/deps/onig/regtrav.o CC(target) Release/obj.target/oniguruma/deps/onig/regversion.o CC(target) Release/obj.target/oniguruma/deps/onig/st.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/ascii.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/big5.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/cp1251.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_jp.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_kr.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_tw.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/gb18030.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_1.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_2.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_3.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_4.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_5.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_6.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_7.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_8.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_9.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_10.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_11.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_13.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_14.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_15.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_16.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8_r.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/mktable.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/sjis.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/unicode.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_be.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_le.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_be.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_le.o CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf8.o AR(target) Release/obj.target/oniguruma.a COPY Release/oniguruma.a CXX(target) Release/obj.target/onig_scanner/src/onig-result.o g++: error: unrecognized command line option '-std=c++17' make: *** [Release/obj.target/onig_scanner/src/onig-result.o] Error 1 make: Leaving directory /theia-app/node_modules/oniguruma/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Linux 3.10.0-693.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /theia-app/node_modules/oniguruma
gyp ERR! node -v v14.19.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok


env: gcc-c++ version is ^7
but still error

Dockerfile :

FROM centos:7

install development tools

RUN curl --silent --location https://rpm.nodesource.com/setup_14.x | bash - &&
yum groupinstall -y "Development Tools" &&
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo &&
yum install -y nodejs &&
npm install -g yarn &&
yum install -y libx11-devel.x86_64 libxkbfile-devel.x86_64 &&
yum install -y libsecret-devel &&
yum install -y centos-release-scl-rh &&
yum -y install centos-release-scl &&
yum -y install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils &&
scl enable devtoolset-7 bash &&
echo "source /opt/rh/devtoolset-7/enable" >>/etc/profile &&
source /etc/profile &&
gcc --version &&
pkg-config --version

required file to install Theia

COPY package.json run_theia.sh /theia-app/

build theia

WORKDIR /theia-app
RUN yarn &&
NODE_OPTIONS="--max_old_space_size=4096" yarn theia build &&
yarn autoclean --init &&
echo *.ts >> .yarnclean &&
echo *.ts.map >> .yarnclean &&
echo .spec. >> .yarnclean &&
yarn autoclean --force &&
yarn cache clean

create theia rpm

RUN npm run build-rpm

transfer rpm to new clean image and demonstrate successful rpm install (yum will handle all rpm dependencies i.e. Node v10)

FROM centos:7
COPY --from=0 /root/rpmbuild/RPMS/x86_64/theia-0.0.1-1.x86_64.rpm /
RUN curl --silent --location https://rpm.nodesource.com/setup_14.x | bash - &&
yum install -y theia-0.0.1-1.x86_64.rpm &&
rm -f theia-0.0.1-1.x86_64.rpm

ENV SHELL /bin/bash
EXPOSE 3000
CMD ["theia","start","--hostname=0.0.0.0"]

@CiciDongxue
Copy link

CiciDongxue commented Mar 16, 2022 via email

@stale
Copy link

stale bot commented Jul 10, 2022

This contribution has been automatically marked as stale due to inactivity, and it will be closed if no further activity occurs. Thank you for contributing to Theia!

@stale stale bot added the stale label Jul 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants