如何将更新同步到 Windows 符号存储? [英] How do you synchronize updates to a Windows symbol store?

查看:26
本文介绍了如何将更新同步到 Windows 符号存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑建立一个 符号存储 并扩展我们的打包基础架构,以便调试符号自动添加到存储中.这个想法是,一旦构建完成,我们在构建目录上运行 symstore 并将所有 .pdb 文件合并到符号存储中.原则上,这似乎相当简单,但存在一个问题:

I'm considering to set up a symbol store for our team and extend our packaging infrastructure so that debug symbols automatically get added to the store. The idea was that once a build is finished, we run symstore on the build directory and have it merge all the .pdb files into the symbol store. In principle, this appears to be fairly straightforward to do but there's one issue:

使用SymStore 解释说

SymStore 不支持来自多个用户的同时交易.建议指定一个用户作为符号存储的管理员",负责所有添加和删除交易.

SymStore does not support simultaneous transactions from multiple users. It is recommended that one user be designated "administrator" of the symbol store and be responsible for all add and del transactions.

这是一个问题,因为我们有很多构建机器,并且两个(独立的)构建完全有可能大致同时完成,因此尝试并行更新符号存储.

This is a problem because we have plenty of build machines, and it's perfectly possible that two (independant) builds finish at roughly the same time and hence try to update the symbol store in parallel.

我可以想出各种方法来确保总是只有一个 symstore 进程更新符号存储,但在我推出自己的同步方法之前,我想知道:

I can think of various ways to ensure that there's always only one symstore process updating the symbol store, but before I roll my own synchronization method I wonder:

是否有一种(准)标准或非常传统的方式来更新符号存储,以确保没有多个并发事务?特别是,似乎可以 编写您自己的符号存储创建程序,也许有一种流行的替代方法 使用某种锁来处理同步?我想其他团队一定已经(并希望)解决了这个问题.

Is there a (quasi) standard or very conventional way of updating a symbol store in a way which ensures that there aren't multiple concurrent transactions? In particular, it appears that it's possible to write your own symbol store creation program, maybe there's a popular alternative which does handle synchronization using some sort of lock or so? I imagine other teams must have hit (and hopefully) solved this problem already.

推荐答案

我最终编写了一个小工具 withlockfile 我可以用它来同步添加交易到符号存储.这个想法是,而不是

I ended up writing a little utility withlockfile which I can use to synchronize adding transactions to the symbol store. The idea is that instead of

symstore add ... /s \\myserver\symbols

我将调用包装在 withlockfile 调用中,该调用将挂起,直到它可以获取锁定文件.锁定文件存储在实际符号存储中.所以我上面的电话变成了

I wrap the invocation in a withlockfile call which will suspend until it can acqure a lock file. The lock file is stored in the actual symbol storage. So my above call becomes

withlockfile \\myserver\symbols\lockfile.txt symstore add ... /s \\myserver\symbols

此命令在我们的构建之后执行,因为所有 withlockfile 调用都使用相同的(共享)锁定文件,因此不会同时运行两个 symstore 调用.

This command is executed after our builds, since all withlockfile calls use the same (shared) lock file, no two symstore invocations run concurrently.

这篇关于如何将更新同步到 Windows 符号存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆