Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

Trick Portage into having installed Rust

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
Author
Message
EliasJonsson
n00b
n00b
User avatar
Posts: 53
Joined: Wed Oct 18, 2017 12:32 pm

Trick Portage into having installed Rust

  • Quote

Post by EliasJonsson » Mon Oct 25, 2021 5:15 am

I own a Raspberry Pi 4, 4GB RAM. 4 GB RAM isn't enough in order to compile the Rust package. Although, It is possible to just run

Code: Select all

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
and have Rust installed.

Is it possible to somehow tell Portage that the rust package already is installed so that other things that depends on Rust package can be installed?
Top
irets
Apprentice
Apprentice
User avatar
Posts: 241
Joined: Tue Dec 17, 2019 12:57 pm

  • Quote

Post by irets » Mon Oct 25, 2021 6:27 am

If for some reason you cannot compile it, Rust also exists in binary form.
https://packages.gentoo.org/packages/dev-lang/rust-bin
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

  • Quote

Post by mike155 » Mon Oct 25, 2021 1:42 pm

Is it possible to somehow tell Portage that the rust package already is installed so that other things that depends on Rust package can be installed?

Code: Select all

/etc/portage/profile/package.provided
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

  • Quote

Post by mike155 » Mon Oct 25, 2021 1:46 pm

Code: Select all

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Oops... Never download anything from the internet and execute it without looking at it... Especially not as root... That's the road to hell!
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Mon Oct 25, 2021 3:49 pm

mike155 wrote:
EliasJonsson wrote:

Code: Select all

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Oops... Never download anything from the internet and execute it without looking at it... Especially not as root... That's the road to hell!
Indeed. From a purely academic standpoint, I wonder what OP installed with that command. Since he didn't save the text of what was fed to sh, nor run sh with -x, we'll never really know what commands were executed. At best, we can hope that he got a complete copy of whatever that host is serving today, and that such copy is safe. This is why curlpipesh is always the wrong solution, no matter what problem is under discussion. If it had been served with an emulation of something like subresource integrity, there would be a a bit of a trail. For example (not working, since the server doesn't support this, but in principle it could):

Code: Select all

(expected_sha256sum=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ; set -euo pipefail; local_install_script="$(mktemp --tmpdir curlpipesh-rustup.sh.XXXXXX)"; curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://sh.rustup.rs/curlpipesh/$expected_sha256sum/install.sh -o "$local_install_script"; printf '%s  /dev/fd/3\n' "$expected_sha256sum" | sha256sum --quiet --strict --check - 3< "$local_install_script"; /bin/sh < "$local_install_script"; rm "$local_install_script")
Explained:
  • Record the expected checksum once, right at the top, for easy maintenance.
  • Enable some safety options.
  • Create a temporary file in which to save the downloaded script. This will be needed since we want to make two passes over it, and control flow requirements preclude using tee.
  • Download the script to the temporary file, using the same curl invocation that Rust recommends for their curlpipesh (but with some parameters spelled out for easier reading). Notably, this fragment uses a (currently fictitious, but reasonable) path on the server to tell the server what script it expects, so that the server can provide an appropriate document. This could be omitted if you want the fragment to just fail outright whenever the server document changes.
  • Run sha256sum to check the downloaded file against what it should be. Due to --check on sha256sum and set -e on the shell, a failed verification at this step will abort, and none of the later steps in my example will run.
  • Run the script. Notably, this preserve's upstream's questionable decision not to set -euo pipefail.
  • Delete the temporary file.
Top
Zucca
Administrator
Administrator
User avatar
Posts: 4710
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

  • Quote

Post by Zucca » Mon Oct 25, 2021 5:49 pm

At least the command has --tlsv1.2, but doing curlpipesh is bad.
As mentioned above, use rust-bin then instead if you cannot compile rust.
..: Zucca :..

Code: Select all

0100100100100000011000010110110100100000
0100111001100001010011100010000100100000
0100100100100000011000010110110100100000
0110000100100000011011010110000101101110
00100001
Top
EliasJonsson
n00b
n00b
User avatar
Posts: 53
Joined: Wed Oct 18, 2017 12:32 pm

  • Quote

Post by EliasJonsson » Wed Oct 27, 2021 8:51 am

Zucca wrote:At least the command has --tlsv1.2, but doing curlpipesh is bad.
As mentioned above, use rust-bin then instead if you cannot compile rust.
Will do. Thanks for pointing that out!
Top
Post Reply
  • Print view

7 posts • Page 1 of 1

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic