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

AOSC OS MIPS64r6el Stage 2 Progress #1

Closed
Cyanoxygen opened this issue Oct 21, 2022 · 14 comments
Closed

AOSC OS MIPS64r6el Stage 2 Progress #1

Cyanoxygen opened this issue Oct 21, 2022 · 14 comments

Comments

@Cyanoxygen
Copy link

Cyanoxygen commented Oct 21, 2022

This issue tracks the tasks completed/pending for a stage 2 (dirty and minmal) AOSC OS BuildKit release. After which, we enter stage 3, when we rebuild the BuildKit recipe using Ciel, producing clean and feature-complete packages.

Road to Stage 2

  • Building AOSC OS Core
  • Introducing DPKG
  • Introducing APT
  • Introducing packages for AOSC OS maintenance toolchain
  • Completing the BuildKit recipe
  • Recording Stage 2 recipes (.stage2 support for Autobuild3)
  • Committing all manifest/scripting changes

Key Features (Stage 2)

Introduce key development features (build systems, toolchains, etc.) after apt availability is key to simplify dependency introduction during stage 2.

Maintenance Toolchain

  • autobuild3
  • acbs

Build Systems

  • autoconf
  • automake
  • cmake
  • gtk-doc
  • intltool
  • meson
  • ninja
  • pip (blocked by Rust, setuptools-rust)
  • po4a
  • python-build
  • python-installer
  • setuptools
  • wheel (blocked by Rust, setuptools-rust)

Languages

  • C
  • C++
  • Go (no architectural support)
  • GObject-Introspection
  • OCaml
  • Perl
  • Python 2
  • Python 3
  • Ruby (segfaults during build time)
  • Rust (no working version, see below)
  • Vala

Other Components

  • systemd
  • x11-lib

BuildKit Recipe

Dependencies needed to generate a stage 2 BuildKit release.

At a Glance

  • acbs
  • admin-base
  • autobuild3
  • core-base
  • debug-base
  • devel-base
  • editor-base
  • git
  • network-base
  • python-base
  • systemd-base
  • util-base
  • web-base

admin-base

  • apt
  • apt-file
  • atm (no working Rust version, see below)
  • bcache-tools
  • btrfs-progs
  • cryptsetup
  • dbus
  • debianutils
  • dosfstools
  • e2fsprogs
  • exfat-utils
  • f2fs-tools
  • fcron
  • fuse
  • genfstab
  • gnupg
  • gpart
  • gptfdisk
  • hddtemp
  • hfsprogs
  • jfsutils
  • kernel-tools
  • mdadm
  • mtd-utils
  • multipath-tools
  • nvme-cli
  • os-prober
  • parted
  • polkit
  • powertop
  • quota-tools
  • reiserfsprogs
  • rfkill
  • sg3-utils
  • shadow
  • smartmontools
  • sudo
  • sysfsutils
  • trousers
  • xfsprogs

core-base

  • aosc-aaa
  • bash
  • gcc-runtime
  • zlib

debug-base

  • cgdb
  • gdb
  • strace
  • valgrind

devel-base

  • autoconf
  • automake
  • binutils
  • bison
  • cmake
  • diffutils
  • flex
  • gawk
  • gcc
  • gettext
  • groff
  • help2man
  • libtool
  • m4
  • make
  • meson
  • ninja
  • patch
  • pkg-config
  • sed
  • texinfo

editor-base

  • ed
  • nano

network-base

  • arp-scan
  • bind
  • bluez
  • clash (blocked by Go, no architectural support)
  • dhcp
  • dnsmasq
  • ethtool
  • geoip-api-c
  • iana-etc
  • idnkit
  • inetutils
  • iproute2
  • iptables
  • iw
  • lksctp-tools
  • mtr
  • netcat
  • net-tools
  • nfs-utils
  • nghttp2
  • openssh
  • ppp
  • proxychains-ng
  • rsync
  • shadowsocks-libev
  • v2ray (blocked by Go, no architectural support)
  • wireless-tools
  • wpa-supplicant

python-base

  • pip (blocked by Rust, setuptools-rust)
  • python-2
  • python-3
  • virtualenv

systemd-base

  • modemmanager
  • networkmanager

util-base

  • arch-chroot
  • bat (no working Rust version, see below)
  • bzip2
  • convmv
  • coreutils
  • cpio
  • diffutils
  • dos2unix
  • elfutils
  • expect
  • fd (no working Rust version, see below)
  • file
  • findutils
  • gawk
  • gpm
  • grep
  • groff
  • gzip
  • hdparm
  • htop
  • iotop
  • kbd
  • kmod
  • less
  • libarchive
  • lm-sensors
  • lrzip
  • lsb-release
  • lshw
  • lsof
  • lz4
  • lzip
  • lzo
  • lzop
  • man-db
  • man-pages
  • nano
  • neofetch
  • nethogs
  • newt
  • p7zip
  • patch
  • pciutils
  • procps
  • progress
  • psmisc
  • pv - src/library/getopt.o: ABI is incompatible with that of the selected emulation (worked around)
  • ripgrep (no working Rust version, see below)
  • screen
  • sdparm
  • sed
  • tar
  • texinfo
  • tmux
  • tree
  • unrar
  • unzip
  • usbutils
  • util-linux
  • which
  • xz
  • zip

web-base

  • curl
  • w3m
  • wget

Extra Packages

  • acbsThough
  • autobuild3
  • git

Issues, problem, and errors encountered during this build will be recorded in the comments below.

@Cyanoxygen
Copy link
Author

Cyanoxygen commented Oct 21, 2022

List of partially built packages

  • pkg-config (missing glib, using internal glib)
  • xz (missing po4a, disabling i18nlized docs; disabling RECONF as workaround)
  • python3 (bootstrap stage, drop most BUILDDEPS)
  • ca-certs needs new make-ca script from LFS (now uses SSLDIR to install directly to target dir)
  • gettext: drop glib and libcroco
  • libidn2: disable-gtk-doc
  • python-3: incredibly slow byte code precompiling, not sure whether it's on qemu or py3 - forcibly disabling byte code precompiling to workaround
  • openssh: depends on libfido2 -> libusb -> systemd, using retro DEPs
  • bind: using retro DEPs
  • ijs: drop ghostscript (dependency loop)
  • ghostscript: disable parallel build
  • various other packages used Retro recipes. See git diff.

@MingcongBai
Copy link

Partially built packages and their respective changes are to be recorded in Autobuild3's upcoming stage2 mode configurations, denominated with .stage2 suffixes.

@Cyanoxygen
Copy link
Author

Cyanoxygen commented Oct 21, 2022

pACBS status - might just keep it locally. update is unnecessary.

upper-left: goal: gtk-3
upper-right: valgrind, gdb - blocked by boost
lower-left:
lower-right: boost goal: lvm2

@MingcongBai
Copy link

pACBS status - might just keep it locally. update is unnecessary.

upper-left: python-3 upper-right: swig (finished) lower-left: libedit libevent libidn lower-right: joe (finished)

Yeah I would just leave these details in a local document.

@Cyanoxygen
Copy link
Author

Cyanoxygen commented Oct 21, 2022

DEPs of apt:

  • dpkg

  • zlib

  • bzip2

  • glibc

  • curl

  • gnutls

  • lz4

  • zstd

  • libunistring

  • xxhash

  • python-3: read the first comment for details.

gnome build queue:

doxygen cario gobject-introspection pango (update when build finished)

@MingcongBai MingcongBai changed the title MIPS64R6EL Stage 2 Build Progress AOSC OS MIPS64r6el Stage 2 Build Progress Oct 21, 2022
@MingcongBai MingcongBai changed the title AOSC OS MIPS64r6el Stage 2 Build Progress AOSC OS MIPS64r6el Stage 2 Progress Oct 21, 2022
@MingcongBai
Copy link

ca-certs need a new make-ca script for compatibility with newer Perl.

@Cyanoxygen
Copy link
Author

Cyanoxygen commented Oct 23, 2022

Rust toolchain building progress

This comment tracks the progress of bringing the Rust toolchain to this target.

Stage 1

  • amd64 to mips64r6el cross-build GCC
  • amd64 to mips64r6el cross-build rustc

Stage 2

  • mips64r6el Native Rust toolchain

Stage 3

  • Build with ACBS Tree

@MingcongBai
Copy link

MingcongBai commented Oct 26, 2022

Rust toolchain building progress

This comment tracks the progress of bringing the Rust toolchain to this target.

Stage 1

* [x]  amd64 to mips64r6el cross-build GCC

* [x]  amd64 to mips64r6el cross-build rustc

Stage 2

* [ ]  mips64r6el Native Rust toolchain

Stage 3

* [ ]  Build with ACBS Tree

Skipping Rust fpr stage 2. No usable version.

  1. Last known version according to CIP employees was 1.55.0, "1.56.0 just crashes." No further information provided.
  2. Versions 1.55.0 - 1.59.0 requires backporting Pull Request #90001 from the upstream.
  3. Versions 1.55.0 - 1.56.0 no longer builds due to missing std crate from Cargo registry.
  4. Version 1.55.0 (available from CIP) could not be used to bootstrap >= 1.57.0 due to unsatisfied edition2021 requirement.
  5. Version 1.60.0 would not build with GCC 12.2.0 due to ABI changes in libgcc_s and libstdc++.
  6. Versions 1.61.0 - 1.64.0 cross toolchain (x86_64 => mipsisa64r6el) built successfully, but fails to generate a native toolchain (bootstrap module fails with Code 11 segmentation fault - illegal memory access).

@MingcongBai
Copy link

Adjusting recipes to make leave out all Rust requirements.

@MingcongBai
Copy link

MingcongBai commented Oct 26, 2022

In a conversation with @wzssyqa, who originally ported Rust to MIPS r6.

Mingcong Bai, [2022/10/24 上午8:41]
强哥,我们这里构建 Rust 遇到了一些疑似 codegen 方面的 regression(假设当时 1.55.0 是可用的
[ YunQiang, we have ran into some issues while building Rust. I suspect that it's related to a regression in the codegen (assuming that 1.55.0 was usable. ]

Mingcong Bai, [2022/10/24 上午8:41]
一开始以为是 Qemu user 的问题,但在 system 里也复现了
[ We initially thought that this was a problem with Qemu's user emulation, but we also reproduced this in system. ]

Mingcong Bai, [2022/10/24 上午8:42]
不是很清楚如何调试,所以我们目前准备从 1.55 开始按版本测试,确定下出问题的范围;此外就可能真的需要一些指引了
[ Not sure how to debug this. Therefore, we are going to test each stable release from 1.55.0 to narrow the problem down to a range of versions... Any guidance would be appreciated. ]

YunQiang Su, [2022/10/24 下午4:31]
嗯,当时的版本估计也不行
[ Well, I think that those versions from before never worked. ]

Mingcong Bai, [2022/10/24 下午5:25]
[In reply to YunQiang Su]
从来没能编译过?
[ Like it never worked? ]

YunQiang Su, [2022/10/24 下午5:33]
一直能cross出来,就是运行的确很久了,有问题
[ The cross toolchain always built, but it does have issues during runtime for a long while now. ]

YunQiang Su, [2022/10/24 下午5:33]
但是没深入研究
[ We have yet to look into this further. ]

@MingcongBai
Copy link

Building a full system without Rust is highly problematic, not only do we miss out on any sort of Mozilla support, one key component to our maintenance toolkit - Ciel (written in Rust), will not build.

Since we are building via Qemu user now, we can just use Ciel installed on our AMD64 build hosts.

@MingcongBai
Copy link

Advice from @liushuyu.

子兴 刘, [2022/10/25 下午10:51]
[In reply to Mingcong Bai]
建议检查一下里面的那个 bootstrap 出现了什么问题
因为现在还无法确认是 qemu 还是 LLVM 的问题
[ I'd suggest that we check out what is wrong with the bootstrap module. It's difficult to know whether the issue lies in Qemu or LLVM. ]

子兴 刘, [2022/10/25 下午10:51]
如果确认是 LLVM 的问题,那么需要检查是什么样的代码导致 IR -> 机器码 下降错误
[ If we are sure that it's an issue with LLVM, we need to check what codegen resulted in an error in the IR => machine code. ]

子兴 刘, [2022/10/25 下午10:52]
(如果是 qemu 的问题,一样需要检查是不是 MIPS -> TCG IR -> 机器码 中间,一个或多个环节存在下降错误)
[ If it's a problem with Qemu, we still need to check whether this is due to procedural issues in one or more of the MIPS => TCG => machine code translation. ]

子兴 刘, [2022/10/25 下午10:59]
关于调试的办法:使用支持 mips64r6 的调试器(gdb-multihead 或者 lldb)去连接 qemu 的调试端口(使用 qemu 的 gdb-stub 功能)
然后检查是什么地方出现了段错误
[ As for how to debug - get a mips64r6 debugger (gdb-multihead or lldb) and connect it to Qemu's debugging interface (using Qemu's gdb-stub function). ]

子兴 刘, [2022/10/25 下午11:00]
gdb 可能会无法读取调试符号,因为这个情况下调试过程实际上是 qemu 在代理
gdb 只是在给 qemu 发送调试命令
这个情况下,可以让 gdb 单独从目标二进制(文件)读取调试符号
[ GDB may not be able to read debug symbols, because this process is handled by Qemu. GDB only sends debugger instructions to Qemu. In this case, we can make GDB read the debug symbols from standalone target binary files. ]

@MingcongBai
Copy link

@liushuyu May help debugging this issue down the line.

@MingcongBai
Copy link

This marks the conclusion to Stage 2.

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

No branches or pull requests

2 participants