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

lilac.yaml 配置文件 #883

Closed
7 of 8 tasks
lilydjwg opened this issue Oct 10, 2018 · 19 comments
Closed
7 of 8 tasks

lilac.yaml 配置文件 #883

lilydjwg opened this issue Oct 10, 2018 · 19 comments
Assignees

Comments

@lilydjwg
Copy link
Member

lilydjwg commented Oct 10, 2018

问题类型 / Type of issues

  • 其它 / other

将一些数据形式的字段从 lilac.py 独立出来,方便编写。代码部分还是放在 lilac.py 中。

这些字段包括:

  • update_on
  • depends
  • time_limit_hours
  • pre_build / post_build / post_build_always (指定函数名)
  • maintainers
  • output_packages (取代 package.list)

大家觉得如何呢?

一个 lilac.yaml 大概会是这样子:

update_on:
  - aur
  - github: username/repo
    use_latest_release: true
depends:
  - this-pkg
  - a-split-pkg: some-pkg-name

另外,lilac.py 需要能够访问这些数据么?

相关事务:

@a-wing
Copy link
Member

a-wing commented Oct 10, 2018

build_prefix: extra-x86_64
pre_build: vcs_update
post_build:
  - func: git_add_files('PKGBUILD')
  - func: git_commit()

反正常用的就几那么多。。。只做语法转换就可以

要不干脆在读 lilac.py 之前加个 hook 。。。 如果存在lilac.yaml 就动态生成 lilac.py(这样还可以兼容原来的配置)

或者 lilac build 时 传入一个 打包方法的 对象 。让 dsl 可以任意实现,最后传 配置的对象来执行改如何打包 (((

@lilydjwg
Copy link
Member Author

嗯,简单的 pre / post build 可以直接写 yaml。就只支持写函数名好了,其它的还是写到 lilac.py 里去?

@a-wing
Copy link
Member

a-wing commented Oct 10, 2018

特别复杂的还是写到 lilac.py 里好。。。不过有特别复杂的吗?

@lilydjwg
Copy link
Member Author

有啊,比如 vim-lily 和 rust-nightly。

lilydjwg added a commit to archlinuxcn/lilac that referenced this issue Oct 22, 2018
@lilydjwg
Copy link
Member Author

@farseerfc pre-commit 有没有支持 lilac.yaml 里的 update_on 呢?

@petronny
Copy link
Member

petronny commented Oct 23, 2018

复杂的lilac.py比如vcs包repo上游变了要删。。。
hashsum写错了得手动修改
depends, makedepends有缺的要手动加上
要是这些也能有专门函数就好了

或者直接跑sh得了。。。

build_prefix: extra-x86_64
pre_build:
  - aur_pre_build
  - sh: sed 's/hashsum1/hashsum2/' -i PKGBUILD
  - sh: [ `date +%Y%m%d` < 20181024 ] && rm -rf vcs/
  - sh: sed '/^depends=/s/)/ "git")/' -i PKGBUILD

@a-wing
Copy link
Member

a-wing commented Oct 23, 2018

depends, makedepends有缺的要手动加上

你是说 add_dependsadd_makedepends ?

@lilydjwg
Copy link
Member Author

呃,你可以直接在 lilac.py 里拿 subprocess 跑 shell 脚本的。要删旧文件的话,可以在编译机上跑 sudo cleanup-package-files 包名 了。

在 yaml 里写 shell 命令很容易出错的,比如你评论里写的这个 pyyaml 解析时就会报错。

@farseerfc
Copy link
Member

現在 pre-commit 支持 lilac.yaml 了,作爲測試 yed 包只有 lilac.yaml 刪掉了 lilac.py 和 nvchecker.ini 裏的相關描述。

@lilydjwg
Copy link
Member Author

哎,lilac.py 目前还不能删掉的。没东西写的话留个空文件就好。

@farseerfc
Copy link
Member

哦哦給 yed 加了個空的 lilac.py

@yan12125
Copy link
Member

我參考了 archlinuxcn/lilac#68 的格式以及百合的建議加上了maintainers。例如:

maintainers:
  - github: yan12125
    email: yan12125@gmail.com

如果有更好的表示法,歡迎提出來!

@petronny
Copy link
Member

petronny commented Oct 28, 2018

maintainers:
  - aur
  - aur: gcc5

分别表示通知当前pkgbase的AUR维护者和某个包的AUR维护者?

@yan12125
Copy link
Member

如果一個包在archlinuxcn的維護者和在AUR上的不同,還是要有一些欄位用來表示吧。

另外,在什麼情況下需要通知其他包的維護者呢?

@petronny
Copy link
Member

是这样,比如包a,我设置了func(a),可以把包a修改为a-archlinuxcn
同时我设置了lilac上游为aur,即每次aur的包a更新,a-archlinuxcn就会更新
这时可能需要

maintainers:
  - aur: a

@lilydjwg
Copy link
Member Author

我不赞成给 AUR 维护者发送报错邮件。他们并不预期这些邮件。如果他们想要参与的话,可以直接把邮件地址加过来。

@petronny
Copy link
Member

呃,也有道理。那还是不加为好吧

@petronny
Copy link
Member

petronny commented Nov 1, 2018

你是说 add_depends 和 add_makedepends ?

这俩竟然有了。。。
话说有没有remove_dependsreplace_depends...

@lilydjwg lilydjwg changed the title [讨论] lilac.yaml 配置文件 lilac.yaml 配置文件 Nov 3, 2018
@lilydjwg lilydjwg self-assigned this Nov 3, 2018
@lilydjwg
Copy link
Member Author

lilydjwg commented Nov 5, 2018

已经实现好啦。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants