How can I download Rust API docs? - rust

Is there a way I can download the API library docs for Rust or generate them? The only docs I can find in the Rust source are in src/docs.
I'm running the nightly build, so I'm sure there's a way to generate all the docs in the same fashion as the standard docs using rustdoc, I just can't find it!
I'm running Linux, with the nightly build, using this command:
curl -s https://static.rust-lang.org/rustup.sh | sudo sh

Rustup
If you use rustup, the recommended way to install and update Rust, then the docs may already be installed; the default installation behavior has changed over time. Try running rustup doc to open them in your browser.
If they aren't already installed, you can download the docs by running rustup component add rust-docs.
By default, rustup doc opens the documentation front page, but you can add --std to jump straight to the standard API docs or --book for The Rust Programming Language. You can also use rustup doc std::iter::Iterator to open the documentation of a specific item.
rustup 1.20 learned the concept of profiles. These allow you to default to having docs installed for a toolchain (via the default profile) or not (via the minimal profile).
Standalone Rust Installer
The Rust installer also installs the documentation for the language and for Cargo. On Linux systems, it can be found at /usr/local/share/doc/{rust,cargo}.

Another way to have the Rust docs (and a few others from languages to frameworks to CLI tools) for offline use is to install Zeal for Linux or Dash for OS X and download Rust's documentation from there.

If you're running Arch, install rust-docs and navigate to file:///usr/share/doc/rust/html/index.html.

I recommend adding a link to file:///usr/local/share/doc/rust/html/index.html in your browser/desktops bookmarks.

Related

error[E0463]: can't find crate for `core` / note: the `wasm32-unknown-unknown` target may not be installed [NEAR Protocol]

I see this error in the Terminal while building a Rust application (which happens to be about NEAR Protocol, if you're curious):
error[E0463]: can't find crate for core
note: the "wasm32-unknown-unknown" target may not be installed
How can I fix it so that Rust will actually build my NEAR app?
To solve this error, run:
rustup target add wasm32-unknown-unknown
in the terminal, and that should correct the issue.
Note: I'm simply posting here as an answer what the original question asker Dorian Crutcher already wrote within their question. But that suggestion did work for me too.
I had the same problem, its reason is in an out-of-date version of Rust, the solution was to update the Rust to the latest version.
I got a similar error while trying to install universal builds of py38-cryptography via Macports on Mac OS 12.1 with an M1 Max chip.:
:info:build error[E0463]: can't find crate for `core`
:info:build |
:info:build = note: the `x86_64-apple-darwin` target may not be installed
Rebuilding Macports' installed version of rust as universal works:
sudo port install rust +universal
For future readers (mostly myself) who run into this issue, there's another important factor that could be causing this error or similar errors which is extremely hard to realize: conflicting versions of Rust and/or Cargo. This means it persists even after running rustup target add wasm32-unknown-unknown.
In my case, I had rust installed from brew and rustup at the same time, which was causing a bunch of confusion and clashes. You should make sure you have Rust installed exclusively from rustup. Double check every package manager you have on your system, because rust may have been installed as a dependency of another package, such as through cargo-nextest in my case. Such packages should be uninstalled and managed instead through cargo itself, and thus kept under the purview of rustup.
I also ran into this problem for a different reason. I had explicitly specified the version of nightly compiler to rustup as version nightly-YYYY-MM-DD, but inside a toolchain file, I only specified nightly which I suspect refers to the latest nightly for which core, among many other things, was indeed not installed.
May be somebody will help, ubuntu 20.04, just randomly found solution of next error:
error[E0463]: can't find crate for core
Run in terminal, rustup target add wasm32-unknown-unknown

Is it possible to use cmake without any compiler

We have a project made of python scripts and home-made tools. We use cmake with custom targets to handle the application of the tools and python sripts and install resulting binary resources.
We use this under GNU/Linux and MS Windows. It works well but we don't want to force our users to install a compiler, like Visual Studio under Windows.
So, is it possible to install and run cmake without any compiler ? We can use ninja as the build system.
Yes, its possible.
CMake's project() command takes a NONE parameter (no compiler/languages searched for or activated)
project(MyProject NONE)
CMake's -P script mode if you want to take CMake as a cross-platform scripting environment

Cygwin - Installing a specific package version using the commandline installer

Using the commandline installer, one can easily install Cygwin with a list of wanted packages like so
setup-x86.exe -q -p='tar,sed,<more packages>'
Is it also possible to fix the version of the packages, something like
setup-x86.exe -q -p='tar:1.2.3,sed,<more packages>'
(this obviously doesn't work)?
The short answer to your query is, No. Cygwin's setup -x86.exe does not give you the flexibility to specify version names along with package names. As per the official doc :
The basic reason for not having a more full-featured package manager is that such a program would need full access to all of Cygwin's POSIX functionality. That is, however, difficult to provide in a Cygwin-free environment, such as exists on first installation. Additionally, Windows does not easily allow overwriting of in-use executables so installing a new version of the Cygwin DLL while a package manager is using the DLL is problematic
There are however a couple of workarounds if you want to download a specific package:
Locate a cygwin mirror that hosts the specific version. Google for your version, and if you find a mirror hosting that version, simply use that mirror before running setup -x86.exe. [source]
Maintain a local pacakge repository and use the commandline options -q -L -l x:\cygwin-local\, where your downloaded package tree is in x:\cygwin-local\ [source] . You can learn how to build and maitain packages here
Compile and install the package after you've set up cygwin using make.
This is function that Cygwin's installer now provides. By default, when running from the command line, it will install the latest version of each package, but you can specify a version with =. For example:
setup-x86_64.exe -P git=2.35.0-1,vim
will install the latest version of Vim, and version 2.35.0-1 of Git.

adding Doxygen plugin to qtcreator in linux

I want to add Doxygen plugin to QtCreator.
I am using QtCreator 2.5.2 in ubuntu 12.10 and the latest Doxygen version for QT is 2.4.0.
I've changed the doxygen.pluginspec file to get rid of version error.
But now I've got another error:
can not load library libdoxygen.so (libQtconcurrent.so can not open shared object file:No such file or directory)
Any suggestion would be appreciated.
I hope you are no longer stuck, but if not, I will still try to help.
Yes, the quick install binaries are available only for QtCreator 2.4, but the plugin stays easy to install without it : you have to download the sources and build them yourself, as written in the wiki.
Moreover, you have to build it with the same version of Qt4 as the one that was used for build your QtCreator (have a look here)
It became compatible with QtCreator 2.7 and Qt5 at the end of March, and I succeeded in installing in in QtCreator2.8-beta.
If you have any other question, I guess it would be better to ask them in the plugin forum where developpers always answer to people in need.
Hope this helps (you and other people in need).
You can install Doxywizard wich provides an user interface to use Doxygen.
I'm not shure I'm using fedora to install I used.
yum install doxygen-doxywizard.x86_64.
For Ubuntu it should be if the package name is the same.
apt-get install doxygen-doxywizard.x86_64
(as root)

Node JS ./configure + make fails unable to remap python lib-dynload/itertools.dll to same address as parent

This might be more of a CYGWIN question than a Nodejs but here goes.
I installed Cygwin yesterday and on the packages selection I just clicked next as it looked like most were pre-selected, and then today read this guide http://boxysystems.com/index.php/step-by-step-instructions-to-install-nodejs-on-windows/ on installing nodejs.
The ./configure had an error that it was unable to remap python lib-dynload/itertools.dll to same address as parent. As the process still completed I tried the make command, but it fails on the same error.
So, I opened cygwin setup.exe and this time I clicked the source checkbox for all the Python packages. But still get the same error. Should I now go to Cygwin and check all the source packages for the Make packages, delete it and reinstall from scratch using the above guide. Or something else?
Any help gratefull received/
Use the official 0.5.x windows build from http://nodejs.org/#download - you just have to download a .exe file and you can start it.
Versions 0.5.X have problems with Cygwin and because of developing clean Windows version Cygwin environment is now unsupported. Stable version 0.4.12 builds on Cygwin with no problems. If you want to use node.js unstable 0.5.X branch on Windows use windows build at official node.js site.
check this out:
https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)
Update Sept 1, 2011 -- as of today, v0.5.5 does not build on Cygwin (errors on make). Use v.0.5.4 (ie. follow instructions below and use "git checkout v0.5.4".
https://github.com/joyent/node/wiki/API-changes-between-v0.4-and-v0.6
Cygwin build is no longer supported. Use native windows builds instead.

Resources