debian/watch 对于新手打包者来说,是一个非常难啃的骨头,所以,这里简单的记录下。
version=4
opts=dversionmangle=s/\+ds(\.\d+)?$//,repacksuffix=+ds,repack,compression=xz,pgpsigurlmangle=s/$/.asc/, \
https://strace.io/files/@ANY_VERSION@/@PACKAGE@-@ANY_VERSION@@ARCHIVE_EXT@
debian/watch:
version=4
opts=dversionmangle=s/\+dfsg.*$//,repacksuffix=+dfsg,compression=xz \
https://github.com/rems-project/sail/tags .*/archive/.*/(\d\S+)\.tar\.gz
现在能匹配到 0.18-linux-binary, 如何只匹配到 0.18
如下:
version=4
opts=dversionmangle=s/\+dfsg.*$//,repacksuffix=+dfsg,compression=xz \
https://github.com/rems-project/sail/tags .*/archive/.*/(\d+\.\d+)\.tar\.gz
(\d+\.\d+)
:这部分正则表达式只匹配由数字和一个点组成的版本号,如 0.18,它确保只会匹配类似 0.18 的格式,而不会匹配后面带有其他字符的版本号,如 0.18-linux-binary。
目前,众所周知的是,如果软件包是大版本升级,需要首先进入 NEW queue,目前这个机制在Debian内部也引起了巨大的反响,还正在讨论中。 当NEW queue没有问题后,向 release team发行 transition请求,即可再次向sid发送此版本的package更新。
在这里,简单记录下所有相关资料的链接。
一个推荐的工作流程:
dch -i -m "Source only upload for testing migration."
dch -r
debuild -S
cd .. ; dput $changes_file
# git commit & git tag
Emaces team推荐的方式:
for foo in ...; do
dgit clone foo
dch "Rebuild for ..."
dch -r
git commit debian/changelog -m"..."
dgit push-source
done
Not relevant with the issue. But could you tell me what meaning of binNMU here and how to generate it?
binNMUs (~= binary NMU) are rebuilds of a package without an upload. They can be triggered by the release team and are part of transitions. See also https://wiki.debian.org/Teams/ReleaseTeam/Transitions
From my view I can understand, because we want to upgrade libzim(7->8), but its reverse dependencies has failed build on libzim8, so we have to upload binNMU for libzim8’s reverse dependencies packages? Or binNMU is just for libzim8?
The binNMUs are for the reverse dependencies of libzim7 so that they pick up a dependency on libzim8.
Package: release.debian.org
Severity: normal
User: [email protected]
Usertags: binnmu
Hello,
I want to request binNMU to support python3.11.
nmu spglib_2.0.2-1 . ANY . unstable . -m "Add python3.11"
下面的命令可以展示tmux的具体依赖关系,当然,是以图片的方式展示的。
sudo apt-rdepends --dotty tmux | dot -Tpng > dependency-tmux-map.png
推荐使用 apt install ubuntu-dev-tools
下的reverse-depends
工具:
sudo reverse-depends python3-dbus
Reverse-Recommends
* autosuspend
* deluge-common
* gajim
* hijra-applet
* linuxcnc-uspace [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x]
* monajat-applet
* mps-youtube
* netatalk [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x]
* pithos
* python3-pantalaimon
* quodlibet
* sabnzbdplus
* solaar
* xboxdrv [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x]
* xpra [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x]
Reverse-Depends
* a2jmidid [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x]
* autokey-common
* autokey-gtk
...
该包是 devscripts
工具包的一部分, 具体的用法为:
build-rdeps glyphspkg
Reverse Build-depends in testing/main:
See #1095519
出于验证一个测试程序的目的,需要在riscv64的板子上源码安装golang,原本很简单的事情,但是操作之后才发现不是这回事,故这里简单记录下,以便后面需要时用到。
以下操作是在mengzhuo老师的指导下完成。
首先知道的一点是,源码编译go, here,另外golang目前(2022/08/01)还没有riscv64的二进制包,需要更需要从源码编译。从源码编译,需要有一个自举的过程,但是Bootstrap toolchain from C source code 1.4 版本还不支持rv,所以,这里就麻烦一些了。
首先安装 golang-go - Go programming language compiler, linker, compiled stdlib. 在目前的debian系统上,已经默认安装支持golang-go,一定要使用这个,不要使用gccgo,后者的问题非常多。
apt install golang-go
然后 go version
就可以看到相应的输出了。在相同的terminal下,然后下载 golang 的source code,我下载的是 go version go1.18.4.解压,然后执行./make.bash
即可。
这个时候或者编译完成后,如果go version提示说找不到相关命令,大概率是由于 goroot gopath的相关路径不对。
GOROOT=/home/vimer/go/go/
这里其实就是指向的你的go源码的位置:
vimer@unmatched:~/go/go$ ls
AUTHORS CONTRIBUTORS PATENTS SECURITY.md api codereview.cfg lib pkg test
CONTRIBUTING.md LICENSE README.md VERSION bin doc misc src
紧接着,要把 go的可执行程序加入$PATH中:
export PATH=$PATH:$GOROOT/bin
还有一个是GOPATH:
GOPATH="/home/vimer/go/proj"
这个是用来存储相关go的生成物的。
因为go是google开发的嘛,有些东西timeout是不可避免的,所以遇到这种问题时,需要使用:
GOPROXY="https://proxy.golang.com.cn"
目前来看,bookworm应该默认使用gcc-12了,不过,从目前的QA质量来看,有不少C++包在rebuild时失败了。这篇文章就是简单的记录这个ftbfs summary. 其实做了这么多我发现,任何东西都不能浮于表面,也就是fix 一个issue,需要深挖背后的原理。当然,我现在的时间、资历还达不到那个级别,所以这个page就是当做笔记用的。
GCC 11 defaults to the GNU++17 standard.
指引性的文章here
其实大部分的ftbfs集中在这一块。
http://qa-logs.debian.net/2022/06/09/gcc12/dbus-c++_0.9.0-9_unstable_gcc12.log
/usr/include/c++/12/iomanip:170:5: note: template argument deduction/substitution failed:
../../include/dbus-c++/types.h:96:8: note: ‘DBus::MessageIter’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
96 | ri >> cast;
| ~~~^~~~~~~
/usr/include/c++/12/iomanip:200:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>&
+std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)’
200 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
| ^~~~~~~~
/usr/include/c++/12/iomanip:200:5: note: template argument deduction/substitution failed:
../../include/dbus-c++/types.h:96:8: note: ‘DBus::MessageIter’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
96 | ri >> cast;
| ~~~^~~~~~~
/usr/include/c++/12/iomanip:230:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>&
+std::operator>>(basic_istream<_CharT, _Traits>&, _Setw)’
230 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f)
| ^~~~~~~~
/usr/include/c++/12/iomanip:230:5: note: template argument deduction/substitution failed:
../../include/dbus-c++/types.h:96:8: note: ‘DBus::MessageIter’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
96 | ri >> cast;
| ~~~^~~~~~~
/usr/include/c++/12/iomanip:264:5: note: candidate: ‘template<class _CharT, class _Traits, class _MoneyT> std::basic_istream<_CharT,
+_Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Get_money<_MoneyT>)’
264 | operator>>(basic_istream<_CharT, _Traits>& __is, _Get_money<_MoneyT> __f)
Solutions: todo
这个教程是PLCT推出的,强烈推荐。在这篇文章中,我们就简单记录下这个学习过程。
https://gist.github.com/sunshaoce/90216c19591581f8997df0109b65c154 这个是RISC-V环境的构建脚本,需要先下载有相应的代码仓库。
riscv elfapi url: https://github.com/riscv-non-isa/riscv-elf-psabi-doc
Docker 环境也有了:
大家好,RVCC 开发环境的 Docker 镜像已经配置好,欢迎大家使用。详情可以参考:https://github.com/ksco/rvcc-env-docker。
提供的是国内阿里云的 registry,下载飞快!
[完结] 循序渐进,学习开发一个RISC-V上的操作系统 - 汪辰 - 2021春
https://www.bilibili.com/video/BV1Q5411w7z5
可以看看前面一部分的公共知识课,包含了RISC-V的基础指令集的详细的介绍和一些程序执行堆栈的知识
01视频地址 首先我是在rv硬件上执行这个程序的,所以命令稍微不同,但是效果是一样的。我只是没用交叉编译器嘛。
#cat tmp.s
.global main # 声明一个main的段,程序的入口
main: # 段开始的标志
li a0, 42 # a0寄存器就是 返回值
ret
# compiler cmd:
gcc -s tmp.s
./a.out
vimer@unmatched:~/build/rvcc$ echo $?
42
接下来,我们再进一步,使用一个 .c 文件:
vimer@unmatched:~/build/rvcc/02$ cat main.c
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char ** argv){
if (argc != 2){
// argc is right
fprintf(stderr, "%s: invalid number of argcs\n", argv[0]);
return 1;
}
printf(" .global main\n");
printf("main:\n");
printf(" li a0, %d\n", atoi(argv[1]));
printf(" ret\n");
}
然后Makefile:
vimer@unmatched:~/build/rvcc/02$ cat Makefile
# C编译器参数:使用C11标准,生成debug信息,禁止将未初始化的全局变量放入到common段
CFLAGS=-std=c11 -g -fno-common
# 指定C编译器,来构建项目
CC=clang
# rvcc标签,表示如何构建最终的二进制文件,依赖于main.o文件
rvcc: main.o
# 将多个*.o文件编译为rvcc
$(CC) -o rvcc $(CFLAGS) main.o
# 测试标签,运行测试脚本
test: rvcc
./test.sh
# 清理标签,清理所有非源代码文件
clean:
rm -f rvcc *.o *.s tmp* a.out
# 伪目标,没有实际的依赖文件
.PHONY: test clean
这里还有一个test.sh:
#!/bin/bash
# 声明一个函数
assert() {
# 程序运行的 期待值 为参数1
expected="$1"
# 输入值 为参数2
input="$2"
# 运行程序,传入期待值,将生成结果写入tmp.s汇编文件。
# 如果运行不成功,则会执行exit退出。成功时会短路exit操作
./rvcc "$input" > tmp.s || exit
# 编译rvcc产生的汇编文件
clang -o tmp tmp.s
# $RISCV/bin/riscv64-unknown-linux-gnu-gcc -static -o tmp tmp.s
# 运行生成出来目标文件
./tmp
# $RISCV/bin/qemu-riscv64 -L $RISCV/sysroot ./tmp
# $RISCV/bin/spike --isa=rv64gc $RISCV/riscv64-unknown-linux-gnu/bin/pk ./tmp
# 获取程序返回值,存入 实际值
actual="$?"
# 判断实际值,是否为预期值
if [ "$actual" = "$expected" ]; then
echo "$input => $actual"
else
echo "$input => $expected expected, but got $actual"
exit 1
fi
}
# assert 期待值 输入值
# [1] 返回指定数值
assert 0 0
assert 42 42
# 如果运行正常未提前退出,程序将显示OK
echo OK
执行 make test
:
vimer@unmatched:~/build/rvcc/02$ make test
clang -std=c11 -g -fno-common -c -o main.o main.c
clang -o rvcc -std=c11 -g -fno-common main.o
./test.sh
0 => 0
42 => 42
OK
其实,程序的注释已经非常清晰明了,除了一些特性,基本的流程我们总结一下。
首先,项目的主程序是main.c,也就是我们通过c程序把目前的汇编代码重定向输出到汇编文件,这个过程转换完成之后, 再利用一个简易的脚本把汇编文件编译成可执行文件,基本上模拟了一个编译器的整体流程。
徒手写一个RISC-V编译器 - 第002课
https://www.bilibili.com/video/BV1KS4y1E79u