mtconnect / cppagent

C++ Agent toolkit - Pre-built binaries, visit: https://github.com/mtconnect/cppagent/releases Docker images available at https://hub.docker.com/repositories/mtconnect
http://mtcup.org/
Apache License 2.0
143 stars 91 forks source link

Docker build fails: 'aclocal-1.15' is missing on your system #283

Closed robot-ranger closed 1 year ago

robot-ranger commented 1 year ago

Docker build fails.

2023-03-12T03:05:35.3107335Z #11 1957.4 CDPATH="${ZSHVERSION+.}:" && cd . && /bin/bash /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mrubysource/build/host/mrbgems/mruby-onig-regexp/onigmo-6.2.0/missing aclocal-1.15 -I m4 2023-03-12T03:05:35.6114779Z #11 1957.6 /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mrubysource/build/host/mrbgems/mruby-onig-regexp/onigmo-6.2.0/missing: line 81: aclocal-1.15: command not found 2023-03-12T03:05:35.7212402Z #11 1957.8 WARNING: 'aclocal-1.15' is missing on your system. 2023-03-12T03:05:35.7212943Z #11 1957.8 You should only need it if you modified 'acinclude.m4' or 2023-03-12T03:05:35.7213440Z #11 1957.8 'configure.ac' or m4 files included by 'configure.ac'. 2023-03-12T03:05:35.7213957Z #11 1957.8 The 'aclocal' program is part of the GNU Automake package: 2023-03-12T03:05:35.7214363Z #11 1957.8 http://www.gnu.org/software/automake 2023-03-12T03:05:35.7215019Z #11 1957.8 It also requires GNU Autoconf, GNU m4 and Perl in order to run: 2023-03-12T03:05:35.7216236Z #11 1957.8 http://www.gnu.org/software/autoconf 2023-03-12T03:05:35.7216615Z #11 1957.8 http://www.gnu.org/software/m4/ 2023-03-12T03:05:35.7216940Z #11 1957.8 http://www.perl.org/ 2023-03-12T03:05:35.7217248Z #11 1957.8 make: *** [Makefile:714: aclocal.m4] Error 127 2023-03-12T03:05:35.7217533Z #11 1957.8 rake aborted! 2023-03-12T03:05:35.7217889Z #11 1957.8 make -j1 failed 2023-03-12T03:05:35.7218557Z #11 1957.8 /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mruby_source/build/repos/host/mruby-onig-regexp/mrbgem.rake:45:in run_command' 2023-03-12T03:05:35.7219459Z #11 1957.8 /root/.conan/data/mruby/3.1.0/_/_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mruby_source/build/repos/host/mruby-onig-regexp/mrbgem.rake:68:inblock (2 levels) in bundleonigmo' 2023-03-12T03:05:35.7220315Z #11 1957.8 /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mrubysource/build/repos/host/mruby-onig-regexp/mrbgem.rake:54:in `chdir' 2023-03-12T03:05:35.7221178Z #11 1957.8 /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mruby_source/build/repos/host/mruby-onig-regexp/mrbgem.rake:54:in block in bundle_onigmo' 2023-03-12T03:05:35.7221846Z #11 1957.8 /usr/share/rubygems-integration/all/gems/rake-13.0.6/exe/rake:27:in<top (required)>' 2023-03-12T03:05:35.7223676Z #11 1957.8 Tasks: TOP => default => all => gensym => /root/.conan/data/mruby/3.1.0///build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mrubysource/build/host/presym => /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mruby_source/build/host/mrbgems/mruby-onig-regexp/src/mruby_onigregexp.pi => /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mruby_source/build/repos/host/mruby-onig-regexp/src/mruby_onigregexp.c => /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mrubysource/build/host/mrbgems/mruby-onig-regexp/onigmo-6.2.0/.libs/libonigmo.a 2023-03-12T03:05:35.7225055Z #11 1957.8 (See full trace by running task with --trace) 2023-03-12T03:05:35.7225605Z #11 1957.8 mruby/3.1.0: 2023-03-12T03:05:35.7226601Z #11 1957.8 mruby/3.1.0: ERROR: Package '65c35a70825a8abdc73997e30c3d3faaed7f6bd9' build failed 2023-03-12T03:05:35.7227125Z #11 1957.8 mruby/3.1.0: WARN: Build folder /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9 2023-03-12T03:05:35.7227551Z #11 1957.8 ERROR: mruby/3.1.0: Error in build() method, line 128 2023-03-12T03:05:35.7227911Z #11 1957.8 self.run("rake MRUBY_CONFIG=%s" % self.build_config, 2023-03-12T03:05:35.7228500Z #11 1957.8 ConanException: Error 1 while executing rake MRUBYCONFIG=/root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mruby_source/build_config/mtconnect.rb 2023-03-12T03:05:36.0771090Z #11 ERROR: process "/bin/sh -c conan export conan/mqtt_cpp && conan export conan/mruby && conan install . -if build --build=missing -pr $CONAN_PROFILE -o build_tests=$WITH_TESTS -o run_tests=$WITH_TESTS -o with_ruby=$WITH_RUBY" did not complete successfully: exit code: 1 2023-03-12T03:05:36.0772072Z ------ 2023-03-12T03:05:36.0772989Z > [build 4/5] RUN conan export conan/mqtt_cpp && conan export conan/mruby && conan install . -if build --build=missing -pr conan/profiles/docker -o build_tests=False -o run_tests=False -o withruby=True: 2023-03-12T03:05:36.0774059Z #11 1957.8 /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mruby_source/build/repos/host/mruby-onig-regexp/mrbgem.rake:54:in block in bundle_onigmo' 2023-03-12T03:05:36.0774879Z #11 1957.8 /usr/share/rubygems-integration/all/gems/rake-13.0.6/exe/rake:27:in<top (required)>' 2023-03-12T03:05:36.0777102Z #11 1957.8 Tasks: TOP => default => all => gensym => /root/.conan/data/mruby/3.1.0///build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mrubysource/build/host/presym => /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mruby_source/build/host/mrbgems/mruby-onig-regexp/src/mruby_onigregexp.pi => /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mruby_source/build/repos/host/mruby-onig-regexp/src/mruby_onigregexp.c => /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mrubysource/build/host/mrbgems/mruby-onig-regexp/onigmo-6.2.0/.libs/libonigmo.a 2023-03-12T03:05:36.0778490Z #11 1957.8 (See full trace by running task with --trace) 2023-03-12T03:05:36.0778893Z #11 1957.8 mruby/3.1.0: 2023-03-12T03:05:36.0779519Z #11 1957.8 mruby/3.1.0: ERROR: Package '65c35a70825a8abdc73997e30c3d3faaed7f6bd9' build failed 2023-03-12T03:05:36.0780215Z #11 1957.8 mruby/3.1.0: WARN: Build folder /root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9 2023-03-12T03:05:36.0780741Z #11 1957.8 ERROR: mruby/3.1.0: Error in build() method, line 128 2023-03-12T03:05:36.0781197Z #11 1957.8 self.run("rake MRUBY_CONFIG=%s" % self.build_config, 2023-03-12T03:05:36.0781841Z #11 1957.8 ConanException: Error 1 while executing rake MRUBYCONFIG=/root/.conan/data/mruby/3.1.0//_/build/65c35a70825a8abdc73997e30c3d3faaed7f6bd9/mruby_source/build_config/mtconnect.rb 2023-03-12T03:05:36.0782415Z ------ 2023-03-12T03:05:36.0782740Z Dockerfile:65 2023-03-12T03:05:36.0783120Z -------------------- 2023-03-12T03:05:36.0783467Z 64 | # make installer 2023-03-12T03:05:36.0783830Z 65 | >>> RUN conan export conan/mqtt_cpp \ 2023-03-12T03:05:36.0784410Z 66 | >>> && conan export conan/mruby \ 2023-03-12T03:05:36.0784970Z 67 | >>> && conan install . -if build --build=missing \ 2023-03-12T03:05:36.0785450Z 68 | >>> -pr $CONAN_PROFILE \ 2023-03-12T03:05:36.0785910Z 69 | >>> -o build_tests=$WITH_TESTS \ 2023-03-12T03:05:36.0786360Z 70 | >>> -o run_tests=$WITH_TESTS \ 2023-03-12T03:05:36.0786801Z 71 | >>> -o with_ruby=$WITH_RUBY 2023-03-12T03:05:36.0788605Z 72 |
2023-03-12T03:05:36.0788954Z -------------------- 2023-03-12T03:05:36.0789889Z ERROR: failed to solve: process "/bin/sh -c conan export conan/mqtt_cpp && conan export conan/mruby && conan install . -if build --build=missing -pr $CONAN_PROFILE -o build_tests=$WITH_TESTS -o run_tests=$WITH_TESTS -o with_ruby=$WITH_RUBY" did not complete successfully: exit code: 1 2023-03-12T03:05:36.4557546Z ##[error]buildx failed with: ERROR: failed to solve: process "/bin/sh -c conan export conan/mqtt_cpp && conan export conan/mruby && conan install . -if build --build=missing -pr $CONAN_PROFILE -o build_tests=$WITH_TESTS -o run_tests=$WITH_TESTS -o with_ruby=$WITH_RUBY" did not complete successfully: exit code: 1 2023-03-12T03:05:36.4626879Z Post job cleanup. 2023-03-12T03:05:36.5946709Z ##[group]Removing temp folder /tmp/docker-build-push-ICdCsI 2023-03-12T03:05:36.5956855Z ##[endgroup] 2023-03-12T03:05:36.6074206Z Post job cleanup. 2023-03-12T03:05:36.7727422Z [command]/usr/bin/docker logout 2023-03-12T03:05:36.8044135Z Removing login credentials for https://index.docker.io/v1/ 2023-03-12T03:05:36.8210050Z Post job cleanup. 2023-03-12T03:05:36.9091186Z ##[group]Removing builder 2023-03-12T03:05:36.9172882Z [command]/usr/bin/docker buildx rm builder-f295a5f7-66d1-41bd-a982-8f5bc9883d74 2023-03-12T03:05:38.1792168Z builder-f295a5f7-66d1-41bd-a982-8f5bc9883d74 removed 2023-03-12T03:05:38.1831886Z ##[endgroup] 2023-03-12T03:05:38.1910903Z Post job cleanup. 2023-03-12T03:05:38.3374310Z [command]/usr/bin/git version 2023-03-12T03:05:38.3433599Z git version 2.39.2 2023-03-12T03:05:38.3508350Z Temporarily overriding HOME='/home/runner/work/_temp/a351be9c-b2f9-4c9e-9e8b-387a21ac9178' before making global git config changes 2023-03-12T03:05:38.3512849Z Adding repository directory to the temporary git global config as a safe directory 2023-03-12T03:05:38.3522216Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/cppagent/cppagent 2023-03-12T03:05:38.3574201Z [command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand 2023-03-12T03:05:38.3618542Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :" 2023-03-12T03:05:38.3873908Z [command]/usr/bin/git config --local --name-only --get-regexp http.https\:\/\/github.com\/.extraheader 2023-03-12T03:05:38.3896417Z http.https://github.com/.extraheader 2023-03-12T03:05:38.3936313Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader 2023-03-12T03:05:38.3975931Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https\:\/\/github.com\/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :" 2023-03-12T03:05:38.4560039Z Cleaning up orphan processes

robot-ranger commented 1 year ago

I resolved this and succesfully built by adding automake to the apt-get install build-essential...rake line. I dont know enough about build tools to fully understand why that solves it, so please enlighten me if you can.

was:

RUN apt-get clean \ && apt-get update \ && apt-get install -y \ build-essential python3.9 python3-pip git cmake make ruby rake \ && pip install conan -v "conan==1.59.0"

now:

RUN apt-get clean \ && apt-get update \ && apt-get install -y \ build-essential python3.9 python3-pip git cmake make ruby rake automake \ && pip install conan -v "conan==1.59.0"

wsobel commented 1 year ago

Thought build-essential had automake. Can you careate a PR for this issue?

Thanks - W

robot-ranger commented 1 year ago

my fork is modified ; do you want me to make a branch here?

wsobel commented 1 year ago

Please create a branch and pull request.

On Mar 12, 2023, at 17:52, robot-ranger @.***> wrote:

my fork is modified ; do you want me to make a branch here?

— Reply to this email directly, view it on GitHub https://github.com/mtconnect/cppagent/issues/283#issuecomment-1465353176, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6BCKZ4FCV77QJCC65O2LW3Z4UBANCNFSM6AAAAAAVYLMJHU. You are receiving this because you commented.

robot-ranger commented 1 year ago

oh, wow. cool. I didnt realize i could fork a branch from mtconnect/cppagent:main back into my fork!

just submitted a PR. Ill let yall close this once you have had a chance to review the PR.

rwuthric commented 1 year ago

I added the proposed fix by @robot-ranger (following his pull request). However it did not solve the error. Docker build still fails.

#0 57.19 /root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9/mruby_source/build/host/mrbgems/mruby-onig-regexp/onigmo-6.2.0/missing: line 81: aclocal-1.15: command not found
#0 57.19 WARNING: 'aclocal-1.15' is missing on your system.
#0 57.19          You should only need it if you modified 'acinclude.m4' or
#0 57.19          'configure.ac' or m4 files included by 'configure.ac'.
#0 57.19          The 'aclocal' program is part of the GNU Automake package:
#0 57.19          <http://www.gnu.org/software/automake>
#0 57.19          It also requires GNU Autoconf, GNU m4 and Perl in order to run:
#0 57.19          <http://www.gnu.org/software/autoconf>
#0 57.19          <http://www.gnu.org/software/m4/>
#0 57.19          <http://www.perl.org/>
#0 57.19 make: *** [Makefile:714: aclocal.m4] Error 127
#0 57.19 rake aborted!
#0 57.19 make -j1 failed
#0 57.19 /root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9/mruby_source/build/repos/host/mruby-onig-regexp/mrbgem.rake:45:in `run_command'
#0 57.19 /root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9/mruby_source/build/repos/host/mruby-onig-regexp/mrbgem.rake:68:in `block (2 levels) in bundle_onigmo'
#0 57.19 /root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9/mruby_source/build/repos/host/mruby-onig-regexp/mrbgem.rake:54:in `chdir'
#0 57.19 /root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9/mruby_source/build/repos/host/mruby-onig-regexp/mrbgem.rake:54:in `block in bundle_onigmo'
#0 57.19 /usr/share/rubygems-integration/all/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
#0 57.19 Tasks: TOP => default => all => gensym => /root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9/mruby_source/build/host/presym => /root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9/mruby_source/build/host/mrbgems/mruby-onig-regexp/src/mruby_onig_regexp.pi => /root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9/mruby_source/build/repos/host/mruby-onig-regexp/src/mruby_onig_regexp.c => /root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9/mruby_source/build/host/mrbgems/mruby-onig-regexp/onigmo-6.2.0/.libs/libonigmo.a
#0 57.19 (See full trace by running task with --trace)
#0 57.19 mruby/3.1.0: 
#0 57.19 mruby/3.1.0: ERROR: Package '062863c92a5a0a247840166e9f84ebe8d10786b9' build failed
#0 57.19 mruby/3.1.0: WARN: Build folder /root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9
#0 57.19 ERROR: mruby/3.1.0: Error in build() method, line 128
#0 57.19    self.run("rake MRUBY_CONFIG=%s" % self.build_config,
#0 57.19    ConanException: Error 1 while executing rake MRUBY_CONFIG=/root/.conan/data/mruby/3.1.0/_/_/build/062863c92a5a0a247840166e9f84ebe8d10786b9/mruby_source/build_config/mtconnect.rb
------
Dockerfile:64
--------------------
  63 |     # make installer
  64 | >>> RUN conan export conan/mqtt_cpp \
  65 | >>>   && conan export conan/mruby \
  66 | >>>   && conan install . -if build --build=missing \
  67 | >>>   -pr $CONAN_PROFILE \
  68 | >>>   -o build_tests=$WITH_TESTS \
  69 | >>>   -o run_tests=$WITH_TESTS \
  70 | >>>   -o with_ruby=$WITH_RUBY
  71 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c conan export conan/mqtt_cpp   && conan export conan/mruby   && conan install . -if build --build=missing   -pr $CONAN_PROFILE   -o build_tests=$WITH_TESTS   -o run_tests=$WITH_TESTS   -o with_ruby=$WITH_RUBY" did not complete successfully: exit code: 1
robot-ranger commented 1 year ago

hmmm... i THOUGHT that was the only change I made for this release, but I have a few other changes from previous releases.

notably, I have WITH_RUBY=False

im tempted to remove ruby from that dockerfile RUN, too, but I dont know enough about its use case for cppagent, so i left it there.

i think you can view my fork and see what else i changed, mostly just install locations and specifics about where we put agent.cfg, devices.xml, etc: https://github.com/mtconnect/cppagent/compare/master...robot-ranger:cppagent:master

rwuthric commented 1 year ago

I tried again.

Strangely, after a second docker build (without changing anything) it now worked (it isn't a problem of memory in my opinion. During the build I monitored memory and it never exceeded 6G usage where the machine to build the docker image has 32G).

Does not look right to me that one has to run several build attempts before it succeeds.

robot-ranger commented 1 year ago

yes, it is very bittersweet when a failed build automagically works on the second try. that makes me question if my "fix" really fixed anything, or my build just succeeded on subsequent attempts like you. it definitely complains that aclocal is missing, and tells us that it is included in automake.

Issues that just resolve themselves after doing nothing are the worst, but im glad it built for you.

Ill be honest - i dont have deep knowledge of these build tools so im not equipped to dig in further

rwuthric commented 1 year ago

I confirmed that two builds attempts are needed like this:


1) build using the `--no-cache=true` option to force a rebuild: build fails
2) rebuild with same command, but without the `--no-cache=true` option: build succeeds
wsobel commented 1 year ago

I’ll test this when I get done with my 2.2 tasks.

wsobel commented 1 year ago

This issue is now fixed in development. I'll cherry-pick the change soon and merge to public.

Needed the following:

RUN apt-get clean \
  && apt-get update \
  && apt-get install -y \
  build-essential python3.9 python3-pip git cmake make ruby rake autoconf automake \
  && pip install conan -v "conan==1.59.0"

And changed mruby oniguruma to first run aclocal and automake in the mrbgem.rake file to make sure configuration is up to date.

wsobel commented 1 year ago

I believe this is resolved. I will close it if nobody objects.

tukusejssirs commented 1 year ago

May I know which version will be the first to include the fix? :pray:

wsobel commented 1 year ago

I’ll check it out. I’m in the middle of fixing the build system for GitHub actions and I’m having a few issues with the GitHub instance. I’ll get to it soon. This was fixed in the cppagent_dev repo now archived and then replicated to the public repo. Both are public now. BestW(Sent from mobile)On Jul 21, 2023, at 04:22, Tukusej’s Sirs @.***> wrote: May I know which version will be the first to include the fix? 🙏

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

robot-ranger commented 1 year ago

unfortunately, this error has re-occured for me with the new 2.2 release. Im trying to run it with a github action workflow, same error

wsobel commented 1 year ago

I’ll take a look and see what’s going wrong(Sent from mobile)On Jul 26, 2023, at 13:33, robot-ranger @.***> wrote: unfortunately, this error has re-occured for me with the new 2.2 release. Im trying to run it with a github action workflow, same error

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

tukusejssirs commented 1 year ago

The fix is included in v2.2.0.3, therefore IMHO this issue should be closed.

wsobel commented 1 year ago

Docker issues have been addressed in version 2.2.0.5.