Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当一个包更新时,同时更新依赖它的包 #162

Closed
petronny opened this issue Aug 13, 2020 · 8 comments
Closed

当一个包更新时,同时更新依赖它的包 #162

petronny opened this issue Aug 13, 2020 · 8 comments

Comments

@petronny
Copy link
Member

如题。
即在现在的 all_building 基础上,加上类似

a = all_building
i = 0
while index < len(a):
    a.union(packages_depend_on_a[i])
a.discard(all_building)
logger.info('these updated (repo_depends) packages should be rebuilt: %r', a or None)
all_building.union(a)
@lilydjwg
Copy link
Member

那我那些用 rust-nightly 构建的 rust 包就……

@yuyichao
Copy link
Member

对官方包的依赖也没有自动更新, 所以虽然考虑过这个, 不过是不是用 update_on 手动指定下会好些...

@petronny
Copy link
Member Author

我想了一下,我们需要repo_dependsrepo_makedepends...

现在的repo_depends一律迁移为repo_makedepends

@yuyichao
Copy link
Member

其实并不完全是 depends 跟 makedepends 的区别?

要不要重新编译实际上取决于重新编译的结果有没有实质的区别. 即使是运行时需要的 (depends), 对编译的结果也不一定有影响. 即使只是编译时需要的, 编译的结果也可能有变化...

@petronny
Copy link
Member Author

petronny commented Aug 13, 2020

那。。。repo_depends不变,要rebuild的挪到一个auto_rebuild_repo_depends
或者给repo_depends的项加一个auto_rebuild参数?

@petronny
Copy link
Member Author

petronny commented Aug 13, 2020

我想了一下主要还是解决的是 .so 文件的问题。。。
所以叫 repo_so_depends 也是可以的。。。

然后我想了一个自动检查 repo_so_depends 的流程:

for package_i in all_packages:
  so_files = find all `.so*` files in package_i with `pacman -Sl`
  for so_file in so_files:
    linked_dynamic_libraries = get the linked dynamic libraries of so_file by `ldd`
    for linked_dynamic_library in linked_dynamic_libraries:
      if linked_dynamic_library matches `.so.pkgver*`:
        rebuild_dependency = find which package contains linked_dynamic_library by `pacman -F` (need functools.lru_cache)
        print(f"{package_i} should be rebuilt when {rebuild_dependency} is updated.")

@yuyichao
Copy link
Member

自动检测so变化很好,不过还是有很多其他种类的依赖的。。。

@lilydjwg
Copy link
Member

lilydjwg commented Jan 5, 2023

已实现为 lilac.yaml 中的 update_on_build 项。

@lilydjwg lilydjwg closed this as completed Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants