Skip to content

build: remove unused static library dependencies (sqlite3, openssl, bzip2)#315

Closed
ppenna wants to merge 1 commit into
nanvix/v3.12.3from
enhancement/remove-unused-deps
Closed

build: remove unused static library dependencies (sqlite3, openssl, bzip2)#315
ppenna wants to merge 1 commit into
nanvix/v3.12.3from
enhancement/remove-unused-deps

Conversation

@ppenna

@ppenna ppenna commented Mar 30, 2026

Copy link
Copy Markdown

Summary

Drop sqlite3, openssl, and bzip2 from the Nanvix cross-compilation build. These libraries are unused at runtime and removing them shrinks the final binary significantly (47 MB → ~12 MB).

Changes

  • .nanvix/nanvix.toml: Remove sqlite, openssl, bzip2 from [dependencies]
  • Makefile.nanvix:
    • Remove -lsqlite3 -lssl -lcrypto -lbz2 from LIBS
    • Remove LIBSQLITE3_*, BZIP2_*, LIBSSL, LIBCRYPTO variable definitions
    • Remove --with-openssl from CONFIGURE_OPTS

Split from #314.

…zip2)

Drop sqlite3, openssl, and bzip2 from the Nanvix cross-compilation build:
- Remove from .nanvix/nanvix.toml dependency list
- Remove link flags (-lsqlite3, -lssl, -lcrypto, -lbz2) from LIBS
- Remove LIBSQLITE3_*, BZIP2_*, LIBSSL, LIBCRYPTO variable definitions
- Remove --with-openssl from CONFIGURE_OPTS

These libraries are unused at runtime and removing them shrinks the
final binary significantly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes unused sqlite3/openssl/bzip2 static library dependencies from the Nanvix cross-compilation build configuration to significantly shrink the produced CPython binary.

Changes:

  • Drop sqlite, openssl, and bzip2 from Nanvix dependency manifest.
  • Simplify Makefile.nanvix link/configure settings by removing -lsqlite3 -lssl -lcrypto -lbz2 and associated variables/options.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Makefile.nanvix Removes sqlite/openssl/bzip2 library paths/flags from the Nanvix configure environment and drops --with-openssl.
.nanvix/nanvix.toml Updates Nanvix dependency list to no longer fetch sqlite/openssl/bzip2 via nanvix-zutil.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile.nanvix
Comment on lines 86 to 90
LIBC := $(DOCKER_TOOLCHAIN_PATH)/i686-nanvix/lib/libc.a
LIBM := $(DOCKER_TOOLCHAIN_PATH)/i686-nanvix/lib/libm.a
LIBPOSIX := $(DOCKER_SYSROOT_PATH)/lib/libposix.a
LIBZ := $(DOCKER_SYSROOT_PATH)/lib/libz.a
LIBSQLITE3 := $(DOCKER_SYSROOT_PATH)/lib/libsqlite3.a
LIBSSL := $(DOCKER_SYSROOT_PATH)/lib/libssl.a
LIBCRYPTO := $(DOCKER_SYSROOT_PATH)/lib/libcrypto.a
BUILD_PYTHON := $(DOCKER_TOOLCHAIN_PATH)/bin/python3

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LIBZ is still defined in both the Docker and native toolchain branches, but it’s no longer referenced anywhere in this Makefile (the link flags use -lz directly). Either remove the unused LIBZ assignments, or use $(LIBZ) in LIBS for consistency with LIBC/LIBM/LIBPOSIX and to make the zlib archive choice deterministic.

Copilot uses AI. Check for mistakes.
Comment thread Makefile.nanvix
Comment on lines 132 to 137
LDFLAGS="-T$(SYSROOT_PATH)/lib/user.ld -Wl,--allow-multiple-definition -Wl,-pie -Wl,--export-dynamic -Wl,--no-dynamic-linker" \
LIBS="-Wl,--start-group $(LIBPOSIX) $(LIBC) $(LIBM) -lsqlite3 -lssl -lcrypto -lz -lbz2 -lffi -Wl,--end-group" \
LIBSQLITE3_LIBS="-L$(SYSROOT_PATH)/lib -lsqlite3" \
LIBSQLITE3_CFLAGS="-I$(SYSROOT_PATH)/include" \
LIBS="-Wl,--start-group $(LIBPOSIX) $(LIBC) $(LIBM) -lz -lffi -Wl,--end-group" \
ZLIB_LIBS="-L$(SYSROOT_PATH)/lib -lz" \
ZLIB_CFLAGS="-I$(SYSROOT_PATH)/include" \
BZIP2_LIBS="-L$(SYSROOT_PATH)/lib -lbz2" \
BZIP2_CFLAGS="-I$(SYSROOT_PATH)/include" \
LIBFFI_LIBS="-L$(SYSROOT_PATH)/lib -lffi" \
LIBFFI_CFLAGS="-I$(SYSROOT_PATH)/include"

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Nanvix build documentation is now inconsistent with the build configuration: Makefile.nanvix (header comment) and NANVIX.md still list SQLite/OpenSSL/bzip2 as required dependencies and describe copying libsqlite3.a, libssl.a, libcrypto.a, and libbz2.a into the sysroot, but this change removes them from LIBS/CONFIGURE_OPTS and .nanvix/nanvix.toml. Please update those dependency lists/instructions to match the new minimal dependency set and (if intended) note that ssl, sqlite3, and bz2 modules won’t be built for Nanvix.

Copilot uses AI. Check for mistakes.
@ppenna ppenna self-assigned this Mar 30, 2026
@ppenna

ppenna commented Mar 30, 2026

Copy link
Copy Markdown
Author

This change is invalid.

@ppenna ppenna closed this Mar 30, 2026
@ppenna ppenna deleted the enhancement/remove-unused-deps branch May 1, 2026 21:10
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

Successfully merging this pull request may close these issues.

2 participants