什么可以阻止在不同平台上编译的 Linux 发行版上运行二进制文件?

发布于 2024-08-29 14:23:39 字数 200 浏览 6 评论 0原文

我们有 2 种不同的编译机:red hat as4 和 as5。我们的架构师要求我们开发人员每次在这两个平台上编译我们的程序,然后将它们复制到生产中各自的机器上。

什么可以阻止我们仅在一台机器上编译应用程序(例如,红色有 4 台机器)并将该二进制文件部署在所有目标平台上?

您的观点是什么?您能否指出您在这样做时遇到的具体问题?这样做可能会遇到什么问题?

We have 2 different compilation machine: red hat as4 and as5. Our architects require us, developers, to compile our program on those 2 platforms each time before copying them on their respective machine in production.

What could prevent us from compiling our application on one machine only (let say the red has as 4 for instance) and deploy that binary on all target platform instead ?

What is your point of view and could you pinpoint specific issues you've encountered with doing so ? What issues may I face with doing so ?

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

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

发布评论

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

评论(3

晨与橙与城 2024-09-05 14:23:39

在一个系统上构建并在另一个系统上运行时,您可能会遇到共享库不兼容的情况。在 Red Hat 的连续版本之间进行切换的可能性不大,但有可能。

您可能遇到的另一个问题是,一个系统是 32 位,另一个系统是 64 位。在这种情况下,在 64 位计算机上编译的应用程序将无法在 32 位计算机上运行。

You could run into shared library incompatibilities by building on one system and running on another. It's not especially likely going between successive versions of Red Hat, but it is possible.

Another problem you could run into is if one system is 32 bits and the other 64 bits. In that case, the app compiled on the 64 bit machine wouldn't run on the 32 bit machine.

大海や 2024-09-05 14:23:39

防止?没有什么。在 EL4 上运行的应用程序也应该在 EL5 上运行,除非外部应用程序版本不同或库已过时。然而,Red Hat 喜欢对 gcc 进行各种涉及安全性和代码优化的调整,如果您只是复制 EL4 编译的二进制文件,您将错过 EL5 中的任何改进。

此外,每个人都需要休息

Prevent? Nothing. An application that runs on EL4 should run on EL5 as well, barring things like external applications being different versions or libraries being obsoleted. However, Red Hat likes to do all sorts of tweaks to gcc that involve security and code optimization, and you'll miss out on any improvements in EL5 if you just copy the EL4-compiled binary.

Besides, everyone needs a break.

泅渡 2024-09-05 14:23:39

哇哦,编译东西然后开发人员将二进制文件复制到生产中?这是一个相当古怪的过程。

是的,您当然可以在 RHEL 4 和 5 上运行相同的二进制文件,前提是它们具有相同的架构并且您安装了依赖项。

我强烈建议您将二进制文件构建到 RPM 中,然后可以为其创建依赖项,这将确保只有在满足依赖项时才能安装它。

此外,它将使您的 QA 团队**能够安装相同的二进制文件并在非生产系统等上进行测试,他们肯定会希望在让软件靠近运维团队***之前这样做。然后部署它们,知道相关流程(包括测试)已经完成。

** 你有其中之一,对吧

*** 你肯定有其中之一!

Whoa, compiling stuff then developers copying the binaries into production? That's some pretty whacky process you've got there.

Yes of course you can run the same binaries on RHEL 4 and 5 provided they are the same architecture and you have the dependencies installed.

I would strongly recommend that you build your binaries into a RPM, then you can have dependencies created for it, which will ensure it can only be installed when dependencies are satisified.

Moreover, it will enable your QA team** to install the same binary and carry out testing on a non-production system and such like, which they will definitely want to do before they let the software anywhere near the Ops team*** who will then deploy them, knowing that the relevant processes, including testing, have been carried out.

** You have one of those, right

*** surely you have one of those!

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