Trouble using the cro command-line tool as documented - windows

I'm running Rakudo Star 2019.03.1 on Windows 7, Cro was installed by zef. Following the Getting Started section on the Cro website, the following should work:
The cro stub command generates stub services for you, to get started
more quickly and with better defaults. Here we use it to create a
simple HTTP service, with ID hello and in the hello directory:
cro stub http hello hello
...which actually does work, it generates a lot of files for the project including the .cro.yml file, which I assume is the central description file for the service. But if I try to follow the docs and run cro run (from inside the hello directory, I assumed):
The cro run command will start your service (and automatically restart
the service if you change a file):
cro run
...the service isn't started but cro errors out:
A react block:
in sub run-services at C:\rakudo\share\perl6\site\sources\709F4B18755ADE6922C88B8C44A0930A5DDD77C9 (Cro::Tools::CLI) line 227
in sub MAIN at C:\rakudo\share\perl6\site\sources\709F4B18755ADE6922C88B8C44A0930A5DDD77C9 (Cro::Tools::CLI) line 199
in block <unit> at C:\rakudo\share\perl6\site\resources\C1E87B0F084684C12CD87240AE4C12E746174570 line 1
in sub MAIN at C:\rakudo\share\perl6\site\bin\cro line 3
in block <unit> at C:\rakudo\share\perl6\site\bin\cro line 1
Died because of the exception:
no such file or directory
in any at C:\rakudo\share/perl6/runtime/CORE.d.setting.moarvm line 1
in sub run-services at C:\rakudo\share\perl6\site\sources\709F4B18755ADE6922C88B8C44A0930A5DDD77C9 (Cro::Tools::CLI) line 227
in sub MAIN at C:\rakudo\share\perl6\site\sources\709F4B18755ADE6922C88B8C44A0930A5DDD77C9 (Cro::Tools::CLI) line 199
in block <unit> at C:\rakudo\share\perl6\site\resources\C1E87B0F084684C12CD87240AE4C12E746174570 line 1
in sub MAIN at C:\rakudo\share\perl6\site\bin\cro line 3
in block <unit> at C:\rakudo\share\perl6\site\bin\cro line 1
This error message is unfortunately not speaking to me. What do I miss?

Update
Somehow I missed this Cro github issue yesterday when googling, which is precisely what my problem was. I backlinked this question+answer in the github issue. A fix has since been merged and will be part of the next release of Cro. Props for the quick response everybody!
Original Answer
This could be resolved with the help of timotimo (Thanks!), who
suggested Cro::Tools::Runner calls perl6 instead of perl6.bat which is needed
for Windows.
pointed me to this answer which has the important bits of information regarding changing code in zef-installed modules.
So I headed over to %USERPROFILE%\.zef\store\cro-0.8.1.tar.gz\cro-0.8.1\lib\Cro\Tools and patched the executable name in line 269 of Runner.pm6. Then I went back up to %USERPROFILE%\.zef\store\cro-0.8.1.tar.gz\cro-0.8.1 and recompiled and installed the module with the following command (note the --/test to skip the tests, which take a lot of time):
C:\...\.zef\store\cro-0.8.1.tar.gz\cro-0.8.1>zef install . --force-install --/test --verbose
The following local path candidates are already installed: .
===> Installing: cro:ver<0.8.1>
===> Install [OK] for cro:ver<0.8.1>
1 bin/ script [cro] installed to:
C:\rakudo\share\perl6\site\bin
Now, cro run spews what I believe to be ANSI codes at me, but it is working :)
C:\ws\perl6\hello>cro run
←[1;32mÔûÂ Starting hello (hello)←[0m
←[32m­ƒöî Endpoint HTTP will be at http://localhost:20000/←[0m
←[32m­ƒôô hello ←[0mListening at http://localhost:20000

Related

`go test` only prints "open : no such file or directory"

I rewrite a program and just removed a lot of code, by just making it a comment. After doing that and adding some tests, it is impossible to run the program anymore.
when running go build it has no errors at all.
But when running go test i only become some weird output:
$ go test
2020/05/05 19:14:24 open : no such file or directory
exit status 1
FAIL fwew_lib 0.002s
This error occurs, before a single test is even run, so within the test framework itself.
Why is there is no file specified that is not found? Any idea, what caused this error and how to fix it?
This error also occurred on multiple machines with windows and linux. And with go 1.14.2 and go 1.13.7.
To get this error yourself:
Repo: https://github.com/knoxfighter/fwew/tree/library
Branch: library
Just download the branch and run go test
Your fork is missing this line from the parent
texts["dictionary"] = filepath.Join(texts["dataDir"], "dictionary.txt")
link
But your fork still has this line which depends on the one mentioned above
Version.DictBuild = SHA1Hash(texts["dictionary"])
link
And so the SHA1Hash "fatals" out since you're essentially passing it an empty string.
link

rethinkdb CURLOPT_ACCEPT_ENCODING was not declared in this scope error

I am working on installing rethinkdb on my server, which is a CentOS 6.9 machine. I followed all the directions for a CentOS server as described here for CentOS 6. I got all the way to the command scl enable devtoolset-2 -- make but while building, on line 244 of 421, the line that reads build/release/obj/extproc/http_job.o I receive the error "CURLOPT_ACCEPT_ENCODING was not declared in this scope"
I don't know what this means or why the error is popping up, but I can't continue with the build process as long as that error is there.
I found an obscure article that mentions a fix for this particular error. If you go into the rethinkdb folder on the server, you can then navigate to src/extproc/http_job.cc and open that file in a text editor. You can then search for the function void set_default_opts and inside of that function is the line exc_setopt(curl_handle, CURLOPT_ACCEPT_ENCODING, "", "PROTOCOLS); If you just change CURLOPT_ACCEPT_ENCODING to `CURLOPT_ENCODING, you will be able to continue the build process. It worked for me.

On running my first simulation of castalia, i get the following error

Simulation terminated with exit code: 139 Working directory: /home/roopali/omnetpp-4.6/samples/Castalia_proj/Simulations/Parameters Command line: ../../src/Castalia_proj -r 0 -n ..:../../src First_Obj.ini
Environment variables: PATH=/home/roopali/omnetpp-4.6/bin::/home/roopali/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games LD_LIBRARY_PATH=/home/roopali/omnetpp-4.6/lib:: OMNETPP_IMAGE_PATH=/home/roopali/omnetpp-4.6/images
I have tried making this simulation using the steps on page https://chevy67.wordpress.com/tag/castalia/
The blog post you linked (and tried to follow instructions from) refers to a very old version of Castalia. Follow the installation guidelines found in the official repo for Castalia:
https://github.com/boulis/Castalia
After you have installed Castalia successfully, read the manual (found again in the above link), especially Chapter 3, to run your first simulation.

Rebar3 : not able to install on windows 8

I am trying to install rebar3 using the git console.I have erlang installed and the path is set to C:\Program Files\erl7.3\bin
Here are the steps which I followed :
$ git clone https://github.com/erlang/rebar3.git
$ cd rebar3
$./bootstrap
On hitting bootstrap ,I get the following error
escript: exception throw: {error,{rebar_prv_update,package_index_write}}
in function rebar_prv_update:do/1 (src/rebar_prv_update.erl, line 77)
in call from rebar_core:do/2 (src/rebar_core.erl, line 125)
in call from erl_eval:do_apply/6 (erl_eval.erl, line 670)
in call from escript:eval_exprs/5 (escript.erl, line 871)
in call from erl_eval:local_func/6 (erl_eval.erl, line 557)
in call from escript:interpret/4 (escript.erl, line 787)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_it/1 (init.erl, line 1055)
Any suggestions on how to solve this?
Please take a look at the following github issue.
My user home directory was pointed to a network location. I removed the network location from My Computer and was able to build rebar3 successfully.

Class "Veins::ObstacleControl" not found

I have followed step by step the tutorial to install Veins, but when I tried running the example scenario (final step) I ended up with the above error.
The whole error was:
Error in module (cModule) RSUExampleScenario (id=1) during network
setup: Class "Veins::ObstacleControl" not found -- perhaps its code
was not linked in, or the class wasn't registered with
Register_Class(), or in the case of modules and channels, with
Define_Module()/Define_Channel().
TRAPPING on the exception above, due to a debug-on-errors=true
configuration option. Is your debugger ready?
Simulation terminated with exit code: -2147483645 Working directory:
C:/Users/user/src/veins-4.3/examples/veins Command line:
../../../omnetpp-4.6/bin/opp_run.exe -r 0 -n .;../../src/veins
--tkenv-image-path=../../images -l ../../src/veins omnetpp.ini
I don't think I have missed a step during the tutorial as I have tried it two times. I did not make any change in anything, I've just strictly followed the tutorial like a robot, so I cannot provide an MCVE with more details than the tutorial.
Here is what I'm using:
- Windows 7 Pro 64 bits
- SUMO 0.25.0 64 bits
All other steps of the tutorial successfully worked until the final step.
I assume this error occurs when running Veins via the OMNeT++ IDE. Or, if you have compiled it with GCC (The error does not happen if you use CLANG)
There are two ways to bypass this error:
Use the .run as executable from your examples directory, which calls veins/run and includes all the required libraries:
Use opp_run as executable and set dynamic libraries to the directory where libveins.so is located (usually src/veins)
PS: to answer #ChristopSommer questions: Veins::ObstacleControl appears in opp_run -l src/veins -h classes
This could be a solution too, but I never tested it: Compiler flags in Eclipse

Resources