Code Monkey home page Code Monkey logo

Comments (13)

lilydjwg avatar lilydjwg commented on September 22, 2024 1

好耶~

from lilac.

lilydjwg avatar lilydjwg commented on September 22, 2024

不会啊,这种情况是支持的:

test-lilac-dep.py 代码
#!/usr/bin/env python3

from pathlib import Path

from lilac2.packages import get_dependency_map, DependencyManager
from lilac2 import lilacpy

def main():
  repodir = Path('/ldata/src/archgitrepo')
  mods, _ = lilacpy.load_all(repodir)
  depman = DependencyManager(repodir)
  m = get_dependency_map(depman, mods)
  for d in m['lxqt-panel-git']:
    print(d)

if __name__ == '__main__':
  from nicelogger import enable_pretty_logging
  enable_pretty_logging('DEBUG')
  main()

结果:

>>> py test-lilac-dep.py
Dependency(pkgdir=PosixPath('/ldata/src/archgitrepo/libsysstat-git'), pkgname='libsysstat-git')
Dependency(pkgdir=PosixPath('/ldata/src/archgitrepo/lxqt-globalkeys-git'), pkgname='lxqt-globalkeys-git')
Dependency(pkgdir=PosixPath('/ldata/src/archgitrepo/liblxqt-git'), pkgname='liblxqt-git')
Dependency(pkgdir=PosixPath('/ldata/src/archgitrepo/libqtxdg-git'), pkgname='libqtxdg-git')
Dependency(pkgdir=PosixPath('/ldata/src/archgitrepo/lxqt-build-tools-git'), pkgname='lxqt-build-tools-git')

依赖解析的代码在这里:

lilac/lilac2/packages.py

Lines 10 to 29 in c2dbbcc

def get_dependency_map(
depman: 'DependencyManager', mods: LilacMods,
) -> Dict[str, Set['Dependency']]:
map: Dict[str, Set['Dependency']] = defaultdict(set)
rmap: Dict[str, Set[str]] = defaultdict(set)
for name, mod in mods.items():
depends = getattr(mod, 'depends', ())
ds = [depman.get(d) for d in depends]
for d in ds:
rmap[d.pkgname].add(name)
map[name].update(ds)
for name, deps in map.items():
dependers = rmap[name]
for dd in dependers:
map[dd].update(deps)
return map

from lilac.

petronny avatar petronny commented on September 22, 2024

(那块折叠的是什么语法啊。。。)

from lilac.

yan12125 avatar yan12125 commented on September 22, 2024

Hmm 那我研究下為啥Lilac的指令沒有包含libqtxdg-git

命令执行失败!

命令 ['extra-x86_64-build', '--', '-I', PosixPath('/home/lilydjwg/archgitrepo/libsysstat-git/libsysstat-git-0.4.1.4.gef0e4de-1-x86_64.pkg.tar.xz'), '-I', PosixPath('/home/lilydjwg/archgitrepo/lxqt-globalkeys-git/lxqt-globalkeys-git-0.13.0.76.g7ac6ecb-1-x86_64.pkg.tar.xz'), '-I', PosixPath('/home/lilydjwg/archgitrepo/liblxqt-git/liblxqt-git-0.13.0.110.g0a6ae1d-1-x86_64.pkg.tar.xz'), '-I', PosixPath('/home/lilydjwg/archgitrepo/lxqt-build-tools-git/lxqt-build-tools-git-0.5.0.16.g72e5bf0-1-any.pkg.tar.xz'), '-d', '/home/lilydjwg/.cargo:/build/.cargo', '--', '--holdver'] 返回了错误号 255。命令的输出如下:

:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
:: Starting full system upgrade...
 there is nothing to do
==> Building in chroot for [extra] (x86_64)...
==> Synchronizing chroot copy [/var/lib/archbuild/extra-x86_64/root] -> [lilydjwg]...done
loading packages...
resolving dependencies...
:: There are 2 providers available for libgl:
:: Repository extra
   1) libglvnd  2) nvidia-340xx-utils

Enter a number (default=1): 
warning: cannot resolve "libqtxdg-git", a dependency of "liblxqt-git"
warning: cannot resolve "liblxqt-git", a dependency of "lxqt-globalkeys-git"
warning: cannot resolve "libqtxdg-git", a dependency of "liblxqt-git"
:: The following packages cannot be upgraded due to unresolvable dependencies:
      lxqt-globalkeys-git  liblxqt-git

:: Do you want to skip the above packages for this upgrade? [y/N] 
error: failed to prepare transaction (could not satisfy dependencies)
:: unable to satisfy dependency 'libqtxdg-git' required by liblxqt-git
:: unable to satisfy dependency 'liblxqt-git' required by lxqt-globalkeys-git
:: unable to satisfy dependency 'libqtxdg-git' required by liblxqt-git
==> Making package: lxqt-panel-git 0.13.0.1103.g5c4e722a-1 (Tue Dec 11 11:31:35 2018)
==> Retrieving sources...
  -> Updating lxqt-panel git repo...
Fetching origin
==> Validating source files with sha256sums...
    lxqt-panel ... Skipped
==> Making package: lxqt-panel-git 0.13.0.1103.g5c4e722a-1 (Tue 11 Dec 2018 11:31:37 AM CST)
==> Checking runtime dependencies...
==> Installing missing dependencies...
error: target not found: libsysstat-git
error: target not found: lxqt-globalkeys-git
==> ERROR: 'pacman' failed to install missing dependencies.
==> ERROR: Build failed, check /var/lib/archbuild/extra-x86_64/lilydjwg/build

调用栈如下:

Traceback (most recent call last):
  File "/home/lilydjwg/soft/lilac/lilac", line 89, in build_package
    bindmounts = BIND_MOUNTS,
  File "/home/lilydjwg/soft/lilac/lilac2/building.py", line 72, in lilac_build
    build_prefix, depend_packages, bindmounts, makechrootpkg_args)
  File "/home/lilydjwg/soft/lilac/lilac2/building.py", line 117, in call_build_cmd
    build_output = run_cmd(cmd, use_pty=True)
  File "/home/lilydjwg/soft/lilac/lilac2/cmd.py", line 103, in run_cmd
    raise subprocess.CalledProcessError(code, cmd, outs)
subprocess.CalledProcessError: Command '['extra-x86_64-build', '--', '-I', PosixPath('/home/lilydjwg/archgitrepo/libsysstat-git/libsysstat-git-0.4.1.4.gef0e4de-1-x86_64.pkg.tar.xz'), '-I', PosixPath('/home/lilydjwg/archgitrepo/lxqt-globalkeys-git/lxqt-globalkeys-git-0.13.0.76.g7ac6ecb-1-x86_64.pkg.tar.xz'), '-I', PosixPath('/home/lilydjwg/archgitrepo/liblxqt-git/liblxqt-git-0.13.0.110.g0a6ae1d-1-x86_64.pkg.tar.xz'), '-I', PosixPath('/home/lilydjwg/archgitrepo/lxqt-build-tools-git/lxqt-build-tools-git-0.5.0.16.g72e5bf0-1-any.pkg.tar.xz'), '-d', '/home/lilydjwg/.cargo:/build/.cargo', '--', '--holdver']' returned non-zero exit status 255.

@petronny: summary & details~

from lilac.

lilydjwg avatar lilydjwg commented on September 22, 2024

@yan12125 这是什么时候的日志?

from lilac.

yan12125 avatar yan12125 commented on September 22, 2024

我從我的信箱複製出來的。編譯機上的話是從lilac-log/2018-12-11T09:03:01這個檔案的146379行開始。

from lilac.

lilydjwg avatar lilydjwg commented on September 22, 2024

咦,好奇怪,明明别的都解析出来了,为什么就这个 lxqt-panel-git 的少了一个呢……

from lilac.

yan12125 avatar yan12125 commented on September 22, 2024

我在我的機器上跑test-lilac-dep.py,的確少了一個包:

$ PYTHONPATH=./vendor python t.py
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/liblxqt-git'), pkgname='liblxqt-git')
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/lxqt-build-tools-git'), pkgname='lxqt-build-tools-git')
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/libsysstat-git'), pkgname='libsysstat-git')
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/lxqt-globalkeys-git'), pkgname='lxqt-globalkeys-git')

百合是不是有些code沒有commit上去?

lilac: 9ce5f09 with archlinuxcn/repo@68142e1

from lilac.

lilydjwg avatar lilydjwg commented on September 22, 2024

同样的 commit,结果不同……大概和加载顺序有关。

from lilac.

yan12125 avatar yan12125 commented on September 22, 2024

FWIW, 我的機器上順序是這樣:

libsysstat-git
lxqt-build-tools-git
libqtxdg-git
lxqt-globalkeys-git
lxqt-panel-git
liblxqt-git
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/lxqt-globalkeys-git'), pkgname='lxqt-globalkeys-git')
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/liblxqt-git'), pkgname='liblxqt-git')
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/libsysstat-git'), pkgname='libsysstat-git')
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/lxqt-build-tools-git'), pkgname='lxqt-build-tools-git')

(我在lilacpy.py裡,load_lilac()之前加print)

from lilac.

lilydjwg avatar lilydjwg commented on September 22, 2024
libsysstat-git
lxqt-build-tools-git
liblxqt-git
libqtxdg-git
lxqt-globalkeys-git
lxqt-panel-git

果然……

from lilac.

lilydjwg avatar lilydjwg commented on September 22, 2024

@yan12125 试试 1c3dd4a

from lilac.

yan12125 avatar yan12125 commented on September 22, 2024

It works :)

libsysstat-git
lxqt-build-tools-git
libqtxdg-git
lxqt-globalkeys-git
lxqt-panel-git
liblxqt-git
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/liblxqt-git'), pkgname='liblxqt-git')
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/lxqt-build-tools-git'), pkgname='lxqt-build-tools-git')
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/lxqt-globalkeys-git'), pkgname='lxqt-globalkeys-git')
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/libqtxdg-git'), pkgname='libqtxdg-git')
Dependency(pkgdir=PosixPath('../aur/archlinuxcn-repo/libsysstat-git'), pkgname='libsysstat-git')

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.