前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【Rust 日报】2022-12-09 - chatGPT 关于 cargo + gitlab CI 两问

【Rust 日报】2022-12-09 - chatGPT 关于 cargo + gitlab CI 两问

作者头像
MikeLoveRust
发布2023-03-09 15:30:25
5100
发布2023-03-09 15:30:25
举报

chatgpt-desktop

转自 Rust 视界,作者用两天的时间卷出了一个跨平台的 chatGPT 桌面客户端,以后有人说 Rust 开发效率不行就可以拿这个项目打他脸。

https://github.com/sonnylazuardi/chatgpt-desktop

关注 wasmtime 支持 socket 的进展

最近小编又开始想着把 rust web server 编译成 wasm 运行的事情了,但是找了很久也没有找到 wasmtime(没错,就是要纯 Rust 实现的)是否实现了 socket。感谢 @Fuuu 群友提醒 #4776 和 #4276。

https://github.com/bytecodealliance/wasmtime/pull/4776

https://github.com/bytecodealliance/wasmtime/issues/4276

chatGPT 关于 cargo + GitLab CI 两问

小编对 chatGPT 提出的关于 cargo 如何整合到 GitLab CI 的两个问题,结果以外地有帮助,在此分享

How to cache cargo binaries in gitlab CI?

To cache cargo binaries in GitLab CI, you can use the cache keyword in your .gitlab-ci.yml file to specify the directories that you want to cache. For example, if you want to cache your Cargo dependencies, you could add the following lines to your .gitlab-ci.yml file:

代码语言:javascript
复制
cache:
  paths:
    - ./target/debug/
    - ./target/release/

This will cache the directories containing your compiled Cargo binaries, so that they can be reused in subsequent builds. This can help speed up your build times by avoiding the need to recompile your dependencies on every build. You can also specify a key for the cache, which allows you to specify a unique identifier for the cache so that it is not overwritten by other caches with the same path. For example:

代码语言:javascript
复制
cache:
  key: my-project-cache
  paths:
    - ./target/debug/
    - ./target/release/

This will create a unique cache with the specified key that can be used to store your compiled Cargo binaries. You can then restore the cache in a subsequent build by using the restore_cache keyword, like this:

代码语言:javascript
复制
restore_cache:
  key: my-project-cache

This will restore the cache with the specified key, allowing you to reuse the cached Cargo dependencies in your subsequent builds.

How to cache third-party cargo binaries in gitlab CI?

Caching third-party cargo binaries in GitLab CI can be done by using the cache keyword in the .gitlab-ci.yml file. This keyword allows you to specify a list of files and directories that should be cached between job runs. Here is an example of how to cache cargo dependencies in GitLab CI:

代码语言:javascript
复制
cache:
  paths:
    - /root/.cargo/registry

# Job definition goes here

In this example, the cache keyword is used to specify that the /root/.cargo/registry directory should be cached between job runs. This directory contains the Cargo registry, which stores all of the third-party crates and their dependencies that your project uses. By caching this directory, you can speed up the build process by avoiding the need to download these dependencies from the internet each time the job is run. It's important to note that the cache keyword is just one of many available options for configuring caching in GitLab CI. For more detailed information and other options, you can refer to the GitLab CI documentation.

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-12-09,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Rust语言学习交流 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 关注 wasmtime 支持 socket 的进展
  • chatGPT 关于 cargo + GitLab CI 两问
    • How to cache cargo binaries in gitlab CI?
      • How to cache third-party cargo binaries in gitlab CI?
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档