<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I am not using --max_idle_secs=60.<div class=""><br class=""></div><div class="">Also, neither is port py-tensorflow nor the repo tensorflow/tensorflow itself, nor any other MacPorts repo, and these all build fine without this option:</div><div class=""><ul class=""><li class=""><a href="https://github.com/macports/macports-ports/blob/master/python/py-tensorflow/Portfile" class="">https://github.com/macports/macports-ports/blob/master/python/py-tensorflow/Portfile</a></li><li class=""><a href="https://github.com/tensorflow/tensorflow/search?q=max_idle_secs&type=Code" class="">https://github.com/tensorflow/tensorflow/search?q=max_idle_secs&type=Code</a></li><li class=""><a href="https://github.com/macports/macports-ports/search?q=max_idle_secs&type=Code" class="">https://github.com/macports/macports-ports/search?q=max_idle_secs&type=Code</a></li></ul></div><div class=""><br class=""></div><div class="">I’m happy to try adding it, but my expectation is that some other issue is causing the hang when run within the port command (the build itself only takes few seconds when run by hand).</div><div class=""><br class=""></div><div class="">I must also add the bazel-based builds tensorflow-probability and others, so getting a robust bazel build approach would be very helpful and useful.</div><div class=""><br class=""></div><div class="">Steve<br class=""><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 6, 2020, at 11:57 AM, Christopher Jones <<a href="mailto:jonesc@hep.phy.cam.ac.uk" class="">jonesc@hep.phy.cam.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">Are you using this option </div><div class=""><br class=""></div><div class="">bazel --max_idle_secs=60</div><div class=""><br class=""></div><div class="">when building with bazel ?</div><div class=""><br class=""></div><div class="">Bazel builds start an underlying ’server’ process, that by default hangs around for 3600 secs (yes, 1hour) before disappearing. Without the above your build will hang around waiting for this to happen…</div><div class=""><br class=""></div><div class="">Chris</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 6 Jul 2020, at 2:57 am, Steven Smith <<a href="mailto:steve.t.smith@gmail.com" class="">steve.t.smith@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I’m preparing a PR for the Google Magenta project <<a href="https://magenta.tensorflow.org/" class="">https://magenta.tensorflow.org</a>>, and am running into this issue for the “dm-tree” dependent package with the bazel build.<div class=""><br class=""></div><div class="">The command `port -dv test py37-dm-tree` hangs during the bazel build.</div><div class=""><ul class="MailOutline"><li class="">I can’t even Ctl-C out of the process—it requires a full ps command then a kill -9 to shut down everything.</li><li class="">However, running the build by hand works:</li><ul class=""><li class="">sudo -u macports bash -c '/opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 setup.py --no-user-cfg build'</li></ul></ul></div><div class=""><br class=""></div><div class="">Any pointers or help would be appreciated. I’ve never used bazel, so I copied a bunch of relevant stuff from the py-tensorflow Portfile and attempted a few obvious hacks, but nothing changes the underlying problem of a hung port command.</div><div class=""><br class=""></div><div class="">Relevant files:</div><div class=""><div class=""><div class=""><br class=""></div></div><div class=""><a href="https://github.com/deepmind/tree/blob/master/setup.py" class="">https://github.com/deepmind/tree/blob/master/setup.py</a></div><div class=""><a href="https://github.com/deepmind/tree/blob/master/bazel/BUILD" class="">https://github.com/deepmind/tree/blob/master/bazel/BUILD</a></div><div class=""><br class=""></div><div class="">Bazel process (hung when called from MacPorts):</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 12px;" class="">bazel(tree-0.1.6.20200524) -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/private/var/tmp/_bazel_root/54b8ea352146bad8adc65c2e363d519a -Xverify:none -Djava.util.logging.config.file=/private/var/tmp/_bazel_root/54b8ea352146bad8adc65c2e363d519a/javalog.properties -Dcom.google.devtools.build.lib.util.LogHandlerQuerier.class=com.google.devtools.build.lib.util.SimpleLogHandler$HandlerQuerier -XX:-MaxFDLimit -Djava.library.path=/var/tmp/_bazel_root/install/e3bdf1a360e6d6cc38da72ec898bd905/embedded_tools/tools/objc:/var/tmp/_bazel_root/install/e3bdf1a360e6d6cc38da72ec898bd905/ -Dfile.encoding=ISO-8859-1 -jar /var/tmp/_bazel_root/install/e3bdf1a360e6d6cc38da72ec898bd905/A-server.jar --max_idle_secs=10800 --noshutdown_on_low_sys_mem --connect_timeout_secs=30 --output_user_root=/var/tmp/_bazel_root --install_base=/var/tmp/_bazel_root/install/e3bdf1a360e6d6cc38da72ec898bd905 --install_md5=e3bdf1a360e6d6cc38da72ec898bd905 --output_base=/private/var/tmp/_bazel_root/54b8ea352146bad8adc65c2e363d519a --workspace_directory=/opt/local/var/macports/build/_opt_local_ports_python_py-dm-tree/py37-dm-tree/work/tree-0.1.6.20200524 --default_system_javabase=/Library/Java/JavaVirtualMachines/openjdk13/Contents/Home --failure_detail_out=/private/var/tmp/_bazel_root/54b8ea352146bad8adc65c2e363d519a/failure_detail.rawproto --deep_execroot --expand_configs_in_place --idle_server_tasks --write_command_log --nowatchfs --nofatal_event_bus_exceptions --nowindows_enable_symlinks --client_debug=false --product_name=Bazel --noincompatible_enable_execution_transition --option_sources=</span></div></blockquote></div><div class=""><br class=""></div><div class="">Draft Portfile:</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class=""><font face="Menlo" style="font-size: 14px;" class=""># -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">PortSystem 1.0</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">PortGroup compilers 1.0</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">PortGroup compiler_blacklist_versions 1.0</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">PortGroup github 1.0</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">PortGroup java 1.0</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">PortGroup python 1.0</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">PortGroup xcodeversion 1.0</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">PortGroup xcode_workaround 1.0</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">github.setup deepmind tree 2b81872</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""># no official release; version from __init__.py plus github commit date</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">version 0.1.6.20200524</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">name py-dm-${github.project}</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">revision 0</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">platforms darwin</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">license Apache-2</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">maintainers nomaintainer</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">description Deepmind tree is a library for working with nested\</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> data structures.</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">long_description ${description} In a way, tree generalizes the builtin\</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> map function which only supports flat sequences, and\</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> allows to apply a function to each "leaf" preserving\</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> the overall structure.</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">homepage <a href="https://github.com/deepmind/tree" class="">https://github.com/deepmind/tree</a></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">distname ${github.project}-${version}</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">checksums rmd160 40518b306e8f5a80b12ef5e76ca9e2f8ef232de3 \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> sha256 0748428f70fae2209b8763bf99cadaf22276a4391851ba919dce9d3d0bc047bf \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> size 35176</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">python.versions 37 38</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""># Required java version</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">java.version 11+</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""># JDK port to install if required java not found</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">java.fallback openjdk14</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""># JDK only needed at build time, but java PG sets lib dependency so</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""># declare no conflict to allow redistribution of binaries.</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">license_noconflict ${java.fallback}</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""># require c++14</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">compiler.cxx_standard 2014</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""># The oldest Xcode version to use default Xcode compiler</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""># <a href="https://github.com/tensorflow/tensorflow/issues/39262" class="">https://github.com/tensorflow/tensorflow/issues/39262</a></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">set tf_min_xcode 10.2</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">compiler.blacklist-append {clang < 1001}</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""># Work out if we should be using macports clang</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">set use_mp_clang [ expr ( [ string match macports-clang-* ${configure.compiler} ] || [ vercmp ${xcodeversion} ${tf_min_xcode} ] < 0 ) ]</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">use_parallel_build no</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">if {${name} ne ${subport}} {</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> depends_build-append \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> port:bazel \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> port:py${python.version}-setuptools</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> depends_run-append \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> port:py${python.version}-six \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> depends_test-append \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> port:py${python.version}-absl \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> port:py${python.version}-attrs \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> port:py${python.version}-numpy \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> port:py${python.version}-pytest \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> port:py${python.version}-wrapt</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> # diff -NaurdwB ./dm-tree-orig/setup.py ./dm-tree-new/setup.py | sed -E -e 's/\.\/dm-tree-(orig|new)*\/(setup\.py)(\.[[:alnum:]]+)*/\.\/setup.py/' > ./setup.py.patch</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> # patchfiles setup.py.patch</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> # set bazel_output_base ${workpath}/tmp/_bazel_root</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> # xinstall -d ${bazel_output_base}</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> # post-patch {</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> # reinplace \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> # "s|@BAZEL_OUTPUT_USER_ROOT@|${bazel_output_base}|g" \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> # ${worksrcpath}/setup.py</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> # }</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> build.env-append \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> JAVA_HOME=${java.home}</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> test.run yes</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> test.cmd py.test-${python.branch}</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> test.target</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> test.env-append \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> "PATH=$env(PATH):${workpath}/bin" \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> PYTHONPATH=${worksrcpath}/build/lib</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> post-destroot {</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> set docdir ${prefix}/share/doc/${subport}</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> xinstall -d ${destroot}${docdir}</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> xinstall -m 0644 -W ${worksrcpath} LICENSE README.md \</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> ${destroot}${docdir}</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> }</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> livecheck.type none</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">} else {</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class=""> livecheck.type pypi</font></div><div class=""><font face="Menlo" style="font-size: 14px;" class="">}</font></div></blockquote><div class=""><div class=""><br class=""></div></div></div></div></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></body></html>