Install modules in other rakudo versions using rakubrew - raku

When upgrading rakudo version using rakubrew, is pretty easy to change versions, but I wnat to know if it is posible to import raku modules from the older version to the new version. doign zef install automatically:
to update:
rakubrew build 2020.10
but then:
❯ raku
Welcome to 𝐑𝐚𝐤𝐮𝐝𝐨™ v2020.10.
Implementing the 𝐑𝐚𝐤𝐮™ programming language v6.d.
Built on MoarVM version 2020.10.
You may want to `zef install Readline` or `zef install Linenoise` or use rlwrap for a line editor
To exit type 'exit' or '^D'
so I need to install all modules that I currently use:
rakubrew build-zef
zef install Sparrow6
zef install Linenoise
so exists any file .zef or .rakubrew or something that checks to maintain this modules automatically

You can get the list of installed modules using zef list --installed. Note you probably want to ignore the share/perl6 repo, as the CORE module included in it is specific to each version of rakudo.
see: https://github.com/ugexe/zef#list-from
list [*#from]
List known available distributions
$ zef --installed list
===> Found via /home/nickl/.rakubrew/moar-master/install/share/perl6/site
CSV::Parser:ver<0.1.2>:auth<github:tony-o>
Zef:auth<github:ugexe>
===> Found via /home/nickl/.rakubrew/moar-master/install/share/perl6
CORE:ver<6.c>:auth<perl>
Alternatively you can use the following one-liner to get a list:
$ raku -e 'say $*REPO.repo-chain.grep(CompUnit::Repository::Installation).map(*.installed.Slip).grep(*.defined).map({ CompUnit::Repository::Distribution.new($_).Str }).join(" ")'
Text::Table::Simple:ver<0.0.7>:auth<github:ugexe>:api<> CSV::Parser:ver<0.1.2>:auth<github:tony-o>:api<> CORE:ver<6.d>:auth<perl>:api<>
# $*REPO.repo-chain.grep(CompUnit::Repository::Installation) # Get only repos for installed raku modules
# .map(*.installed.Slip) # Get a list of installed modules for this repo, and Slip it into the outer singular results list
# .grep(*.defined) # Some repos will have had no modules, so remove these undefined entries
# .map({ CompUnit::Repository::Distribution.new($_).Str }) # Use CompUnit::Repository::Distribution to get at the normalized identifier
# .join(" ") # Join the results together
Once you have chosen a way to create a list of what needs to be installed you can just pass that list to zef (although your shell may require you to quote names passed in explicitly on the command line)

rakubrew installs different Raku versions in different directories $HOME/.rakubrew/versions/moar-*
So each Raku version has its own separate Installation repositories ( site, vendor, ... ).
And because zef installs distributions to site repo by default, I think. So the modules are not available under multiple versions.
However, because Raku uses the home Installation repo (#inst/home/user-name/.raku) and it exists in repo-chain so you can install the modules you want available on all versions to home repo (~/.raku). ( the modules will be precompiled the first time useed in a new Raku version ).
Please note I haven't tested that with zef but I use Pakku which installs to home repo by default, and the modules I install to home are available to all rakubrew Raku versions on my Linux machine.

Related

Msys2 included packages

Is there a way to find out what default packages are installed along with Msys2 installation. I see that there is openssh, curl, git installed which I didn't. If there is a list that would also be useful. The official base package repository has a long list with thousands of entry.
After installing MSYS2, run pacman -Q to list the packages that are installed.

Installing cminpack package in Msys2

I have Portable Msys2.
I mean to install cminpack.
As I understand, https://aur.archlinux.org/packages/mingw-w64-cminpack/ means such package is available. I expected then that the package shows up in the list of available packages, but
$ pacman -Ss minpack
gave no results.
Did I infer correctly that the package should show up as available in this list?
I also tried
$ pacman -Qs minpack
which gave no results.
(As I understand, any package listed in pacman -Qs should also be listed in pacman -Ss, so it was useless at this point).
Having concluded that a package being listed in this search list possibly does not imply it is available for msys2, I checked
$ pacman -Ss <pkg>
for a few other packages in that list. Some effectively gave no results.
Thus the question
How can I be certain if a package is available for msys2?
(If and when I am sure about that, I guess pacman -S <pkg> would install it).
See also this.
I think you got mixed between msys2 pacman and arch linux pacman. What you have linked is an AUR repository for arch linux, not MSYS2. The utility used pacman is taken over from arch linux, but that is all.
To search package for a packages within your repositories you really can use pacman -Ss <package_name>. If you can't find your package that means that within the installed repositories there is no such package.
If you can't find it you can always check the web: search within msys2 packages. If that is not enough you can do that search within all generated package MSYS2 history: packages at msys2 repositories.
I have check the repositories for your mingw-w64-cminpack package and that is not available for msys2. You would have to cross-compile it yourself.

How to provide standard library sources for IntelliJ IDEA's Rust project?

I am using Mac for development. I installed Rust 1.13.0 using brew install rust and the Rust plugin 0.1.0.1385 for IntelliJ IDEA. I created my first test project with cargo and while opening it with IDEA I got the message
No standard library sources found, some code insight will not work
I haven't found any sources installed, nor the Rust sources package in Homebrew.
How do I provide sources for the project and what are the practical implication if I ignore this step?
As commented, the supported approach is to use rustup:
Navigate to https://rustup.rs/ and follow the installation instructions for your platform.
Add the rust-src component by running: rustup component add rust-src
Create a new Rust project in IntelliJ and choose your existing Rust project source. If the folder already contains previous IntelliJ project files, you may have to delete those first before it will let you proceed.
IntelliJ-Rust should automatically configure the standard library sources to point to the sources downloaded by rustup.
As a reference, since the question title is broad, for Fedora 28 I had to:
dnf install cargo rust-src
sudo ln -s /usr/lib/rustlib/src /usr/lib/rustlib/x86_64-unknown-linux-gnu/
then give /usr/lib/rustlib/x86_64-unknown-linux-gnu/src/rust/src as "Standard library"
Full setup:
Issue opened to simplify the process
When not using the rustup installer, one can install the source package and direct the rust plugin to use those:
(Tested with CLion 2020.2.1, rust-1.46.0-x86_64-pc-windows-gnu.msi, rustc-1.46.0-src.tar.gz. Offline Rust installers and source archive from there: https://forge.rust-lang.org/infra/other-installation-methods.html )
Although the preferred way of installing Rust is by using rustup, as pointed out by the other posts, it is not uncommon to use the packages that your distro makes available.
I use, for example, the packages provided by Gentoo and I share the same problem about the not prefilled field for standard libraries.
Nevertheless, you can easily find out where your standard libraries have been installed by typing the following find command:
find /usr/lib* -type d -name "rust" | grep src
or the following if you installed rust in your home
find -type d -name "rust" | grep src
The previous commands will help, unless, of course, in your distro there is a package for the binaries and one for the source and you only installed the binary one.
I know the question is for MacOS but this answer is shown up when searching for it on Linux. Below I will answer for Ubuntu.
The path is /usr/lib/rustlib/src/rust/src for Ubuntu 20.04
The way I did is:
Installed rustc from the repositories, which includes cargo
sudo apt install rustc
Then installed rust source package
sudo apt install rust-src
I used apt-file (can be installed with sudo apt install apt-file) to search for the install path of the sources
sudo apt-file update
apt-file list rust-src
This show the path as /usr/src/rustc-1.41.0/src .
But a ls -la in /usr/lib/rustlib/ will reveal symlinks and /usr/lib/rustlib/src/rust/src points to the previous found directory.
Using the symlink on IntelliJ will survive new rust versions.
For Fedora 32 install Rust using command:
dnf install cargo rust-src
and the path to standard libary source is:
/usr/lib/rustlib/src/rust
I used Ubuntu. I follow these steps:
sudo apt install rust-src
wait for the install, then
dpkg -L rust-src
copy the last line. For me it is the standard library path:
/usr/lib/rustlib/src/rust
For MacOS, you need to put /opt/homebrew/bin/.

Why is no package 'mono' found?

Attempting to install Banshee from source on a CentOS 7 machine (migrating from Ubuntu and I want to retain my playlists and settings).
./configure results in:
configure: error: Package requirements (mono >= 2.4.3) were not met:
No package 'mono' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables MONO_MODULE_CFLAGS
and MONO_MODULE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
which mono
/bin/mono
echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig
but if I check for pkgconfig,
which pkgconfig
/usr/bin/which: no pkgconfig in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
yum provides pkgconfig
1:pkgconfig-0.27.1-4.el7.i686 : A tool for determining compilation options
Repo : base
yum install pkgconfig
Package 1:pkgconfig-0.27.1-4.el7.x86_64 already installed and latest version
A similar question was asked last year with no accepted answer. One of the answers pointed to a now non-existent page with a purported solution.
I believe pkg-config itself is working all right, configure is not complaining about that. What's missing is the entry for mono in the pkg-config database. Make sure you have mono.pc in /usr/local/lib/pkgconfig, or add wherever you have this file to PKG_CONFIG_PATH as instructed. On some linux distributions, development packages need to be separately installed, such as libmono-cil-dev on debian.

Could not find module `Test.QuickCheck' on Ubuntu

I'm importing QuickCheck at the top of my file:
import Test.QuickCheck
...
Compiling the file with ghc Lab1.hs gives me this error:
Lab1.hs:1:8:
Could not find module `Test.QuickCheck'
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
I tried an apt-cache search for quickcheck and got a dire list of packages. Tried installing libghc-test-framework-dev just because I thought the name seemed appropriate, but the error persists.
How do I install the QuickCheck module?
If you're interested in managing your Haskell packages outside of your package manager (which may be beneficial if you're interested in using the latest versions of things) then Cabal is the Haskell package manager which would allow you to do
apt-get install cabal-install
cabal update
cabal install QuickCheck
to make QuickCheck available globally.
What's more recommended of late however is to use the sandbox feature of Cabal. This is very similar to Python's virtualenv or Ruby's bundle if you're more familiar with those. To do this, you must create a "cabalized" project
cabal init # in an empty directory
and then put QuickCheck (and your other library dependencies) in the build-depends: slot of the generated <folder name>.cabal file.
After you've done this you use Cabal for all further package management and compilation commands.
cabal sandbox init # creates your local package sandbox
cabal install --only-dependencies # gets and installs all the build-dependencies
cabal repl # starts up GHCi in the local sandbox
cabal build # configures and builds the local project
cabal sandbox delete # cleans up the sandbox
In Ubuntu 14.04.1:
sudo apt-get install libghc-quickcheck2-dev
Before:
> :m +Test.QuickCheck
<no location info>:
Could not find module `Test.QuickCheck'
It is not a module in the current program, or in any known package.
After:
Prelude> :m +Test.QuickCheck
Prelude Test.QuickCheck>