<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=""><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></body></html>