惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
月光博客
月光博客
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Visual Studio Blog
博客园 - 叶小钗
博客园 - 司徒正美
美团技术团队
博客园_首页
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News

Jia Yue Hua

完美转发不完美 闲散颂 adapting c++20 ranges algorithms for most metaprogramming 使用mpmcpipeline和jthread实现软流水 在其它线程周期回调函数 在当前线程周期回调函数 for_each cpo和tag_invoke transparent,为关联容器增加查找成员
Reproducible github Developer Environments
Jia Yue Hua · 2023-08-15 · via Jia Yue Hua

我們以 github上 jiayuehua/CMakeVcpkgManifest 代码库 爲例,说明如何在github上建立可重复的开发环境。

1. 增加devcontainer 配置文件

在visual stuido code中 C-S-P,选择CodeSpaces:add devcontainer configure files… 生成devcontainer配置文件和Dockerfile。

修改这两文件为和CMakeVcpkgManifest的内容完全一致,因为CMakeVcpkgManifest正确的配置了sshd和安装了X11 forwarding所需要的程序。将改动push到github。

2 . 添加codespace, 在github上添加codespace。

3 .本地使用ssh 连接codespace

在本地使用ssh 连接codespace,使用ssh -X 连接,可以使用X11 forwarding。

~> gh codespace list                                                                                                    14m 1s
NAME                          DISPLAY NAME    REPOSITORY                    BRANCH  STATE      CREATED AT
opulent-doodle-7p7xpx9wqw2j5  opulent doodle  jiayuehua/CMakeVcpkgManifest  master  Available  29m 

~> gh codespace ssh --config > ~/.ssh/codespaces 

~> cd .ssh                                                                                                                  5s
~/.ssh> ln id_rsa codespaces.auto
~/.ssh> ln id_rsa.pub codespaces.auto.pub
~/.ssh> ls                               
authorized_keys  codespaces  codespaces.auto  codespaces.auto.pub  config  id_rsa  id_rsa.pub  known_hosts  known_hosts.old
~/.ssh> cat config    
Match all
Include ~/.ssh/codespaces
~> ssh -X cs.opulent-doodle-7p7xpx9wqw2j5.master 
Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-1042-azure x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.
Last login: Tue Aug 15 07:25:11 2023 from 127.0.0.1

@jiayuehua ➜ /workspaces/CMakeVcpkgManifest (master) $ xeyes

可以看到xeyes在本地显示。这里假定你使用wslg安装了ubuntu,ubuntu里X11 server。这时我们便可以在本地使用visual studio code 对带图形界面的代码库进行调试了。

Posted 2023-08-15