rime / plum

東風破 /plum/: Rime configuration manager and input schema repository
GNU Lesser General Public License v3.0
1.35k stars 139 forks source link

Do not update packages if no_update is set. #16

Closed pmeiyu closed 5 years ago

pmeiyu commented 5 years ago

Do not update packages if no_update is set.

lotem commented 5 years ago

This change is incorrect. update-package.sh has to be called to checkout the required branch.

What is the problem you are trying to solve with this change?

pmeiyu commented 5 years ago

I'm building rime-data on Guix. Guix does not allow updating source code when building packages. So plum should not try to update schema packages when no_update is set.

When building rime-data on Guix, every schema package is downloaded by Guix and it's limited to a specific commit. If a branch is needed, then that branch's commit is downloaded. Both updating git repository and switching git branch are against the principle of reproducible builds.

lotem commented 5 years ago

I understand your requirement. With no_update=1 the script won't pull from remote unless the requested branch doesn't exist locally. You do not need this code change.

pmeiyu commented 5 years ago

Currently plum throw a lot of warnings because it cannot find the git command. Guix building environment is limited to only necessary dependencies, so git is not available. Could this be fixed?

lotem commented 5 years ago

Does the build system support "dev/build dependencies"? If you aim to package data, git sounds like a build time dependency but not required at runtime.

pmeiyu commented 5 years ago

Yes I can pass git as a build time dependency, but plum still throw warnings because schema packages are not git repositories. WARNING: not a git repository, skipped updating './package/rime/bopomofo' Schema packages are pre-downloaded by Guix and are copied (symlink actually) into "package/rime" directory, so they are not git repositories.

pmeiyu commented 5 years ago

I am porting Rime to Guix. If you are interested, please have a look at the package definition I wrote for rime-data: https://github.com/meiyopeng/guix/blob/rime/gnu/packages/ibus.scm#L322

lotem commented 5 years ago

Wocow, it's written in lisp. There is a problem for you: the build itself isn't "reproducible", and source code is not tagged: rime/plum doesn't yet support "locking" the version of downloaded packages, neither by tags, submodule reference, nor by saving the git ref in a lock file.

pmeiyu commented 5 years ago

There is a problem for you: the build itself isn't "reproducible", and source code is not tagged:

Yeah, I know. I reported the reproducibility issue to librime, but still have no answer.

rime/plum doesn't yet support "locking" the version of downloaded packages, neither by tags, submodule reference, nor by saving the git ref in a lock file.

My solution is to manually specify commit id for every schema package and copy them into "package/rime" directory. I have already successfully built rime on Guix. I made this pull request to suppress build process warnings when building rime-data. It would be great if you can provide an option to prevent plum from trying to download packages and check out branches. The same option will also be useful to NixOS, a similar OS to Guix.