Issues installing Rust GNU binary

Hi, I'm attempting to install the Rust GNU binary on a webserver (rust-1.74.0-x86_64-unknown-linux-gnu) and getting an error running

rust-1.74.0-x86_64-unknown-linux-gnu[528]$ ./
./ line 899: CFG_COMPONENTS: unbound variable

To me it looks like a bash error?

This is the bash version: GNU bash, version 5.2.15(1)-release (sparc-sun-solaris2.11)

The server OS is Oracle Solaris 11.4

Unfortunately there is no way I can install through any other means due to org restrictions

what is this script? where did you get it from? what was it supposed to do?

I'm running it from the unzipped tarball

rust-1.74.0-x86_64-unknown-linux-gnu[539]$ ls
COPYRIGHT                               git-commit-info                         rust-docs-json-preview
LICENSE-APACHE                                              rust-installer-version
LICENSE-MIT                             llvm-tools-preview                      rust-std-x86_64-unknown-linux-gnu                               rls-preview                             rustc
cargo                                   rust-analysis-x86_64-unknown-linux-gnu  rustfmt-preview
clippy-preview                          rust-analyzer-preview                   version
components                              rust-demangler-preview
git-commit-hash                         rust-docs


the script should work fine on Linux. see comment below.

original reply:

just took a look of the script, this error message should is probably a typo. the variable CFG_COMPONENTS and CFG_WITHOUT are intended for the user to manually pick which components to include or to exclude, but at line 4, there's command

set -u

which makes bash throw error when a undefined variable is used. I guess at line 899 and line 916, what they really meant was:

-if [ -n "$CFG_COMPONENTS" ]; then
+if [ -n "${CFG_COMPONENTS-}" ]; then

-if [ -n "$CFG_WITHOUT" ]; then
+if [ -n "${CFG_WITHOUT-}" ]; then

you can edit these two lines, or you can simply comment out line 4.

but I don't think you really need to "install" anything, just untar it and edit your $PATH environment variable and you are good to go. you might want to set CARGO_HOME if you have custom configuration, but other than that, the tools (rustc, rustfmt, rustdoc, cargo, etc), should just work.

If server is Solaris and not Linux then why are you trying to install Linux build?

Solaris is Tier 2 without Host Tools, which means that you may cross-compiler for it, but rustc itself may or may not work on Solaris.

And you would need to build it from sources, in any case.

I'll make a report. Thanks. Yeah, I haven't found anything over many hours of digging as my use case is ridiculously specific. Absolutely nothing found.

I'm just experimenting. I really couldn't find the correct binary. I actually just need it to so I can install a python wheel that's having a problem without a Rust compiler on the same server (and that too has no solution).

Is there another binary you would recommend or do I really need to look into cross compiling? At least for my case, I don't actually need the language for now, just need it to compile a python wheel for another library.

And they are set in line 174 to some value (possibly empty). Thus it should work fine.

At least if you run it on Linux.

You couldn't find it for one simple, yet important reason: it doesn't exist!

You would need to ask someone more knowledgeable about Python and Solaris to answer that question.

I guess you may try to cross-compiler the library that said wheel needs but I have no idea whether cross-compilation would be simpler or more complicated than rustc cross-compilation.

On one hand said sheel is, most likely, much smaller library than the whole Rust compiler.

On the other hand chances that someone was thinking about cross-compilation for an exotic platform are far from being 100%.

oof, that's such a rare use case for a niche OS. may I guess it's pydentic-core? there's earlier thread for raspberry PI. I guess if you are lucky, you can try to use a docker container to build it. otherwise, it might be really complex process to setup the cross compiling toolchain and dependencies, and the python libraries, etc.


good catch, I didn't even notice the OS is Solaris.

Yep, it has been quite an adventure just trying to get this installation going. I'll ask the devs of the library. Thanks for the assistance. At least this post will help a few people who want to install the tarball on the correct platform aha

It's called Maturin

Unfortunately everything in my org is ridiculously specific for this case but I am quite used to it now.

oh, I see, thanks for pointing out. I didn't read through the entire script, just did a quick grep and thought it was meant to be set externally by the user, I didn't read the optval function.

just checked it out. from what I have read, I think it's possible just build it natively and use the tool itself to (bootstrap) cross-compile to solaris, if you really need to run it on the target server. if you only need to use it as a build tool, I don't think you need to install it on the target at all.

and it seems Solaris is supported:

Thanks for the assistance. I hadn't thought of doing it this way. Appreciate it :slight_smile:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.