diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8428870bc..261dbfbe9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,7 +45,8 @@ img: cargo binstall --no-confirm --version 1.16.0 just && cargo binstall --no-confirm --version 0.27.0 cbindgen && cargo build --manifest-path installer/Cargo.toml --release && - PODMAN_BUILD=0 REPO_BINARY=1 make ci-img IMG_TAG=$CI_COMMIT_REF_NAME + PODMAN_BUILD=0 REPO_BINARY=1 make ci-img IMG_TAG=$CI_COMMIT_REF_NAME && + ([ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" ] && rm -rf build/img/* || true) artifacts: paths: - build/img/ @@ -56,6 +57,7 @@ img: rules: - if: '$CI_PIPELINE_SOURCE == "push"' when: manual + allow_failure: true - when: never image: name: alpine/git:latest diff --git a/Makefile b/Makefile index 77642b8cf..43dd5c14a 100644 --- a/Makefile +++ b/Makefile @@ -34,9 +34,8 @@ ifeq ($(PODMAN_BUILD),1) else cd cookbook && ./clean.sh -rm -rf cookbook/repo - cargo clean --manifest-path installer/Cargo.toml - cargo clean --manifest-path redoxfs/Cargo.toml - cargo clean --manifest-path relibc/Cargo.toml + $(MAKE) fstools_clean + $(HOST_CARGO) clean --manifest-path relibc/Cargo.toml endif -$(FUMOUNT) $(BUILD)/filesystem/ || true -$(FUMOUNT) /tmp/redox_installer/ || true diff --git a/config/aarch64/ci.toml b/config/aarch64/ci.toml index 0eca1c880..d31d0169a 100644 --- a/config/aarch64/ci.toml +++ b/config/aarch64/ci.toml @@ -53,6 +53,9 @@ orbdata = {} orbital = {} orbterm = {} orbutils = {} +orbutils-background = {} +orbutils-launcher = {} +orbutils-orblogin = {} patch = {} pcre = {} pkgutils = {} diff --git a/config/dev.toml b/config/dev.toml index d9dc01155..c3fa5bf94 100644 --- a/config/dev.toml +++ b/config/dev.toml @@ -11,57 +11,7 @@ prompt = false # Package settings [packages] -acid = {} -autoconf = {} -automake = {} -cargo = {} -crates-io-index = {} -exampled = {} -gcc13 = {} -gdbserver = {} -gnu-binutils = {} -gnu-grep = {} -gnu-make = {} -libffi = {} -libgmp = {} -libiconv = {} -libjpeg = {} -libogg = {} -liborbital = {} -libpng = {} -libsodium = {} -libvorbis = {} -libxml2 = {} -llvm18 = {} -lua54 = {} -mesa = {} -mesa-glu = {} -nasm = {} -ncurses = {} -nghttp2 = {} -openssl1 = {} -orbclient = {} -patch = {} -pcre = {} -pkg-config = {} -resist = {} -ripgrep = {} -rust = {} -sdl-gfx = {} -sdl1 = {} -sdl1-image = {} -sdl1-mixer = {} -sdl1-ttf = {} -sdl2 = {} -sdl2-gears = {} -sdl2-image = {} -sdl2-mixer = {} -sdl2-ttf = {} -sed = {} -strace = {} -terminfo = {} -xz = {} -zlib = {} +dev-redox = {} [[files]] path = "/home/user/test.rs" diff --git a/config/i686/ci.toml b/config/i686/ci.toml index 3d8b7835a..e67944146 100644 --- a/config/i686/ci.toml +++ b/config/i686/ci.toml @@ -33,6 +33,9 @@ orbdata = {} orbital = {} orbterm = {} orbutils = {} +orbutils-background = {} +orbutils-launcher = {} +orbutils-orblogin = {} pkgutils = {} redoxfs = {} relibc = {} diff --git a/config/riscv64gc/ci.toml b/config/riscv64gc/ci.toml index 613f0a94c..45e07aa12 100644 --- a/config/riscv64gc/ci.toml +++ b/config/riscv64gc/ci.toml @@ -16,7 +16,7 @@ coreutils = {} dash = {} diffutils = {} drivers = {} -extrautils = {} +#extrautils = {} # xz fails to build findutils = {} hicolor-icon-theme = {} installer = {} @@ -33,6 +33,9 @@ orbdata = {} orbital = {} orbterm = {} orbutils = {} +orbutils-background = {} +orbutils-launcher = {} +orbutils-orblogin = {} pkgutils = {} redoxfs = {} relibc = {} diff --git a/config/x86_64/ci.toml b/config/x86_64/ci.toml index d5b2a8e75..04ea65ecd 100644 --- a/config/x86_64/ci.toml +++ b/config/x86_64/ci.toml @@ -7,6 +7,17 @@ prompt = false # Package settings [packages] + +# Meta-packages below + +dev-essential = {} +dev-redox = {} +redox-tests = {} +#x11-minimal = { # needs all dependencies added below +#x11-full = {} # needs all dependencies added below + +# Normal packages below + acid = {} #atk = {} # depends on glib which does not build autoconf = {} @@ -130,9 +141,9 @@ orbdata = {} orbital = {} orbterm = {} orbutils = {} -#orbutils-background = {} # needs recipe update -#orbutils-launcher = {} # needs recipe update -#orbutils-orblogin = {} # needs recipe update +orbutils-background = {} +orbutils-launcher = {} +orbutils-orblogin = {} osdemo = {} #pango = {} # undefined references to std::__throw_system_error(int) #pastel = {} # needs crate patches for redox-unix diff --git a/cookbook b/cookbook index 671517b9a..cc58d96c6 160000 --- a/cookbook +++ b/cookbook @@ -1 +1 @@ -Subproject commit 671517b9a4429cbb837f3764de5169e6f4f479ae +Subproject commit cc58d96c6f3747f7d80c9f393db0df24bc17030d diff --git a/installer b/installer index 5758ba854..01a3adb66 160000 --- a/installer +++ b/installer @@ -1 +1 @@ -Subproject commit 5758ba854a84f246ebc3fcb2ab7abac11af3b85c +Subproject commit 01a3adb66269648732dbb8e130130d8ca2d3e23f diff --git a/mk/config.mk b/mk/config.mk index 7c0cc320a..121e80577 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -19,6 +19,8 @@ CONFIG_NAME?=desktop REPO_NONSTOP?=0 ## Do not update source repos, attempt to build in offline condition REPO_OFFLINE?=0 +## Do not strip debug info for local build +REPO_DEBUG?=0 ## Select filesystem config ifeq ($(BOARD),) FILESYSTEM_CONFIG?=config/$(ARCH)/$(CONFIG_NAME).toml @@ -67,6 +69,10 @@ ifeq ($(REPO_OFFLINE),1) else ifeq ($(REPO_OFFLINE),0) REPO_OFFLINE= endif +ifeq ($(REPO_DEBUG),1) + export COOKBOOK_NOSTRIP=true + export COOKBOOK_DEBUG=true +endif UNAME := $(shell uname) ifeq ($(UNAME),Darwin) diff --git a/mk/podman.mk b/mk/podman.mk index 4560d3f45..c929025a3 100644 --- a/mk/podman.mk +++ b/mk/podman.mk @@ -70,3 +70,18 @@ ifeq ($(PODMAN_BUILD),1) else @echo PODMAN_BUILD=$(PODMAN_BUILD), container not required. endif + +KERNEL_PATH := cookbook/recipes/core/kernel +KERNEL_PATH_SOURCE := $(ROOT)/$(KERNEL_PATH)/source +KERNEL_PATH_TARGET := $(ROOT)/$(KERNEL_PATH)/target/$(TARGET) + +# TODO: make this work using `make debug.kernel` and remove this +kernel_debugger: + @echo "Building and running gdbgui container..." + podman build -t redox-kernel-debug - < $(ROOT)/podman/redox-gdb-containerfile + podman run --rm -p 5000:5000 -it --name redox-gdb \ + -v "$(KERNEL_PATH_TARGET)/build/kernel.sym:/kernel.sym" \ + -v "$(KERNEL_PATH_SOURCE)/src:/src" \ + redox-kernel-debug --gdb-cmd "gdb -ex 'set confirm off' \ + -ex 'add-symbol-file /kernel.sym' \ + -ex 'target remote host.containers.internal:1234'" diff --git a/mk/qemu.mk b/mk/qemu.mk index d4466cb6c..88611c87b 100644 --- a/mk/qemu.mk +++ b/mk/qemu.mk @@ -25,6 +25,7 @@ else ifeq ($(ARCH),x86_64) QEMU_MEM?=2048 ifeq ($(uefi),yes) FIRMWARE=$(firstword \ + $(wildcard /usr/share/ovmf/OVMF.fd) \ $(wildcard /usr/share/OVMF/OVMF_CODE.fd) \ ) ifeq ($(FIRMWARE),) @@ -79,6 +80,11 @@ else ifeq ($(ARCH),aarch64) QEMUFLAGS+=-device qemu-xhci -device usb-kbd -device usb-tablet endif endif + + # Default to using HVF when host is MacOS Silicon + ifeq ($(HOST_ARCH),arm64) + kvm?=yes + endif else ifeq ($(ARCH),riscv64gc) live=no efi=yes @@ -176,6 +182,7 @@ else EXTRANETARGS= ifeq ($(netboot),yes) EXTRANETARGS+=,tftp=$(BUILD),bootfile=redox.ipxe + QEMUFLAGS+=-kernel /usr/lib/ipxe/ipxe-amd64.efi endif ifneq ($(bridge),) @@ -241,7 +248,11 @@ ifeq ($(UNAME),Linux) endif ifeq ($(UNAME),Darwin) - QEMUFLAGS+=-cpu $(QEMU_CPU) + ifneq ($(kvm),no) + QEMUFLAGS+=-accel hvf -cpu max + else + QEMUFLAGS+=-cpu $(QEMU_CPU) + endif endif ifneq ($(PFLASH0),) diff --git a/mk/repo.mk b/mk/repo.mk index afa295a70..d8f232d81 100644 --- a/mk/repo.mk +++ b/mk/repo.mk @@ -21,7 +21,7 @@ else export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \ PACKAGES="$$($(LIST_PACKAGES) $(LIST_PACKAGES_OPTS) -c $(FILESYSTEM_CONFIG))" && \ cd cookbook && \ - ./repo.sh $(REPO_NONSTOP) $(REPO_OFFLINE) "$${PACKAGES}" + ./repo.sh $(REPO_NONSTOP) $(REPO_OFFLINE) --with-package-deps "$${PACKAGES}" mkdir -p $(BUILD) # make sure fstools.tag and fetch.tag are newer than the things repo modifies touch $(FSTOOLS_TAG) @@ -105,7 +105,7 @@ endif # Invoke clean.sh, and repo.sh for one of more targets separated by comma cr.%: $(FSTOOLS_TAG) FORCE ifeq ($(PODMAN_BUILD),1) - $(PODMAN_RUN) $(MAKE) $@ + $(PODMAN_RUN) make $@ else $(MAKE) c.$* $(MAKE) r.$* @@ -114,7 +114,7 @@ endif # Invoke unfetch.sh, clean.sh, and repo.sh for one or more targets separated by comma ucr.%: $(FSTOOLS_TAG) FORCE ifeq ($(PODMAN_BUILD),1) - $(PODMAN_RUN) $(MAKE) $@ + $(PODMAN_RUN) make $@ else $(MAKE) u.$* $(MAKE) cr.$* @@ -123,7 +123,7 @@ endif # Invoke unfetch.sh and clean.sh for one or more targets separated by comma uc.%: $(FSTOOLS_TAG) FORCE ifeq ($(PODMAN_BUILD),1) - $(PODMAN_RUN) $(MAKE) $@ + $(PODMAN_RUN) make $@ else $(MAKE) u.$* $(MAKE) c.$* @@ -132,8 +132,29 @@ endif # Invoke unfetch, clean.sh and fetch.sh for one or more targets separated by comma ucf.%: $(FSTOOLS_TAG) FORCE ifeq ($(PODMAN_BUILD),1) - $(PODMAN_RUN) $(MAKE) $@ + $(PODMAN_RUN) make $@ else $(MAKE) uc.$* $(MAKE) f.$* endif + + +export DEBUG_BIN?= + +# Debug a recipe with gdbgui inside podman, for example: debug.drivers-initfs DEBUG_BIN=pcid +# Please set REPO_DEBUG=1 to your .config to enable debug symbols and run `make cr.recipe rebuild` +# Also, before opening gdbgui at http://localhost:5000, start qemu with `make qemu gdb=yes` +# Experimental and may not work if ARCH is different with what podman is running +debug.%: $(FSTOOLS_TAG) FORCE + @cd cookbook/$(shell make find.$* | grep ^recipes) && \ + export RECIPE_STAGE=target/$(TARGET)/stage && \ + export BIN_PATH=$$(find $$RECIPE_STAGE -type f -name "$(DEBUG_BIN)" -or -type f -name "$*") && \ + file $$BIN_PATH 2> /dev/null || ( echo "Binary is not found, please set DEBUG_BIN" && exit 1 ) && \ + echo "Opening gdbgui for debugging $* with binary '$$BIN_PATH'" && echo "----------" && \ + podman build -t redox-kernel-debug - < $(ROOT)/podman/redox-gdb-containerfile > /dev/null && \ + podman run --rm -p 5000:5000 -it --name redox-gdb \ + -v "./$$BIN_PATH:/binary" \ + -v "./source:/source" -w "/source" \ + redox-kernel-debug --gdb-cmd "gdb -ex 'set confirm off' \ + -ex 'add-symbol-file /binary' \ + -ex 'target remote host.containers.internal:1234'" diff --git a/podman/redox-base-containerfile b/podman/redox-base-containerfile index 326e79c5a..cee4a38f9 100644 --- a/podman/redox-base-containerfile +++ b/podman/redox-base-containerfile @@ -1,9 +1,9 @@ # Configuration file to install the recipe dependencies inside the Podman container -FROM debian:stable-backports +FROM debian:trixie RUN apt-get update \ - && apt-get install -y --no-install-recommends -t stable-backports \ + && apt-get install -y --no-install-recommends \ ant \ appstream \ appstream-compose \ diff --git a/podman/redox-gdb-containerfile b/podman/redox-gdb-containerfile new file mode 100644 index 000000000..90efb0a7d --- /dev/null +++ b/podman/redox-gdb-containerfile @@ -0,0 +1,15 @@ +FROM debian:stable-backports + +RUN apt-get update \ + && apt-get install -y --no-install-recommends -t stable-backports \ + python3 \ + python3-pip \ + gdb \ + curl \ + && rm -rf /var/lib/apt/lists/* + +RUN pip3 install gdbgui --break-system-packages + +EXPOSE 5000 + +ENTRYPOINT [ "gdbgui", "--remote", "--port", "5000" ] diff --git a/relibc b/relibc index 9e1ff3185..f170902a2 160000 --- a/relibc +++ b/relibc @@ -1 +1 @@ -Subproject commit 9e1ff3185e407506661d65081ec6152d71a8298a +Subproject commit f170902a29f0b7c10cc2bce087c8b6f0d9478d9d