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

rust / rustup #67

Closed
rhysforyou opened this issue Nov 13, 2018 · 57 comments
Closed

rust / rustup #67

rhysforyou opened this issue Nov 13, 2018 · 57 comments

Comments

@rhysforyou
Copy link

rhysforyou commented Nov 13, 2018

Not unsurprisingly, Rust doesn't seem to install currently:

Rhyss-iPhone:~# curl https://sh.rustup.rs -sSf | sh
curl: (56) LibreSSL SSL_read: error:06FFF064:digital envelope routines:CRYPTO_internal:bad decrypt, errno 0
rustup: command failed: downloader https://static.rust-lang.org/rustup/dist/i686-unknown-linux-gnu/rustup-init /tmp/tmp.aMfBBO/rustup-init

Mostly reporting here so we can add it to the compatibility table.

@tbodt
Copy link
Member

tbodt commented Nov 13, 2018

That error is fixed in the master branch, but then you get a different one.

@Mnpn Mnpn mentioned this issue Nov 13, 2018
@rhysforyou
Copy link
Author

rhysforyou commented Nov 26, 2018

As of the latest build, here’s what I get when running that command:

Rhyss-iPhone:~# curl https://sh.rustup.rs -sSf | sh
info: downloading installer
sh: can't open /dev/tty: no such file

@tbodt
Copy link
Member

tbodt commented Nov 26, 2018

That error is the same as the one preventing ssh from reading passwords from stdin.

@jasonehines
Copy link

I installed bash and ran the script with -y to get around the tty issue, but it then just crashed the entire app

@tbodt
Copy link
Member

tbodt commented Dec 7, 2018

/dev/tty and segfault issues are fixed, but now it turns out rustup doesn't work on alpine. You'll have to install rust through apk.

@tbodt tbodt closed this as completed Dec 7, 2018
@tbodt
Copy link
Member

tbodt commented Dec 7, 2018

And you can't install rust through apk because they only have 64-bit binaries...

@amanjeev
Copy link

amanjeev commented Dec 9, 2018

@tbodt so rust works or doesn't work? I cannot install it via apk or rustup script. I am asking because you moved the card to "Works". 😄

@tbodt
Copy link
Member

tbodt commented Dec 9, 2018

It doesn’t work and I’m not sure how to make it work. Maybe I should make a new column for that sort of thing?

@amanjeev
Copy link

amanjeev commented Dec 9, 2018

I would vote for a new column with a label like help needed? It might encourage contribution as well as a side effect. What do you think?

@tbodt
Copy link
Member

tbodt commented Dec 9, 2018

I moved it back to Doesn’t Work. Possibilities for getting it to work:

  • Install 32-bit glibc. This requires building it from source.
  • Build rustc from source for 32-bit musl. This is not supported by the rust project.
  • Switch to a Linux distribution that uses glibc, like Ubuntu. This would make the app download 10 times bigger, and require a reinstall to get it if I don’t implement multiple root filesystems first.
  • Make iSH support 64-bit. This would take probably at least 6 months.

@amanjeev
Copy link

amanjeev commented Dec 9, 2018

@tbodt Thank you for the response. I have little experience with system programming like this so I really cannot comment on any of those solutions except that Rust support isn't that urgent so if you have a plan for 64-bit support, I would vote for that instead of anything else.

And if you can plan out and want to farm out some tasks for newbies like me, this could be fun as well. Maybe? 😀

@tbodt
Copy link
Member

tbodt commented Dec 9, 2018

I would love to have more people contributing, but this is not an easy project to contribute to. You’d need to be pretty good at C and Linux to work on it.

@jasonehines
Copy link

Just a heads up, Ubuntu has a minimal version now: https://blog.ubuntu.com/2018/07/09/minimal-ubuntu-released

@tbodt
Copy link
Member

tbodt commented Dec 10, 2018

They don’t seem to have a 32-bit version available for download.

@jasonehines
Copy link

They have 32-bit on this page: https://help.ubuntu.com/l/Installation/MinimalCD

@tbodt
Copy link
Member

tbodt commented Dec 10, 2018

That link gives a 404.

@jasonehines
Copy link

weird, the url got changed when I pasted to github https://help.ubuntu.com/community/Installation/MinimalCD

@tbodt
Copy link
Member

tbodt commented Dec 10, 2018

I found a 32-bit rootfs for Ubuntu Base here: http://cdimage.ubuntu.com/ubuntu-base/releases/18.04/release/

@corbinu
Copy link

corbinu commented Dec 21, 2018

I think once this is merged then a 32bit build for musl shouldn't be to hard: rust-lang/rust#55163

@HomeLH
Copy link

HomeLH commented Apr 25, 2019

I met the same problom when I installed rust on ubuntu 18.04.
But, the following command line works well without arguments -sSf.
curl https://sh.rustup.rs | sh

@kkebo
Copy link
Contributor

kkebo commented May 22, 2019

@corbinu

I think once this is merged then a 32bit build for musl shouldn't be to hard: rust-lang/rust#55163

Rust 1.35.0, which is released on May 24, supports for x86_64-unknown-linux-musl. 🎉

But, i686-unknown-linux-musl is still not supported by rustc and cargo.
https://forge.rust-lang.org/platform-support.html

@62f
Copy link

62f commented Aug 19, 2020

rust-lang/rust#71586 (comment) indicates that [ 0.000000] 17 illegal instruction at 0x56cd15be: 0f fe e1 66 0f df dc 66 is not an iSH bug, despite the existence of both Rust/“rustup” and Cargo .apk packages in Alpine 3.12 since the latter depends on the former, neither will currently run.

@62f 62f mentioned this issue Sep 29, 2020
@tommythorn
Copy link

fwiw cargo from the alpine installation fails on cargo install ripgrep with

15 illegal instruction at 0x56da02f1: 0f fa c6 66 0f 6e ee 0f

@aetha
Copy link

aetha commented Apr 21, 2021

Bump, I'm getting this issue too.

Jigglypuff [~]# cargo install oxipng
Illegal instruction
Jigglypuff [~]# dmesg
52 illegal instruction at 0x56cd4df4: 0f 61 e8 66 0f db ec 66

@baoyachi
Copy link

Any updated?

@DuckyBlender
Copy link

Any updates?

@saagarjha
Copy link
Member

saagarjha commented Oct 11, 2022

0f fa c6 66 0f 6e ee 0f is psubd, and 0f 61 e8 66 0f db ec 66 is punpcklwd. Both have been implemented by @jason-conway and are in the master branch already. Trying to cargo install anything now fails on minss.

@kkebo
Copy link
Contributor

kkebo commented Oct 11, 2022

It seems to work now! Thank you.

image

@saagarjha
Copy link
Member

OK I implemented minss (will put up a PR at some point) and it definitely makes some progress. But something else must be broken because it alternates between segfaulting the mm code and trying to read from a closed file descriptor…

@whitone
Copy link

whitone commented Jan 29, 2023

@KKK669 How did you manage to make it work?

With iSH version 1.2.4 build 444, cargo new whatever && cd whatever && cargo build returns the following errors:

 --> src/main.rs:2:14
  |
2 |     println!("Hello, world!");
  |              ^^^^^^^^^^^^^^^ overflowing in-bounds pointer arithmetic

error: erroneous constant used
 --> src/main.rs:2:14
  |
2 |     println!("Hello, world!");
  |              ^^^^^^^^^^^^^^^ referenced constant has errors
  |
  = note: `#[deny(const_err)]` on by default
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>

error[E0080]: it is undefined behavior to use this value
 --> src/main.rs:1:1
  |
1 | fn main() {
  | ^^^^^^^^^ type validation failed: encountered a dangling reference (going beyond the bounds of its allocation)
  |
  = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error: erroneous constant used
 --> src/main.rs:2:5
  |
2 |     println!("Hello, world!");
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
  |
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
  = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0080]: evaluation of constant value failed

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0080`.

Thank you

It seems to work now! Thank you.

image

@kkebo
Copy link
Contributor

kkebo commented Jan 29, 2023

I upgraded all packages and tested it again, and then I encountered the same errors as you did.

@emkey1
Copy link
Contributor

emkey1 commented Jan 30, 2023

@KKK669 How did you manage to make it work?

With iSH version 1.2.4 build 444, cargo new whatever && cd whatever && cargo build returns the following errors:

 --> src/main.rs:2:14
  |
2 |     println!("Hello, world!");
  |              ^^^^^^^^^^^^^^^ overflowing in-bounds pointer arithmetic

error: erroneous constant used
 --> src/main.rs:2:14
  |
2 |     println!("Hello, world!");
  |              ^^^^^^^^^^^^^^^ referenced constant has errors
  |
  = note: `#[deny(const_err)]` on by default
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>

error[E0080]: it is undefined behavior to use this value
 --> src/main.rs:1:1
  |
1 | fn main() {
  | ^^^^^^^^^ type validation failed: encountered a dangling reference (going beyond the bounds of its allocation)
  |
  = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error: erroneous constant used
 --> src/main.rs:2:5
  |
2 |     println!("Hello, world!");
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
  |
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
  = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0080]: evaluation of constant value failed

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0080`.

Thank you

It seems to work now! Thank you.
image

This is a bug in some versions of Alpine. If you install a 3.16.3 or late Alpine rootfs it should work with the TestFlight version of iSH. The current Appstore version is missing some machine code instructions needed by Rust.

@whitone
Copy link

whitone commented Jan 30, 2023

Thank you, now it works! 🎉

Tested on iSH version 1.2.4 build 445, updating current filesystem using following commands:

echo https://dl-cdn.alpinelinux.org/alpine/v3.16/main > /etc/apk/repositories
echo https://dl-cdn.alpinelinux.org/alpine/v3.16/community >> /etc/apk/repositories
apk update
apk upgrade
apk add cargo

@francoisvignon
Copy link

francoisvignon commented Jan 31, 2023 via email

@tommythorn
Copy link

Well, it's not really fixed until iSH is updated in the App store. The TestFlight is closed so I'm stuck waiting.

@whitone
Copy link

whitone commented Jan 31, 2023

Well, it's not really fixed until iSH is updated in the App store. The TestFlight is closed so I'm stuck waiting.

I installed latest build with AltStore

@tommythorn
Copy link

Doesn't that require a jail broken iPhone? (Which isn't an option for me)

@whitone
Copy link

whitone commented Jan 31, 2023

Doesn't that require a jail broken iPhone? (Which isn't an option for me)

Not at all. Just a PC or a Mac to install AltServer. You can find any info on https://altstore.io

@saagarjha
Copy link
Member

iSH 1.3 is out, which has fixes for this issue. Please try it out and file new issues with what you encounter!

@Sky2hawkZ
Copy link

Running iSH 1.3.2 and have run the commands referenced earlier in the thread, and I’m getting the same errors as @emkey1

However I am running it on my IPad Pro.

@dcrego
Copy link

dcrego commented Feb 28, 2024

Running iSH 1.3.2 and have run the commands referenced earlier in the thread, and I’m getting the same errors as @emkey1

However I am running it on my IPad Pro.

Me too, with iSH 1.3.2. Having the same issue:

@KKK669 How did you manage to make it work?

With iSH version 1.2.4 build 444, cargo new whatever && cd whatever && cargo build returns the following errors:

 --> src/main.rs:2:14
  |
2 |     println!("Hello, world!");
  |              ^^^^^^^^^^^^^^^ overflowing in-bounds pointer arithmetic

error: erroneous constant used
 --> src/main.rs:2:14
  |
2 |     println!("Hello, world!");
  |              ^^^^^^^^^^^^^^^ referenced constant has errors
  |
  = note: `#[deny(const_err)]` on by default
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>

error[E0080]: it is undefined behavior to use this value
 --> src/main.rs:1:1
  |
1 | fn main() {
  | ^^^^^^^^^ type validation failed: encountered a dangling reference (going beyond the bounds of its allocation)
  |
  = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error: erroneous constant used
 --> src/main.rs:2:5
  |
2 |     println!("Hello, world!");
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
  |
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
  = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0080]: evaluation of constant value failed

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0080`.

Thank you

It seems to work now! Thank you.
image

@Ph0enixKM
Copy link

Okay I found it working again 🎉. Here is what you need:

  1. Install the iSH version from TestFlight (not the AppStore one!) I'm currently on 1.3.3 (build 710)
  2. Run the following commands (these are the same that @whitone mentioned):
echo https://dl-cdn.alpinelinux.org/alpine/v3.16/main > /etc/apk/repositories
echo https://dl-cdn.alpinelinux.org/alpine/v3.16/community >> /etc/apk/repositories
apk update
apk upgrade
apk add cargo

@acquitelol
Copy link

acquitelol commented Aug 27, 2024

Does anyone know if it's possible to use Rust on a version newer than 1.60.0 (that's what apk v3.16 contains)? I tried, and any version newer than 1.60.0 (1.64.0, 1.71.0, 1.78.0, 1.80.1) all fail for some reason or another (seemingly failing to get a key from a HashMap when compiling), and even 1.60.0 segfaults with specific crates like regex (on a compatible version), and of course the latest rust version, 1.80.1, fails with Illegal instruction (which makes sense)

I'm also slightly confused because sideloading iSH's builds from Releases via Sideloadly seems to insta-crash the app every time no matter what build I sideload, which is relatively concerning.

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

No branches or pull requests