这里记载下loongarch64 on Debian的一些资源,虽然现在还没有准备好。
https://blog.xen0n.name/en/posts/tinkering/loongarch-faq/
记录下维护rush的操作,在后面进行更广泛的总结。
vimer@debian-local:~/build_test/rfs/debian-rush$ gbp clone [email protected]:vimerbf-guest/rush.git
gbp:info: Cloning from '[email protected]:vimerbf-guest/rush.git'
其实,如果有新的upstream更新,应该是先gbp pq import
,其次才是import upstream release.
https://www.eyrie.org/~eagle/notes/debian/git.html#workflow:
When there's a new upstream release, run:
git fetch upstream
gbp pq import # only if you have patches against upstream
git checkout debian/master
gbp import-orig --uscan --upstream-vcs-tag=<upstream-tag>
# The rest are only if you have patches against upstream
gbp pq rebase
gbp pq export
gbp pq drop
git add debian/patches
git commit
import新的版本:
vimer@debian-local:~/build_test/rfs/debian-rush/rush$ gbp import-orig --uscan --debian-branch=debian/main --upstream-branch=upstream/latest --verbose
gbp:debug: ['git', 'rev-parse', '--show-cdup']
gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
gbp:debug: ['git', 'rev-parse', '--git-dir']
gbp:debug: ['git', 'for-each-ref', '--format=%(refname:short)', 'refs/heads/']
gbp:debug: ['git', 'show-ref', '--verify', 'refs/heads/upstream/latest']
gbp:error:
Repository does not have branch 'upstream/latest' for upstream sources. If there is none see
file:///usr/share/doc/git-buildpackage/manual-html/gbp.import.html#GBP.IMPORT.CONVERT
on howto create it otherwise use --upstream-branch to specify it.
这里失败了,因为没有upstream/latest
branch. 对策是新建一个upstream/latest
branch即可。
vimer@debian-local:~/build_test/rfs/debian-rush/rush$ git checkout -b upstream/latest
切换到一个新分支 'upstream/latest'
vimer@debian-local:~/build_test/rfs/debian-rush/rush$ git checkout debian/main
切换到分支 'debian/main'
您的分支与上游分支 'origin/debian/main' 一致。
...
vimer@debian-local:~/build_test/rfs/debian-rush/rush$ gbp import-orig --uscan --debian-branch=debian/main --upstream-branch=upstream/latest --verbose
...
gbp:debug: rm ['-rf', '../tmpdk5cwagw'] []
gbp:info: Successfully imported version 2.2 of ../rush_2.2.orig.tar.gz
假设我们有一个新的 upstream release,使用 gbp buildpackage
时,如果没有orig的tarball,则不会build的,
build的version是根据top of changelog来确定版本及对应的tarball。
gbp buildpackage --git-upstream-tree=upstream/2.2 --git-upstream-branch=upstream/2.2 --git-builder=sbuild -d unstable --git-debian-branch=debian/main --git-export-dir=../build-area/ --git-ignore-new --verbose
这个只有在我们没有新的orig tarball时确认使用。
还可以使用这个命令编译:
gbp buildpackage --git-builder=sbuild -d unstable --source --git-debian-branch=debian/main --git-export-dir=../rush-build-area/ --git-ignore-new --verbose
Please fix your approach of downloading the orig.tar.gz. This one is not the originally distributed one… You can get the right one with
uscan --download-current-version.
gpg --armor --detach-sign myprogram-0.1.orig.tar.gz
salsa 后面所有的改动转移到这里来。
Please run `origtargz` before to get the orig.tar.gz.
There is something off with the file in the archive.
I guess I took that from your mentors upload.
https://wiki.debian.org/UpdatingaPackagetoNewUpstreamVersion这篇wiki真的不错,解决如何更新upstream的问题。
收藏!
这里肥猫大佬提供了许多材料,对于目前的我暂时还是消化不了,暂且把所有的材料放在这里收藏一下,以防后面需要时找不到。
原始问题:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1011913
Arch的解决方案: https://github.com/felixonmars/archriscv-packages/blob/master/gcc/riscv64.patch#L65
gcc那边的issue: https://github.com/riscv-collab/riscv-gcc/issues/337
惊人的分析文章: https://blog.jiejiss.com/A-RISC-V-gcc-pitfall-revealed-by-a-glibc-update/
这里有很多import的场景:
对于新包来说,需要新建一个repo,创建各个分支,详情可以参考python package notes,这个需要 one by one的去做.
最好使用dsc 这个选项:
gbp import-dsc --upstream-branch=upstream/latest --debian-branch=debian/main --verbose ../libunwind_1.3.2-2.dsc --pristine-tar
gbp import-orig --debian-branch=debian/main --upstream-branch=upstream/latest
使用 gbp 带sbuild去编译debian package的方法如下 :
gbp buildpackage --git-builder=sbuild --git-debian-branch=debian/main --git-upstream-tree=upstream --git-pristine-tar-commit --git-ignore-new --git-export-dir=/tmp/build-area/jimtcl --git-verbose
需要 .sbuildrc
的配合:
# -d
$distribution = 'unstable';
# -A
$build_arch_all = 1;
# -s
$build_source = 1;
# --source-only-changes (applicable for dput. irrelevant for dgit push-source).
$source_only_changes = 1;
# -v
$verbose = 1;
# parallel build
$ENV{'DEB_BUILD_OPTIONS'} = 'parallel=5';
##############################################################################
# POST-BUILD RELATED (turn off functionality by setting variables to 0)
##############################################################################
$run_lintian = 1;
$lintian_opts = ['-i', '-I'];
$run_piuparts = 1;
# 暂时停用 piuparts 检查
#$piuparts_opts = ['--schroot', 'unstable-amd64-sbuild', '--no-eatmydata'];
$run_autopkgtest = 1;
$autopkgtest_root_args = '';
$autopkgtest_opts = [ '--', 'schroot', '%r-%a-sbuild' ];
gbp buildpackage --git-builder=sbuild --arch=riscv64 -d sid --source --git-debian-branch=debian/main --git-export-dir=../rush-build-area/ --git-ignore-new --verbose
不用顾虑上游源代码。
这种情况是,直接clone salsa后,里面只有一个debian/
目录。例如 neochat, 当clone下来之后,如果按照上面的命令进行编译,会遇到上面的issue:
gbp:error: upstream/22.06 is not a valid treeish
解决方案就是使用本地的upstream tarball代替upstream分支。
uscan --force-download
gpgv: Signature made Fri Jun 24 14:41:11 2022 UTC
gpgv: using RSA key B3CB366552540BE06EE9AD9711968C44928CAEFC
gpgv: Good signature from "Bhushan Shah (mykolab address) <[email protected]>"
gpgv: aka "Bhushan Shah <[email protected]>"
gpgv: aka "Bhushan Shah (kde) <[email protected]>"
Successfully symlinked ../neochat-22.06.tar.xz to ../neochat_22.06.orig.tar.xz.
# 直接使用下载好tarball
gbp buildpackage --git-tarball-dir=../ --git-builder=sbuild -d unstable --git-debian-branch=debian/main --git-export-dir=../build-area/ --git-ignore-new --verbose
gbp import-orig --uscan --debian-branch=debian/main --upstream-branch=upstream/latest
gbp import-orig --verbose --upstream-branch=upstream/latest --upstream-version=2.2 ../v2.3.2.tar.gz
如果针对 d/*
下面的目录进行修改,目前没有好的方法,比如使用quilt
或者patch
,但是我们可以使用
$ debdiff old/waypipe_0.8.2-3.dsc waypipe_0.8.2-3.dsc
dpkg-source: warning: extracting unsigned source package (/home/vimer/05/26_waypipe/waypipe_0.8.2-3.dsc)
diff -Nru waypipe-0.8.2/debian/rules waypipe-0.8.2/debian/rules
--- waypipe-0.8.2/debian/rules 2021-12-01 15:39:26.000000000 +0000
+++ waypipe-0.8.2/debian/rules 2021-12-01 15:39:26.000000000 +0000
@@ -16,7 +16,7 @@
dh_auto_configure -- -Dwith_avx2=false -Dwith_avx512f=false -Dwith_neon_opts=false -Dwith_sse3=false
endif
-ifneq (, $(filter $(DEB_HOST_ARCH),mipsel mips64el))
+ifneq (, $(filter $(DEB_HOST_ARCH),mipsel mips64el riscv64))
override_dh_auto_test:
@echo "Skipping tests on $(DEB_HOST_ARCH)."
endif