对复杂软件的构建进行故障排除有哪些技巧?

发布于 2024-08-29 09:13:00 字数 290 浏览 6 评论 0原文

有时我想从头开始构建Python或GCC只是为了好玩,但我无法解析我得到的错误,或者不理解像“libtool链接错误#XYZ”这样的语句。 unix/系统专家使用哪些技巧从头开始编译这种规模的软件?

当然,我已经做了一些事情,比如阅读 config.log(如果有)、谷歌搜索以及在新闻组中发帖。我正在寻找一些东西,要么

  • 让过程变得更顺利,要么
  • 让我获得有关错误的更多信息,以帮助我理解和修复它。

有时获取这些信息有点困难,因为某些编译错误可能非常隐蔽。到时候我能做什么呢?

Sometimes I want to build Python or GCC from scratch just for fun, but I can't parse the errors I get, or don't understand statements like "libtool link error # XYZ". What are some tricks that unix/systems gurus use to compile software of this size from scratch?

Of course I already do things like read config.log (if there is one), google around, and post in newsgroups. I'm looking for things that either

  • make the process go smoother or
  • get me more information about the error to help me understand and fix it.

It's a little tough to get this information sometimes, because some compile bugs can be quite obscure. What can I do at that point?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

飘落散花 2024-09-05 09:13:00

我的 5 美分:

  1. 让事情尽可能顺利的唯一方法是阅读安装/自述文件/其他说明并尽可能严格遵循它们。首先尝试默认选项。真的没有其他灵丹妙药。
  2. 如果事情进展不顺利,请直接将最后一条错误消息复制粘贴到谷歌中。您很有可能不是第一个得到它的人,并且您很容易找到解决方案。
  3. 如果您是第一个获得它的人,请重新阅读安装/自述文件并仔细考虑您的特定系统配置的特殊性。如果你不知道,请做好长期战斗的准备。只要有可能,我都会避免使用让我走到这一步的软件。
  4. 上述规则的一个例外是链接器错误。这些通常很容易理解,并且通常意味着您的系统库与软件期望的不匹配。重新阅读文档,获取正确的库,重新编译。不过,在某些发行版上这可能会很痛苦。
  5. 我的个人经验表明,每当我遇到无法轻松解决的编译错误时,进入代码并查看导致错误的特定行比其他任何方法都更有帮助。

对不起,如果这些都是显而易见的事情。

My 5 cents:

  1. The only way to have things as smooth as possible is to read whatever the INSTALL/README/other instructions say and follow them as closely as possible. Try the default options first. No other silver bullets, really.
  2. If things don't go smooth, bluntly copy-paste the last error message into google. With high probability you are not the first one to get it and you'll easily find the fix.
  3. If you are the first one to get it, re-read INSTALL/README and think twice on what might be the peculiarity of your particular system config. If you don't know of any, prepare for longer battles. Whenever possible, I would avoid dealing with software that gets me to this point.
  4. An exception to the above rule is a linker error. Those are usually easy to understand and most often mean that your system libraries don't match the ones expected by the software. Re-read documentation, fetch the correct libraries, recompile. On some distributions this might be a lot of pain, though.
  5. My personal experience shows that whenever I get a compilation error which I can't resolve easily, going into the code and looking at the specific line which caused the error helps more than anything else.

Excuse me if that's all obvious stuff.

甩你一脸翔 2024-09-05 09:13:00
  • 了解一般/特定构建过程的步骤(功能检查、依赖性检查、派生源的生成、编译、链接、安装等)
  • 了解用于上述操作的工具(这里 automake 可能是一个例外:)
  • 检查先决条件(操作系统和库版本、附加软件包等)
  • 拥有一个干净的构建环境 - 在同一系统上安装具有所有可能功能的所有内容迟早会让您陷入依赖冲突。

希望这有帮助。

  • Understand what are the steps in general/particular build process (feature checks, dependency checks, generation of derived sources, compilation, linking, installation, etc.)
  • Understand the tools used for the above (automake might be an exception here :)
  • Check the prerequisites (OS and libraries versions, additional packages, etc.)
  • Have a clean build environment - installing everything with all possible features on the same system will sure get you into dependency conflicts sooner or later.

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文