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

cargo panics on non-tty envrionment #17

Closed
kenz-gelsoft opened this issue Apr 19, 2023 · 14 comments
Closed

cargo panics on non-tty envrionment #17

kenz-gelsoft opened this issue Apr 19, 2023 · 14 comments

Comments

@kenz-gelsoft
Copy link
Owner

No description provided.

@kenz-gelsoft
Copy link
Owner Author

kenz-gelsoft commented Apr 19, 2023

@kenz-gelsoft
Copy link
Owner Author

https://github.com/sunfishcode/is-terminal/blob/v0.4.0/Cargo.toml#L21

is-terminal 0.4.0 uses rustix 0.36.0

@kenz-gelsoft
Copy link
Owner Author

bytecodealliance/rustix#407

interesting

@kenz-gelsoft
Copy link
Owner Author

rust-lang/cargo#11629

rust-lang/rust#105511

upgrading to 1.68 will fix this

or just upgrade rustix as above PR.

@kenz-gelsoft
Copy link
Owner Author

I set up docker on WSL2.

Try cross-building rust for Haiku.

@kenz-gelsoft
Copy link
Owner Author

I've created fork of nielx/rust and update rustix version with cargo update -p rustix

https://github.com/kenz-gelsoft/rust

@kenz-gelsoft
Copy link
Owner Author

kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ git diff
diff --git a/1.67.0/x86_64/Dockerfile b/1.67.0/x86_64/Dockerfile
index 6e2bbe5..4b6856f 100644
--- a/1.67.0/x86_64/Dockerfile
+++ b/1.67.0/x86_64/Dockerfile
@@ -1,12 +1,12 @@
 FROM docker.io/haiku/cross-compiler:x86_64-r1beta4

-ARG RUST_REV=rust-haiku-1.67.0
-ARG RUST_REPO=https://github.com/nielx/rust
+ARG RUST_REV=haiku-stable
+ARG RUST_REPO=https://github.com/kenz-gelsoft/rust

 RUN mkdir /build

-RUN wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/openssl-1.1.1s-2-x86_64.hpkg -P /build/ && \
-    wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/openssl_devel-1.1.1s-2-x86_64.hpkg -P /build/ && \
+RUN wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/openssl-1.1.1t-1-x86_64.hpkg -P /build/ && \
+    wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/openssl_devel-1.1.1t-1-x86_64.hpkg -P /build/ && \
     wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/curl-7.85.0-2-x86_64.hpkg -P /build/ && \
     wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/curl_devel-7.85.0-2-x86_64.hpkg -P /build/ && \
     wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/nghttp2-1.43.0-1-x86_64.hpkg -P /build/ && \

@kenz-gelsoft
Copy link
Owner Author

I skimmed HaikuPorter guide

https://github.com/haikuports/haikuports/wiki/A-Gentle-Introduction-to-HaikuPorter-%231

will follow to generate .hpkg file

@kenz-gelsoft
Copy link
Owner Author

Dockerfile build of the haiku-rust-builder repo fails repeatedly.

Will try manual build in the container environment.

@kenz-gelsoft
Copy link
Owner Author

kenz-gelsoft commented Apr 21, 2023

kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ git diff
diff --git a/1.67.0/x86_64/Dockerfile b/1.67.0/x86_64/Dockerfile
index 6e2bbe5..946dd31 100644
--- a/1.67.0/x86_64/Dockerfile
+++ b/1.67.0/x86_64/Dockerfile
@@ -1,12 +1,12 @@
 FROM docker.io/haiku/cross-compiler:x86_64-r1beta4

-ARG RUST_REV=rust-haiku-1.67.0
-ARG RUST_REPO=https://github.com/nielx/rust
+ARG RUST_REV=haiku-stable
+ARG RUST_REPO=https://github.com/kenz-gelsoft/rust

 RUN mkdir /build

-RUN wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/openssl-1.1.1s-2-x86_64.hpkg -P /build/ && \
-    wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/openssl_devel-1.1.1s-2-x86_64.hpkg -P /build/ && \
+RUN wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/openssl-1.1.1t-1-x86_64.hpkg -P /build/ && \
+    wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/openssl_devel-1.1.1t-1-x86_64.hpkg -P /build/ && \
     wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/curl-7.85.0-2-x86_64.hpkg -P /build/ && \
     wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/curl_devel-7.85.0-2-x86_64.hpkg -P /build/ && \
     wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/nghttp2-1.43.0-1-x86_64.hpkg -P /build/ && \
@@ -19,11 +19,11 @@ RUN cd /build/ && git clone --depth=1 --branch $RUST_REV --shallow-submodules --

 COPY config.toml /build/rust/

-RUN cd /build/rust/ && \
-    X86_64_UNKNOWN_HAIKU_OPENSSL_LIB_DIR=/system/develop/lib/ \
-    X86_64_UNKNOWN_HAIKU_OPENSSL_INCLUDE_DIR=/system/develop/headers/ \
-    ./x.py -j 8 dist
-
-RUN mkdir /output/ && mv /build/rust/build/dist/* /output && rm -rf /build/
-
-WORKDIR /output/
+#RUN cd /build/rust/ && \
+#    X86_64_UNKNOWN_HAIKU_OPENSSL_LIB_DIR=/system/develop/lib/ \
+#    X86_64_UNKNOWN_HAIKU_OPENSSL_INCLUDE_DIR=/system/develop/headers/ \
+#    ./x.py -j 8 dist
+#
+#RUN mkdir /output/ && mv /build/rust/build/dist/* /output && rm -rf /build/
+#
+#WORKDIR /output/
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker build ./ -t 1_67_0_before_build
[+] Building 40.9s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                              0.0s
 => => transferring dockerfile: 1.70kB                                                                                                                            0.0s
 => [internal] load .dockerignore                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                   0.0s
 => [internal] load metadata for docker.io/haiku/cross-compiler:x86_64-r1beta4                                                                                    1.6s
 => [internal] load build context                                                                                                                                 0.0s
 => => transferring context: 33B                                                                                                                                  0.0s
 => [1/5] FROM docker.io/haiku/cross-compiler:x86_64-r1beta4@sha256:0bd438e8a6e411c510799acdf65ab96839cc28eff484c7e2afb232ab6ca0ad10                              0.0s
 => CACHED [2/5] RUN mkdir /build                                                                                                                                 0.0s
 => CACHED [3/5] RUN wget https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/openssl-1.1.1t-1-x86_64.hpkg -P /build/ &&     wget https://eu.  0.0s
 => CACHED [4/5] RUN cd /build/ && git clone --depth=1 --branch haiku-stable --shallow-submodules --recurse-submodules https://github.com/kenz-gelsoft/rust       0.0s
 => CACHED [5/5] COPY config.toml /build/rust/                                                                                                                    0.0s
 => exporting to image                                                                                                                                           39.3s
 => => exporting layers                                                                                                                                          39.3s
 => => writing image sha256:825e4be43f4d7d2cc41e15214805791ad966cc916a80764a2481695013a42ffd                                                                      0.0s
 => => naming to docker.io/library/1_67_0_before_build                                                                                                            0.0s
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$

image built

kenz@sora:~$ docker image ls
REPOSITORY            TAG       IMAGE ID       CREATED        SIZE
1_67_0_before_build   latest    825e4be43f4d   24 hours ago   2.86GB

@kenz-gelsoft
Copy link
Owner Author

kenz-gelsoft commented Apr 21, 2023

kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker run -it --name build_haiku_rust 1_67_0_before_build
root@2b135a416779:/# cd /build/rust/
root@2b135a416779:/build/rust# export X86_64_UNKNOWN_HAIKU_OPENSSL_LIB_DIR=/system/develop/lib/
root@2b135a416779:/build/rust# export X86_64_UNKNOWN_HAIKU_OPENSSL_INCLUDE_DIR=/system/develop/headers/
root@2b135a416779:/build/rust# ./x.py -j 4 dist

(snip)

   Compiling termize v0.1.1
   Compiling clippy_lints v0.1.67 (/build/rust/src/tools/clippy/clippy_lints)
    Finished release [optimized] target(s) in 1m 34s
Building stage1 tool cargo-clippy (x86_64-unknown-haiku)
    Finished release [optimized] target(s) in 0.14s
Dist clippy-1.67.0-x86_64-unknown-haiku
        finished in 4.240 seconds
Dist llvm-tools-1.67.0-x86_64-unknown-haiku
        finished in 49.422 seconds
Dist rust-dev-1.67.0-x86_64-unknown-haiku
        finished in 72.479 seconds
Dist extended stage1 (x86_64-unknown-haiku)
Dist rust-1.67.0-x86_64-unknown-haiku
        finished in 194.118 seconds
Dist rustc-1.67.0-src
        finished in 83.433 seconds
Build completed successfully in 3:02:10
root@2b135a416779:/build/rust# cd /output/
root@2b135a416779:/output# ls
cargo-1.67.0-x86_64-unknown-haiku.tar.xz            rust-analyzer-1.67.0-x86_64-unknown-haiku.tar.xz     rust-src-1.67.0.tar.xz
clippy-1.67.0-x86_64-unknown-haiku.tar.xz           rust-demangler-1.67.0-x86_64-unknown-haiku.tar.xz    rust-std-1.67.0-wasm32-unknown-unknown.tar.xz
llvm-tools-1.67.0-x86_64-unknown-haiku.tar.xz       rust-dev-1.67.0-x86_64-unknown-haiku.tar.xz          rust-std-1.67.0-x86_64-unknown-haiku.tar.xz
rls-1.67.0-x86_64-unknown-haiku.tar.xz              rust-docs-1.67.0-wasm32-unknown-unknown.tar.xz       rustc-1.67.0-src.tar.xz
rust-1.67.0-x86_64-unknown-haiku.tar.xz             rust-docs-1.67.0-x86_64-unknown-haiku.tar.xz         rustc-1.67.0-x86_64-unknown-haiku.tar.xz
rust-analysis-1.67.0-wasm32-unknown-unknown.tar.xz  rust-docs-json-1.67.0-wasm32-unknown-unknown.tar.xz  rustc-dev-1.67.0-x86_64-unknown-haiku.tar.xz
rust-analysis-1.67.0-x86_64-unknown-haiku.tar.xz    rust-docs-json-1.67.0-x86_64-unknown-haiku.tar.xz    rustfmt-1.67.0-x86_64-unknown-haiku.tar.xz
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/cargo-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 4.52MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-analyzer-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 7.31MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-src-1.67.0.tar.xz .
Successfully copied 2.52MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/clippy-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 2.46MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-demangler-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 494kB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-std-1.67.0-wasm32-unknown-unknown.tar.xz .
Successfully copied 17.8MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/llvm-tools-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 75.7MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-dev-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 96.9MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-std-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 25.6MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rls-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 227kB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-docs-1.67.0-wasm32-unknown-unknown.tar.xz .
Successfully copied 18.1MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rustc-1.67.0-src.tar.xz .
Successfully copied 97.1MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 214MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-docs-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 20.3MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rustc-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 71.5MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-analysis-1.67.0-wasm32-unknown-unknown.tar.xz .
Successfully copied 2.76MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-docs-json-1.67.0-wasm32-unknown-unknown.tar.xz .
Successfully copied 2.8MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rustc-dev-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 165MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-analysis-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 3.44MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rust-docs-json-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 2.9MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ docker cp 2b135a416779:/output/rustfmt-1.67.0-x86_64-unknown-haiku.tar.xz .
Successfully copied 3.01MB to /home/kenz/src/rust-haiku-builder/1.67.0/x86_64/.
kenz@sora:~/src/rust-haiku-builder/1.67.0/x86_64$ ls *.tar.xz
cargo-1.67.0-x86_64-unknown-haiku.tar.xz            rust-analyzer-1.67.0-x86_64-unknown-haiku.tar.xz     rust-src-1.67.0.tar.xz
clippy-1.67.0-x86_64-unknown-haiku.tar.xz           rust-demangler-1.67.0-x86_64-unknown-haiku.tar.xz    rust-std-1.67.0-wasm32-unknown-unknown.tar.xz
llvm-tools-1.67.0-x86_64-unknown-haiku.tar.xz       rust-dev-1.67.0-x86_64-unknown-haiku.tar.xz          rust-std-1.67.0-x86_64-unknown-haiku.tar.xz
rls-1.67.0-x86_64-unknown-haiku.tar.xz              rust-docs-1.67.0-wasm32-unknown-unknown.tar.xz       rustc-1.67.0-src.tar.xz
rust-1.67.0-x86_64-unknown-haiku.tar.xz             rust-docs-1.67.0-x86_64-unknown-haiku.tar.xz         rustc-1.67.0-x86_64-unknown-haiku.tar.xz
rust-analysis-1.67.0-wasm32-unknown-unknown.tar.xz  rust-docs-json-1.67.0-wasm32-unknown-unknown.tar.xz  rustc-dev-1.67.0-x86_64-unknown-haiku.tar.xz
rust-analysis-1.67.0-x86_64-unknown-haiku.tar.xz    rust-docs-json-1.67.0-x86_64-unknown-haiku.tar.xz    rustfmt-1.67.0-x86_64-unknown-haiku.tar.xz

@kenz-gelsoft
Copy link
Owner Author

kenz-gelsoft commented Apr 21, 2023

OK built files can't be uploaded as too large

gelso@sora MINGW64 ~/src/Inari (main)
$ git push
Enumerating objects: 25, done.
Counting objects: 100% (25/25), done.
Delta compression using up to 8 threads
Compressing objects: 100% (24/24), done.
Writing objects: 100% (24/24), 796.39 MiB | 3.52 MiB/s, done.
Total 24 (delta 0), reused 0 (delta 0), pack-reused 0
remote: warning: File cargo_patched_rust/rustc-1.67.0-x86_64-unknown-haiku.tar.xz is 68.22 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File cargo_patched_rust/llvm-tools-1.67.0-x86_64-unknown-haiku.tar.xz is 72.16 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File cargo_patched_rust/rust-dev-1.67.0-x86_64-unknown-haiku.tar.xz is 92.40 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File cargo_patched_rust/rustc-1.67.0-src.tar.xz is 92.59 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: Trace: 3ce2e3c24e79bdef8908cdca232b6b91d8340b28e91abd87b9e6c08838012b3f
remote: error: See https://gh.io/lfs for more information.
remote: error: File cargo_patched_rust/rustc-dev-1.67.0-x86_64-unknown-haiku.tar.xz is 157.76 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File cargo_patched_rust/rust-1.67.0-x86_64-unknown-haiku.tar.xz is 204.08 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To github.com:kenz-gelsoft/Inari.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'github.com:kenz-gelsoft/Inari.git'

@kenz-gelsoft
Copy link
Owner Author

installed in home

~/src/Inari/patched_cargo/cargo-1.67.0-x86_64-unknown-haiku> sh ./install.sh --prefix=/boot/home/ --disable-ldconfig
install: creating uninstall script at /boot/home/lib/rustlib/uninstall.sh
install: installing component 'cargo'

    cargo installed.

~/src/Inari/patched_cargo/cargo-1.67.0-x86_64-unknown-haiku> 

This was referenced Apr 21, 2023
@kenz-gelsoft
Copy link
Owner Author

Official rust_bin package is updated to 1.69

haikuports/haikuports#8490

closing

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

1 participant