bazelbuild / rules_scala

Scala rules for Bazel
Apache License 2.0
363 stars 278 forks source link

ENV not propagated to process-wrapper #346

Open yliu120 opened 7 years ago

yliu120 commented 7 years ago

Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.

Description of the problem / feature request / question:

I have a problem using bazel to build the rules_scala on a custom platform. I am sure it is because the shell envs are not propagated correctly to a subprocess that is spawned by some actions of bazel. Please see the log information that I provide in the last section.

If possible, provide a minimal example to reproduce the problem:

Environment info

Have you found anything relevant by searching the web?

(e.g. StackOverflow answers, GitHub issues, email threads on the bazel-discuss Google group)

Anything else, information or logs or outputs that would be helpful?

(If they are large, please upload as attachment or provide link).

The command I ran to build rules_scala is bazel build -s --verbose_failures --sandbox_debug //src/...

>>>>> # //src/scala/io/bazel/rules_scala/tut_support:tut_compiler [action 'scala //src/scala/io/bazel/rules_scala/tut_support:tut_compiler']
(cd /home-4/yliu120@jhu.edu/.cache/bazel/_bazel_yliu120@jhu.edu/12dd3863654b107695e643fa774ca856/execroot/io_bazel_rules_scala && \
  exec env - \
  /bin/bash -c '
rm -f bazel-out/local-fastbuild/bin/src/scala/io/bazel/rules_scala/tut_support/tut_compiler.jar
external/bazel_tools/tools/zip/zipper/zipper c bazel-out/local-fastbuild/bin/src/scala/io/bazel/rules_scala/tut_support/tut_compiler.jar @bazel-out/local-fastbuild/bin/src/scala/io/bazel/rules_scala/tut_support/bazel-out/local-fastbuild/bin/src/scala/io/bazel/rules_scala/tut_support/tut_compiler.jar_zipper_args
')
>>>>> # @scala//:scala-reflect [action 'Extracting interface @scala//:scala-reflect [for host]']
(cd /home-4/yliu120@jhu.edu/.cache/bazel/_bazel_yliu120@jhu.edu/12dd3863654b107695e643fa774ca856/execroot/io_bazel_rules_scala && \
  exec env - \
    LD_LIBRARY_PATH=/cm/shared/gcc/6.4.0/lib64:/cm/shared/gcc/6.4.0/lib:/cm/shared/apps/mpc/1.0.3/lib:/cm/shared/apps/gcc/4.9.2/gmp-6.0/lib:/cm/shared/apps/mpfr/3.1.3/lib:/cm/shared/apps/sqlite3/3.15.0/lib:/cm/shared/apps/libevent/2.1.5-beta/lib:/cm/shared/apps/cudnn/6.0/lib64:/cm/shared/apps/java/jdk1.8.0_112/lib:/cm/shared/apps/python/3.6.0/lib:/cm/shared/apps/cuda/8.0/lib64:/cm/shared/apps/binutils/2.25/src/lib:/cm/shared/apps/slurm/current/lib/slurm:/cm/shared/apps/slurm/current/lib:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/compiler/lib/intel64:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/mkl/lib/intel64:/home-4/yliu120@jhu.edu/lib:/home-4/yliu120@jhu.edu/opt/lib \
    PATH=/cm/shared/gcc/6.4.0/bin:/home-4/yliu120@jhu.edu/go/bin:/home-4/yliu120@jhu.edu/.local/bin:/home-4/yliu120@jhu.edu/opt/go/bin:/home-4/yliu120@jhu.edu/maven/bin:/home-4/yliu120@jhu.edu/arcanist/bin:/home-4/yliu120@jhu.edu/opt/bin:/cm/shared/apps/sqlite3/3.15.0/bin:/cm/shared/apps/tmux/2.1/bin:/cm/shared/apps/libevent/2.1.5-beta/bin:/cm/shared/apps/java/jdk1.8.0_112/bin:/cm/shared/apps/python/3.6.0/bin:/cm/shared/apps/cuda/8.0/bin:/cm/shared/apps/binutils/2.25/src/bin:/cm/shared/apps/binutils:/cm/shared/apps/slurm/current/sbin:/cm/shared/apps/slurm/current/bin:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/bin/intel64:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/sbin:/usr/sbin:/cm/local/apps/environment-modules/3.2.10/bin:/opt/dell/srvadmin/bin \
  external/bazel_tools/tools/jdk/ijar/ijar external/scala/lib/scala-reflect.jar bazel-out/host/genfiles/external/scala/_ijar/scala-reflect/external/scala/lib/scala-reflect-ijar.jar)
>>>>> # @scala//:scala-reflect [action 'Extracting interface @scala//:scala-reflect']
(cd /home-4/yliu120@jhu.edu/.cache/bazel/_bazel_yliu120@jhu.edu/12dd3863654b107695e643fa774ca856/execroot/io_bazel_rules_scala && \
  exec env - \
    LD_LIBRARY_PATH=/cm/shared/gcc/6.4.0/lib64:/cm/shared/gcc/6.4.0/lib:/cm/shared/apps/mpc/1.0.3/lib:/cm/shared/apps/gcc/4.9.2/gmp-6.0/lib:/cm/shared/apps/mpfr/3.1.3/lib:/cm/shared/apps/sqlite3/3.15.0/lib:/cm/shared/apps/libevent/2.1.5-beta/lib:/cm/shared/apps/cudnn/6.0/lib64:/cm/shared/apps/java/jdk1.8.0_112/lib:/cm/shared/apps/python/3.6.0/lib:/cm/shared/apps/cuda/8.0/lib64:/cm/shared/apps/binutils/2.25/src/lib:/cm/shared/apps/slurm/current/lib/slurm:/cm/shared/apps/slurm/current/lib:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/compiler/lib/intel64:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/mkl/lib/intel64:/home-4/yliu120@jhu.edu/lib:/home-4/yliu120@jhu.edu/opt/lib \
    PATH=/cm/shared/gcc/6.4.0/bin:/home-4/yliu120@jhu.edu/go/bin:/home-4/yliu120@jhu.edu/.local/bin:/home-4/yliu120@jhu.edu/opt/go/bin:/home-4/yliu120@jhu.edu/maven/bin:/home-4/yliu120@jhu.edu/arcanist/bin:/home-4/yliu120@jhu.edu/opt/bin:/cm/shared/apps/sqlite3/3.15.0/bin:/cm/shared/apps/tmux/2.1/bin:/cm/shared/apps/libevent/2.1.5-beta/bin:/cm/shared/apps/java/jdk1.8.0_112/bin:/cm/shared/apps/python/3.6.0/bin:/cm/shared/apps/cuda/8.0/bin:/cm/shared/apps/binutils/2.25/src/bin:/cm/shared/apps/binutils:/cm/shared/apps/slurm/current/sbin:/cm/shared/apps/slurm/current/bin:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/bin/intel64:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/sbin:/usr/sbin:/cm/local/apps/environment-modules/3.2.10/bin:/opt/dell/srvadmin/bin \
  external/bazel_tools/tools/jdk/ijar/ijar external/scala/lib/scala-reflect.jar bazel-out/local-fastbuild/genfiles/external/scala/_ijar/scala-reflect/external/scala/lib/scala-reflect-ijar.jar)
>>>>> # @scala//:scala-compiler [action 'Extracting interface @scala//:scala-compiler']
(cd /home-4/yliu120@jhu.edu/.cache/bazel/_bazel_yliu120@jhu.edu/12dd3863654b107695e643fa774ca856/execroot/io_bazel_rules_scala && \
  exec env - \
    LD_LIBRARY_PATH=/cm/shared/gcc/6.4.0/lib64:/cm/shared/gcc/6.4.0/lib:/cm/shared/apps/mpc/1.0.3/lib:/cm/shared/apps/gcc/4.9.2/gmp-6.0/lib:/cm/shared/apps/mpfr/3.1.3/lib:/cm/shared/apps/sqlite3/3.15.0/lib:/cm/shared/apps/libevent/2.1.5-beta/lib:/cm/shared/apps/cudnn/6.0/lib64:/cm/shared/apps/java/jdk1.8.0_112/lib:/cm/shared/apps/python/3.6.0/lib:/cm/shared/apps/cuda/8.0/lib64:/cm/shared/apps/binutils/2.25/src/lib:/cm/shared/apps/slurm/current/lib/slurm:/cm/shared/apps/slurm/current/lib:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/compiler/lib/intel64:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/mkl/lib/intel64:/home-4/yliu120@jhu.edu/lib:/home-4/yliu120@jhu.edu/opt/lib \
    PATH=/cm/shared/gcc/6.4.0/bin:/home-4/yliu120@jhu.edu/go/bin:/home-4/yliu120@jhu.edu/.local/bin:/home-4/yliu120@jhu.edu/opt/go/bin:/home-4/yliu120@jhu.edu/maven/bin:/home-4/yliu120@jhu.edu/arcanist/bin:/home-4/yliu120@jhu.edu/opt/bin:/cm/shared/apps/sqlite3/3.15.0/bin:/cm/shared/apps/tmux/2.1/bin:/cm/shared/apps/libevent/2.1.5-beta/bin:/cm/shared/apps/java/jdk1.8.0_112/bin:/cm/shared/apps/python/3.6.0/bin:/cm/shared/apps/cuda/8.0/bin:/cm/shared/apps/binutils/2.25/src/bin:/cm/shared/apps/binutils:/cm/shared/apps/slurm/current/sbin:/cm/shared/apps/slurm/current/bin:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/bin/intel64:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/sbin:/usr/sbin:/cm/local/apps/environment-modules/3.2.10/bin:/opt/dell/srvadmin/bin \
  external/bazel_tools/tools/jdk/ijar/ijar external/scala/lib/scala-compiler.jar bazel-out/local-fastbuild/genfiles/external/scala/_ijar/scala-compiler/external/scala/lib/scala-compiler-ijar.jar)
>>>>> # @io_bazel_rules_scala_org_tpolecat_tut_core//jar:jar [action 'Extracting interface @io_bazel_rules_scala_org_tpolecat_tut_core//jar:jar']
(cd /home-4/yliu120@jhu.edu/.cache/bazel/_bazel_yliu120@jhu.edu/12dd3863654b107695e643fa774ca856/execroot/io_bazel_rules_scala && \
  exec env - \
    LD_LIBRARY_PATH=/cm/shared/gcc/6.4.0/lib64:/cm/shared/gcc/6.4.0/lib:/cm/shared/apps/mpc/1.0.3/lib:/cm/shared/apps/gcc/4.9.2/gmp-6.0/lib:/cm/shared/apps/mpfr/3.1.3/lib:/cm/shared/apps/sqlite3/3.15.0/lib:/cm/shared/apps/libevent/2.1.5-beta/lib:/cm/shared/apps/cudnn/6.0/lib64:/cm/shared/apps/java/jdk1.8.0_112/lib:/cm/shared/apps/python/3.6.0/lib:/cm/shared/apps/cuda/8.0/lib64:/cm/shared/apps/binutils/2.25/src/lib:/cm/shared/apps/slurm/current/lib/slurm:/cm/shared/apps/slurm/current/lib:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/compiler/lib/intel64:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/mkl/lib/intel64:/home-4/yliu120@jhu.edu/lib:/home-4/yliu120@jhu.edu/opt/lib \
    PATH=/cm/shared/gcc/6.4.0/bin:/home-4/yliu120@jhu.edu/go/bin:/home-4/yliu120@jhu.edu/.local/bin:/home-4/yliu120@jhu.edu/opt/go/bin:/home-4/yliu120@jhu.edu/maven/bin:/home-4/yliu120@jhu.edu/arcanist/bin:/home-4/yliu120@jhu.edu/opt/bin:/cm/shared/apps/sqlite3/3.15.0/bin:/cm/shared/apps/tmux/2.1/bin:/cm/shared/apps/libevent/2.1.5-beta/bin:/cm/shared/apps/java/jdk1.8.0_112/bin:/cm/shared/apps/python/3.6.0/bin:/cm/shared/apps/cuda/8.0/bin:/cm/shared/apps/binutils/2.25/src/bin:/cm/shared/apps/binutils:/cm/shared/apps/slurm/current/sbin:/cm/shared/apps/slurm/current/bin:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/bin/intel64:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/sbin:/usr/sbin:/cm/local/apps/environment-modules/3.2.10/bin:/opt/dell/srvadmin/bin \
  external/bazel_tools/tools/jdk/ijar/ijar external/io_bazel_rules_scala_org_tpolecat_tut_core/jar/tut-core_2.11-0.4.8.jar bazel-out/local-fastbuild/genfiles/external/io_bazel_rules_scala_org_tpolecat_tut_core/jar/_ijar/jar/external/io_bazel_rules_scala_org_tpolecat_tut_core/jar/tut-core_2.11-0.4.8-ijar.jar)
ERROR: /home-4/yliu120@jhu.edu/rules_scala/src/scala/scripts/BUILD:41:1: error executing shell command: '
rm -f bazel-out/local-fastbuild/bin/src/scala/scripts/scalapb_generator.jar
external/bazel_tools/tools/zip/zipper/zipper c bazel-out/local-fastbuild/bin/src/scala/scripts/scalapb_generator.jar @ba...' failed (Exit 1): process-wrapper failed: error executing command
  (cd /home-4/yliu120@jhu.edu/.cache/bazel/_bazel_yliu120@jhu.edu/12dd3863654b107695e643fa774ca856/execroot/io_bazel_rules_scala && \
  exec env - \
  /home-4/yliu120@jhu.edu/.cache/bazel/_bazel_yliu120@jhu.edu/12dd3863654b107695e643fa774ca856/execroot/io_bazel_rules_scala/_bin/process-wrapper '--timeout=-1' '--kill_delay=15' /bin/bash -c '
rm -f bazel-out/local-fastbuild/bin/src/scala/scripts/scalapb_generator.jar
external/bazel_tools/tools/zip/zipper/zipper c bazel-out/local-fastbuild/bin/src/scala/scripts/scalapb_generator.jar @bazel-out/local-fastbuild/bin/src/scala/scripts/bazel-out/local-fastbuild/bin/src/scala/scripts/scalapb_generator.jar_zipper_args
').
/home-4/yliu120@jhu.edu/.cache/bazel/_bazel_yliu120@jhu.edu/12dd3863654b107695e643fa774ca856/execroot/io_bazel_rules_scala/_bin/process-wrapper: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home-4/yliu120@jhu.edu/.cache/bazel/_bazel_yliu120@jhu.edu/12dd3863654b107695e643fa774ca856/execroot/io_bazel_rules_scala/_bin/process-wrapper)
INFO: Elapsed time: 0.820s, Critical Path: 0.14s

From the log message, you can see the first command doesn't have PATH and LD_LIBRARY_PATH propagated but the others have.

ittaiz commented 7 years ago

For the record- this is under investigation on the bazel side in https://github.com/bazelbuild/bazel/issues/4137. If this turns out on rules_scala side or if we need to do a workaround in the meantime please ping us here

yliu120 commented 7 years ago

Thanks. I reported it here just because building rules_scala in a customized environment would result in this problem. I just let you guys know there is such an issue and you can keep this for a future reference. After my investigation, I found this is not related to rule_scala.

ittaiz commented 7 years ago

Thanks! I understand and appreciate getting us in the loop. I added the comment exactly for the same reason so that people coming here can find the relevant issue on Bazel itself. I'd really appreciate it if you could update here (and hopefully also close) when things progress on the other side.

On Sun, Nov 26, 2017 at 7:52 AM Yunlong Liu notifications@github.com wrote:

Thanks. I reported it here just because building rules_scala in a customized environment would result in this problem. I just let you guys know there is such an issue and you can keep this for a future reference. After my investigation, I found this is not related to rule_scala.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/bazelbuild/rules_scala/issues/346#issuecomment-346986262, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUIF6Frx6sT31Vtirv0lc8l5voCO3Q9ks5s6PyGgaJpZM4QlEyb .