Code Monkey home page Code Monkey logo

Comments (17)

zsrkmyn avatar zsrkmyn commented on June 27, 2024

直接在 /var/cache 里建立 cargo 和 sccache 目录,然后每次 build 的时候传 -d 参数给 makechrootpkg,把 cache 目录 bind 进去,再对 makepkg 设置环境变量, 就像这样:

*-x86_64-build ... -- -d /var/cache/sccache -d /var/cache/cargo -- SCCACHE_DIR=/var/cache/sccache CARGO_HOME=/var/cache/cargo

是否可行?

但是怎样传正确的 PATH 给 makepkg 让它使用 sccache 呢?

from lilac.

lilydjwg avatar lilydjwg commented on June 27, 2024

权限呢?你试试看行不行?

PS: cargo 的 registry 也要共享,不然好像得每次打包都 clone 一份……还有包文件的缓存(就整个 ~/.cargo 共享好了)

from lilac.

zsrkmyn avatar zsrkmyn commented on June 27, 2024

权限除了 777 还没有想到更好的方法…毕竟 build 的时候是用 builduser。

共享了 CARGO_HOME 的下就包括了 registry 了吧(实际测试时 build 了两次 ydcv-rs,也只有一次更新过 index 和下载过 crates)?CARGO_HOME 的 registry/ 下包括了 index、src 和 cache 三个目录。我对 cargo 不太了解,本来是想解决 ccache 问题才看到这个 issue 😂

from lilac.

lilydjwg avatar lilydjwg commented on June 27, 2024

builduser 好像就是当前用户耶。这样的话只要放我家里就可以了。我先拿 ~/.cargo 试试看,可以的话我继续加 ccache 什么的。

from lilac.

lilydjwg avatar lilydjwg commented on June 27, 2024

好像对 exa-git 有效,对 servo-git 无效呢。

from lilac.

zsrkmyn avatar zsrkmyn commented on June 27, 2024

servo-git 要 archlinuxcn-x86_64-build -- -d /home/zsrkmyn/.cargo:/build/.cargo -- CARGO_HOME=/build/.cargo
可以看 python/servo/command_base.py 里第 250 行。

from lilac.

zsrkmyn avatar zsrkmyn commented on June 27, 2024

或者是 python/servo/bootstrap_commands.py 的 372 行,我也不确定是哪里起的作用 😂

from lilac.

lilydjwg avatar lilydjwg commented on June 27, 2024

你能弄明白它默认把 CARGO_HOME 设到哪里了么?

from lilac.

zsrkmyn avatar zsrkmyn commented on June 27, 2024

应该是 /build/servo-git/src/servo/.cargo,就是 mach 文件所在目录。从 mach 的 mian() 里传进去的。

以下是废话……
python/mach_bootstrap.py 257 行定义了 populate_context 处理 'topdir',271 行作为 handler 传给 mach 对象,在 python/_virtualenv/lib/python2.7/site-packages/mach/main.py 380 行把该 handler 传给 context 实例的构造函数,142 行 ContextWrapper 中把这个 handler 设成了 context 对象的 _handler 属性,然后获取 context.topdir 的利用这个 handler 获取 topdir。真麻烦 (

from lilac.

lilydjwg avatar lilydjwg commented on June 27, 2024

哦。也就是在 chroot 里边,打包好就被干掉了……这样的话,在打包脚本里设置环境变量更合理 @farseerfc

from lilac.

zsrkmyn avatar zsrkmyn commented on June 27, 2024

所以应该在 PKGBUILD 里设置 PATH 和 CARGO_HOME 变量吗?这样会不会很麻烦?直接通过 *-*-build 传进去呢?

from lilac.

lilydjwg avatar lilydjwg commented on June 27, 2024

就 servo 特殊啊。

from lilac.

zsrkmyn avatar zsrkmyn commented on June 27, 2024

但是 CARGO_HOME 本身对 cargo 也有效,man cargo 里有写。(虽然感觉除了 servo 一般不会去动这个环境变量

from lilac.

lilydjwg avatar lilydjwg commented on June 27, 2024

sscache 没实现,registry 和下载的包都应该共享好了。

from lilac.

petronny avatar petronny commented on June 27, 2024

第三方 repo呢?。。。
主要是有些git包的submodule每次都得下载一遍。。。

from lilac.

lilydjwg avatar lilydjwg commented on June 27, 2024

submodule 都是在 PKGBUILD 里处理的呀。

from lilac.

zsrkmyn avatar zsrkmyn commented on June 27, 2024

from lilac.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.