【问题标题】:Makefile Errors while building megasdk python in Alpine Edge Docker在 Alpine Edge Docker 中构建 megasdk python 时出现 Makefile 错误
【发布时间】:2022-08-16 00:23:37
【问题描述】:

我最近在 alpine edge Linux docker 上构建 MegaSdkC+ python 轮时遇到问题......我目前试图通过 Ubuntu Dockerfile 移植它

错误:

#8 184.6 In file included from /usr/include/openssl/bio.h:20,
#8 184.6 from /usr/include/openssl/ssl.h:18,
#8 184.6 from ./include/mega/posix/meganet.h:28,
#8 184.6 from ./include/mega.h:74,
#8 184.6 from src/posix/net.cpp:22:
#8 184.6 src/posix/net.cpp: In constructor \'mega::CurlHttpIO::CurlHttpIO()\':
#8 184.6 src/posix/net.cpp:272:10: error: converting to \'bool\' from \'std::nullptr_t\' requires direct-initialization [-fpermissive]
#8 184.6 272 | if (!CRYPTO_get_locking_callback()
#8 184.6 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#8 184.6 src/posix/net.cpp:274:13: error: converting to \'bool\' from \'std::nullptr_t\' requires direct-initialization [-fpermissive]
#8 184.6 274 | && !CRYPTO_THREADID_get_callback())
#8 184.6 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#8 185.1 make[2]: *** [Makefile:2767: src/posix/libmega_la-net.lo] Error 1
#8 185.1 make[2]: *** Waiting for unfinished jobs....
#8 187.0 mv -f src/posix/.deps/libmega_la-waiter.Tpo src/posix/.deps/libmega_la-waiter.Plo
#8 187.0 make[2]: Leaving directory \'/root/home/sdk\'
#8 187.0 make[1]: *** [Makefile:3347: all-recursive] Error 1
#8 187.0 make[1]: Leaving directory \'/root/home/sdk\'
#8 187.0 make: *** [Makefile:1517: all] Error 2

这是通过 github 操作构建的错误的直接日志:

https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/runs/7592589121?check_suite_focus=true#step:9:995

尝试从 Ubuntu 移植 .. Dockerfile 和 Github Actions 构建日志如下所示

日志

https://github.com/AmirulAndalib/slumtoolkit0-docker/runs/7595322451?check_suite_focus=true

Dockerfile

https://github.com/AmirulAndalib/slumtoolkit0-docker/blob/master/Dockerfile

对于高山构建

Dockerfile

https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/blob/master/Dockerfile%20Base/Dockerfile

Gitflow 日志

https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/runs/7592589121?check_suite_focus=true

MegaSdkC 存储库

https://github.com/meganz/sdk

  • 编译器可能已经升级,新版本的编译器更严格,并且在使用旧版本编译器编译的代码上产生错误。如果是这样,那么您有(至少)三个选项:(a) 修复代码,(b) 使用旧编译器,或 (c) 将 -fpermissive 标志传递给新编译器。我这样说是基于我编译源代码的一般经验,而不是基于对 Python 或 Docker 的任何特定经验。
  • ``` configure.ac:53: 安装\'./compile\' configure.ac:57: 安装\'./config.guess\' configure.ac:57: 安装\'./config.sub\' 配置.ac:55: 安装 \'./install-sh\' configure.ac:55: 安装 \'./missing\' Makefile.am: 安装 \'./depcomp\' bindings/python/include.am:2 : 安装 \'./py-compile\' Makefile.am:61: \'bindings/python/include.am\' 从这里包含并行测试: 安装 \'./test-driver\' autoreconf: 离开目录@ 987654330@--fpermissive\' 尝试 `./configure --help\' 获取更多信息 ```
  • -fpermissive 不是 ./configure 的选项。 -fpermissive 是编译器标志。所以你需要弄清楚如何将标志传递给编译器。我不是专家,因此无法提供详细说明。也许寻找变量CFLAGSCPPFLAGS。或者运行./configure --help 看看它是否告诉你如何设置编译器标志。解决问题的“最佳”方法是修复源代码,但这可能不是最简单的方法。
  • @mpb 你的意思是 ``` OBJCXX 目标 C++ 编译器命令 OBJCXXFLAGS 目标 C++ 编译器标志 CXX C++ 编译器命令 CXXFLAGS C++ 编译器标志 CXXCPP C++ 预处理器 PYTHON Python 解释器 ``` 但我不知道如何传递这些标志也许检查这个github.com/meganz/sdk/blob/master/Makefile.am

标签: c++ docker ubuntu github-actions alpine


【解决方案1】:

谢谢@mpb,我按照您的说法添加了-fpermissive 标志,错误实际上已降级为警告,而且我构建的代码运行良好

使固定 :

https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/blob/master/Dockerfile%20Base/Dockerfile#L45

非常感谢你的帮助

【讨论】:

    猜你喜欢
    • 2019-02-09
    • 1970-01-01
    • 1970-01-01
    • 2019-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-23
    相关资源
    最近更新 更多