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

Error using curl inside stage1 #2

Closed
sepen opened this issue Oct 25, 2022 · 1 comment
Closed

Error using curl inside stage1 #2

sepen opened this issue Oct 25, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sepen
Copy link
Member

sepen commented Oct 25, 2022

At the current point, stage1 uses curl to download the sources on each port build. This is correct since we have included curl and openssl in the list of stage0 ports.
This worked fine until we redo openssl in stage1. In this moment, curl is still pointing to the old openssl library version (since the curl binary was compiled on stage0, against the host) so it needs to be rebuilt against new libs.

[2022-10-24 11:58:07] Building port: /workspace/ports/core/cpio
=======> Downloading 'https://ftpmirror.gnu.org/gnu/cpio/cpio-2.13.tar.bz2'.
curl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
=======> ERROR: Downloading 'https://ftpmirror.gnu.org/gnu/cpio/cpio-2.13.tar.bz2' failed.
make: *** [Makefile:259: /workspace/packages.stage1.tar.xz] Error 1

note: the first to fail is cpio, since it is the first port after redoing openssl that needs to download sources (that we haven't downloaded before)

There are several ways to fix this.

  • One could be that we overlay curl and add openssl to it as a library, which it is. With this we would achieve that after redoing openssl curl would be redone, so the binary would be usable again. But we can do all this since the source was downloaded in stage0 (If to build the curl port, we had to call the curl command to download the code, it would continue to give an error)
  • Another option would be to use some hack or workaround. For example having a symlink to the old openssl lib, or providing a static curl in /workspace/bin/curl, but these all seem like dirty stuff.
  • The option that I like the most and that we have already tried at the time is to add a target to the Makefile before entering the chroot so that all the sources are iteratively downloaded and therefore we do not depend on curl within stage1. This way we could once again leave curl and openssl out of the stage0 ports list. This has been used but it would be necessary to test that everything is relinked correctly in stage1.
@sepen sepen added the bug Something isn't working label Oct 25, 2022
@sepen sepen self-assigned this Oct 25, 2022
@sepen
Copy link
Member Author

sepen commented Oct 25, 2022

I tried last option commented above and it's is working fine for now

[2022-10-25 14:30:58] Running Stage 1
make stage1 2>&1 | tee stage1.log
make[1]: Entering directory '/sdcard/home/sepen/devel/crux-arm/crux-arm-release'
[2022-10-25 14:30:58] Preparing chroot environment (/sdcard/home/sepen/devel/crux-arm/crux-arm-release/rootfs-stage1)
make prepare-stage1-rootfs
make[2]: Entering directory '/sdcard/home/sepen/devel/crux-arm/crux-arm-release'
[2022-10-25 14:30:58] Creating /sdcard/home/sepen/devel/crux-arm/crux-arm-release/rootfs-stage1
[2022-10-25 14:30:58] Decompressing /sdcard/home/sepen/devel/crux-arm/crux-arm-release/rootfs.tar.xz to /sdcard/home/sepen/devel/crux-arm/crux-arm-release/rootfs-stage1
[2022-10-25 14:32:20] Installing extras
make[2]: Leaving directory '/sdcard/home/sepen/devel/crux-arm/crux-arm-release'
make download-stage1-sources
make[2]: Entering directory '/sdcard/home/sepen/devel/crux-arm/crux-arm-release'
[2022-10-25 14:32:24] Preparing /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports.stage1
[2022-10-25 14:32:32] Downloading port sources
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/attr
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/autoconf
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core-arm/libgmp
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/ncurses
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/db
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/libnsl
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/libtirpc
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/zlib
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/flex
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/bzip2
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/ca-certificates
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/libnghttp2
[2022-10-25 14:32:32] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core-arm/openssl
[2022-10-25 14:32:33] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/xz
[2022-10-25 14:32:33] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/expat
[2022-10-25 14:32:33] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/lzo
[2022-10-25 14:32:33] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/linux-pam
[2022-10-25 14:32:33] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/cpio
=======> Downloading 'https://ftpmirror.gnu.org/gnu/cpio/cpio-2.13.tar.bz2'.
[2022-10-25 14:32:45] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/dash
[2022-10-25 14:32:45] - port: /sdcard/home/sepen/devel/crux-arm/crux-arm-release/ports/core/dcron
=======> Downloading 'http://www.jimpryor.net/linux/releases/dcron-4.5.tar.gz'.
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: DONE
Development

No branches or pull requests

1 participant