【问题标题】:running emconfigure exception with Popen使用 Popen 运行 emconfigure 异常
【发布时间】:2017-10-06 21:37:45
【问题描述】:

当我运行 emconfigure ./configure 时,我收到以下错误:

ERROR:root:Exception thrown when invoking Popen in configure with 

args: "./configure"!
Traceback (most recent call last):
  File "/usr/local/bin/emconfigure", line 13, in <module>
    emconfigure.run()
  File "/usr/local/Cellar/emscripten/1.37.21/libexec/emconfigure.py", line 46, in run
    shared.Building.configure(sys.argv[1:])
  File "/usr/local/Cellar/emscripten/1.37.21/libexec/tools/shared.py", line 1533, in configure
    process = Popen(args, stdout=None if EM_BUILD_VERBOSE_LEVEL >= 2 else stdout, stderr=None if EM_BUILD_VERBOSE_LEVEL >= 1 else stderr, env=env)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

【问题讨论】:

    标签: python emscripten


    【解决方案1】:

    故障:

    由于调用堆栈的深度,这可能很难追踪。让我们把它分开:

    在“下一级”:找不到您尝试执行的文件。

    比这低一级的事情变得清晰:subprocess.Popen 正在尝试执行 args。

    args 中有什么? - 基本上是 ./configure(由 emscripten 传递)。导出 EM_BUILD_VERBOSE=3 环境变量,然后 stderr 应该会显示它。

    因此,下一级 ./configure 正在以无效的方式指导事物。现在是时候猜测了顶层(不知道 ./configure 脚本中的内容):./configure 脚本文件中的某行 shell 命令是否试图执行一些非存在吗?例如:#! 之后的某个点! /bin/sh ? - 尝试调试 just ./compile.

    值得注意的是,子进程可能存在相对路径(未获取 PATH)和权限(./configure 被锁定)的问题,但即使在 /you/make/an/ 之后,您的错误也可能会持续存在absolute/call/to/configure 777 配置的权限。 - 在这种情况下,上一段是最有可能的罪魁祸首。

    编辑:

    这个错误对于 emscripten 来说很有趣的原因是,emscripten 存在的一部分(大部分)是将 [旧版] C/++ 代码移植到新的 JS 应用程序。嗯,旧的 C/++ 构建在这个问题的意义上变得旧了。如果这是真的,这将是一个普遍存在的问题,如果它是普遍的,社区可以使用通用模式来解决。

    【讨论】:

      【解决方案2】:

      如果您使用 Docker,您的主机是 Windows,并且您将其挂载到 Windows 目录,请确保您的文件不是 \r\n 行尾,而是 \n 行尾。更改它为我修复了它。

      在这种情况下,如果您使用 git,您可以尝试将git config core.autocrlf input 设置为停止签出到\r\n。如果您需要转换文件,请尝试this answer out

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-05-28
        • 2017-02-07
        • 1970-01-01
        • 1970-01-01
        • 2021-02-11
        • 2012-04-28
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多