bash MSYS2 和 Cygwin 之间的差异

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25751536/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 21:39:49  来源:igfitidea点击:

Differences between MSYS2 and Cygwin

bashcygwinmsys2

提问by antonio

Traditionally MSYS bash has been considered inferior to Cygwin bash. The former was an ancillary tool inside MinGW intended for running autoconf scripts. But now there is MinGW-w64 and MSYS2. The latter ships with a sweet pacman like package manager and elegant shells like zsh, so I wonder if there is still a gap in the emulation layer.

传统上,MSYS bash 被认为不如 Cygwin bash。前者是 MinGW 内部用于运行 autoconf 脚本的辅助工具。但现在有 MinGW-w64 和 MSYS2。后者带有像包管理器这样的甜蜜 pacman 和像 zsh 这样的优雅 shell,所以我想知道仿真层是否还有差距。

While MinGW* applications are Windows native executables, MSYS2 software requires a POSIX-emulation layer, just like Cygwin does. At least to a casual user, it is hard to spot the differences between the two.

虽然 MinGW* 应用程序是 Windows 本机可执行文件,但 MSYS2 软件需要一个 POSIX 仿真层,就像 Cygwin 一样。至少对于普通用户来说,很难发现两者之间的差异。

  • Which are the functional differences between the two emulation layers (if any)?
  • Which emulation is faster (more efficient)?
  • 两个仿真层(如果有)之间的功能差异是什么?
  • 哪个仿真更快(更有效)?

回答by Ray Donnelly

Traditionally MSYS bash has been inferior, but mostly because Cygwin remained under active development whereas MSYS didn't. MSYS forked from Cygwin version 1.3.3 and never re-synced, whereas MSYS2 resyncs with the Cygwin project regularly.

传统上 MSYS bash 一直处于劣势,但主要是因为 Cygwin 仍在积极开发中,而 MSYS 则没有。MSYS 从 Cygwin 1.3.3 版分叉出来,从未重新同步,而 MSYS2 定期与 Cygwin 项目重新同步。

We don't have a "sweet pacman like package manager", we have as direct a re-compilation of Arch Linux's pacman package manager as we could achieve.

我们没有“像包管理器一样的甜蜜 pacman”,我们可以直接重新编译 Arch Linux 的 pacman 包管理器。

MSYS2 doesn't have cygwin.dll but it does have msys-2.0.dll which does the same thing (and some more besides). Specifically, arguments that look like paths and the PATH env. var are converted to Windows form when running Windows-native software.

MSYS2 没有 cygwin.dll 但它有 msys-2.0.dll 做同样的事情(还有更多其他的)。具体来说,看起来像路径和 PATH 环境的参数。var 在运行 Windows 原生软件时被转换为 Windows 形式。

As for whether it's slower, I expect there'd be very little difference but MSYS2 would be a tiny amount slower due to the extra conversion work. Then again, chances are you'll run more Windows-native software from within MSYS2 (such as MinGW-w64 compilers) than you would from Cygwin so that'll shift things back in MSYS2's favour.

至于它是否更慢,我预计差异很小,但由于额外的转换工作,MSYS2 会慢一点。再说一次,您可能会在 MSYS2 中运行更多的 Windows 原生软件(例如 MinGW-w64 编译器),而不是在 Cygwin 中运行,因此这将使事情重新有利于 MSYS2。

回答by Dmitry Alexandrov

As well as I understand, MSYS2 is a fork of Cygwin with main goal to provide possibility to use MinGW-w64 packages. That goal is achieved at expense of total number of available software. Compare list of that of MSYS2and Cygwin.

据我所知,MSYS2 是 Cygwin 的一个分支,主要目标是提供使用 MinGW-w64 包的可能性。该目标的实现是以牺牲可用软件的总数为代价的。比较MSYS2Cygwin 的列表。

Essentially, that's all. So while you did not need to compile something under MinGW-w64, you would hardly have any reason to use MSYS2 rather than original Cygwin.

基本上,仅此而已。因此,虽然您不需要在 MinGW-w64 下编译某些东西,但您几乎没有任何理由使用 MSYS2 而不是原始的 Cygwin。