Paths_pandoc.hs是如何生成的?

发布于 2025-01-05 16:47:02 字数 178 浏览 3 评论 0原文

在项目 pandoc 中,Paths_pandoc 被导入到 Shared.hs 中。 Paths_pandoc.hs 位于 dist/build/autogen/ 中。它是如何生成的以及它对pandoc有什么作用。

In the project pandoc, Paths_pandoc is imported in Shared.hs. Paths_pandoc.hs is located in dist/build/autogen/. How is it generated and what does it do for pandoc.

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

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

发布评论

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

评论(1

永言不败 2025-01-12 16:47:02

这是由 Cabal 生成的文件。

当您在项目的 .cabal 文件中指定 Data-files: 时,运行时这些文件将被复制到系统上“数据文件”的合适位置阴谋安装。在 Windows 上,这可能是“C:\Program Files\Something”,在 Linux 上,它可能是“/usr/share/something”(至少当您执行 --system 安装时)。

您的代码需要知道文件被复制到哪里,因此 Cabal 生成该特殊模块,其中包含用于复制数据文件的安装路径的变量,以便您的代码可以找到已安装的数据文件。

该模块还包含 Cabal 为您提供的其他信息,但该模块的主要目的就是我刚才描述的。

有关详细信息,请参阅此博文

It's a file that is generated by Cabal.

When you specify Data-files: in your .cabal file for your project, those files will be copied to a good location for "data files" on your system when you run cabal install. On Windows, this might be "C:\Program Files\Something" and on Linux it might be "/usr/share/something" (At least when you do a --system install).

Your code needs to know where the files were copied to, so Cabal generates that special module, which contains variables for the install paths that were used to copy the data files, so that your code can find the installed data files.

The module does also contain other information that Cabal provides for you, but the primary purpose of the module is what I just described.

See this blog post for more information.

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