What's the build script for a module distribution? - raku

I have test failures. I want to see the details and experiment and perhaps debug, so I unpack the module dist. Now I expect to find some analogue to Setup.hs, setup.py, Build.PL, Rakefile etc., but there are no executables. How do you manually build and test verbosely?

Installing modules
First I'd check more into zef
zef install module::name
zef test /path/to/module
zef --help
zef comes with Rakudo-Star.
If you make a change and want to reinstall the module with the change and it doesn't want to install it, you can "force" it:
zef install --force-install ./relative/path/to/module
Or, if you bump the version in META6.json, you don't have to force it:
zef install ./relative/path/to/module
Testing modules
To test a module, you can use prove to run all of the tests in its test directory:
prove --exec=perl6 -r t/
To run an individual test, simply use perl6:
perl6 t/test.t
See also
Running Tests
You also might be interested in 6pm, but I don't have enough experience with it to comment on it at this time.

Related

rpm build with local Required: some_local_package.rpm

Requires: in the spec files sets the package dependencies, but what will happen if the repo of the requirements is not in the repolist?
Is there a way to use pre downloaded rpm files and tell the rpmbuild that the dependencies should be installed from the local file like yum localinstall.
You're conflating rpm and yum when you mention repolist.
rpm is a lower level and only knows about RPM files
yum collects sets of RPMs into repositories and sits on top of RPM to handle dependencies
Now, to answer the question - rpmbuild does not need anything from the Requires field to build the RPM. If it does, then the RPMs should be listed as BuildRequires in the specfile and only be in Requires if the end user needs it to be installed to run the final product. For example, to build you might need foo-devel but at runtime you only need libfoo. Those should be declared appropriately.
Even if you fix the Requires vs. BuildRequires fields, it still won't help you - rpmbuild cannot install RPMs itself because you should never run rpmbuild as root. An error in a specfile can very easily nuke an entire machine if it's run as root.

Install modules in other rakudo versions using rakubrew

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.

XRlibrary is locked by another concurrent conan process, wait... in c++

While building my solution in VS, am getting conan lock error in c++
1> XRLibrary/0.1#Xerox/XRLibrary is locked by another concurrent conan process, wait...
1> If not the case, quit, and do 'conan remove --locks'
9> perfmon.cpp
Just had the same problem with installing Sentry.io's packages. I did it on Windows, steps might be similar for Linux as well.
Make sure you have the latest version of Conan. Typically you can run the following (if conan was installed using pip):
pip install --upgrade conan
You can do the following next:
Remove directory /c/Users/TestUser/.conan/data/<some-package> (Here the some-package might be XRLibrary)
Rerun your conan install command.
If you are a mac user, just remove ~/.conan/data. That works for me.

installation of cmake on debian 8

I tried to install mcsema on my debian linux but I am stopped by error
Cmake 3.1 or higher is required. You are running 3.0.2. On debian this is the only version could be installed by apt-get install. Building CMake from sources, I get several errors as well. Does anyone know how to install the latest version of Cmake on Debian 8?
Download latests cmake release and follow the README.rst instructions:
UNIX/Mac OSX/MinGW/MSYS/Cygwin ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You need to have a compiler and a make installed. Run the
bootstrap script you find in the source directory of CMake. You
can use the --help option to see the supported options. You may
use the --prefix=<install_prefix> option to specify a custom
installation directory for CMake. You can run the bootstrap script
from within the CMake source directory or any other build directory of
your choice. Once this has finished successfully, run make and
make install. In summary::
$ ./bootstrap && make && make install

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>