What are the steps to successfully run Ranch on windows? - windows

Please what steps do we need to take to get Ranch working successfully on windows?
There is a very instructive set of examples in a great blog series which i am trying to follow here:
http://dbeck.github.io/Using-Ranch-From-Elixir/
http://dbeck.github.io/simple-TCP-message-performance-in-Elixir/
It however requires that we use the Ranch Erlang Lib.
Getting this to work on windows has been a pain so far:
mix.deps.compile fails
C:\Elixir\tcp_eval>mix deps.update --all
Running dependency resolution
Dependency resolution completed successfully
ranch: v1.1.0
C:\Elixir\tcp_eval>mix deps.compile
==> ranch
Access denied - SRC
File not found - -TYPE
File not found - F
File not found - -NAME
Access denied - SRC
File not found - -TYPE
File not found - F
File not found - -NAME
Access denied - SRC
File not found - -TYPE
File not found - F
File not found - -NAME
Access denied - SRC
File not found - -TYPE
File not found - F
File not found - -NAME
File not found - SRC/
File not found - -TYPE
File not found - F
File not found - -NAME
Access denied - EBIN
File not found - -TYPE
File not found - F
File not found - -NAME
APP ranch.app.src

With some help from here:
https://github.com/ninenines/erlang.mk/issues/294#issuecomment-147379818
I was able to get Ranch working on windows.
1) install the msys2 environment
2) run mix from within the MSYS2 environment
EDIT: Doing this via rebar
D:\Elixir\tcp_eval>rebar
'rebar' is not recognized as an internal or external command,
operable program or batch file.
D:\Elixir\tcp_eval>rebar3
Rebar3 is a tool for working with Erlang projects.
Usage: rebar [-h] [-v] [<task>]
-h, --help Print this help.
-v, --version Show version information.
<task> Task to run.
Several tasks are available:
as Higher order provider for running multiple tasks in a sequence as a certain profiles.
clean Remove compiled beam files from apps.
compile Compile apps .app.src and .erl files.
cover Perform coverage analysis.
ct Run Common Tests.
deps List dependencies
dialyzer Run the Dialyzer analyzer on the project.
do Higher order provider for running multiple tasks in a sequence.
edoc Generate documentation using edoc.
escriptize Generate escript archive.
eunit Run EUnit Tests.
help Display a list of tasks or help for a given task or subtask.
new Create new project from templates.
path Print paths to build dirs in current profile.
pkgs List available packages.
release Build release of project.
relup Create relup of releases.
report Provide a crash report to be sent to the rebar3 issues page.
shell Run shell with project apps and deps in path.
tar Tar archive of release built of project.
tree Print dependency tree.
unlock Unlock dependencies.
update Update package index.
upgrade Upgrade dependencies.
version Print version for rebar and current Erlang.
xref Run cross reference analysis.
plugins <task>:
list List local and global plugins for this project
upgrade Upgrade plugins
unstable <task>:
install Extract libs from rebar3 escript along with a run script.
upgrade Download latest rebar3 escript and extract.
Run 'rebar3 help <TASK>' for details.
D:\Elixir\tcp_eval>
Looking at Hex.pm, I decided to install rebar3, this works/integrates well with mix.
following http://theburningmonk.com/2014/08/getting-started-with-rebar-on-windows/ we can get rebar3 working on windows
but this still does not work:
D:\Elixir\tcp_eval>mix deps.compile
==> ranch
'make' is not recognized as an internal or external command,
operable program or batch file.
==> tcp_eval
** (Mix) Could not compile dependency :ranch, "make" command failed. You can recompile this dependency with "mix deps.compile ranch",
D:\Elixir\tcp_eval>

Related

What makefile should I use to build a gtk-3-examples application?

I'm not really experienced with graphics programming, but I got curious. I installed both libgtk-3-dev and gtk-3-examples on my Debian 10.7 machine. From there I listed the example package files using dpkg-query -L gtk-3-examples to find some example programs.
In the examples directory I found the following README file:
== Building the examples ==
The examples in this directory are built alongside the rest of GTK+.
The examples under the `application[1-10]` directories are also included in
the GTK+ API reference documentation, and can be built independently, using
the system libraries, by doing:
$ cd application1
$ make -f Makefile.example
Looks straight forward. However, following the directions exactly yields the following result:
make: Makefile.example: No such file or directory
make: *** No rule to make target 'Makefile.example'. Stop.
There are no "Makefile.example" files in the application folders. Running find -name "Makefile*" in the examples directory yields:
./application7/Makefile.in.gz
./application7/Makefile.am
./Makefile.in.gz
./application5/Makefile.in.gz
./application5/Makefile.am
./bp/Makefile.in.gz
./bp/Makefile.am
./application9/Makefile.in.gz
./application9/Makefile.am
./application6/Makefile.in.gz
./application6/Makefile.am
./application2/Makefile.in.gz
./application2/Makefile.am
./application10/Makefile.in.gz
./application10/Makefile.am
./application3/Makefile.in.gz
./application3/Makefile.am
./application1/Makefile.in.gz
./application1/Makefile.am
./application8/Makefile.in.gz
./application8/Makefile.am
./application4/Makefile.in.gz
./application4/Makefile.am
./Makefile.am
I've not had any luck building an example program using the above files. I'm guessing it is because of my unfamiliarity with auto tools? Is there an easy way to build an example GTK program using the above files or do I need know a lot more about make/autotools/configure to get a working example running?
Update:
The cant-run-makefile-am-what-should-i-do post is informative but does not provide a course of action when no configure, bootstrap, or autogen programs can be found within the package. The following command yields no results when executed in my examples directory: find -type f | grep -i -E "*conf*|*auto*|*boot*". I need one of those files to be provided in order to have a successful build (as far as I understand it anyway).
Sorry for the fuss! I'm used to installing regular packages and missed that I needed to download the full source code to get the examples working. So, originally I mentioned that I installed both libgtk-3-dev and gtk-3-examples. I did so using apt-get install libgtk-3-dev && apt-get install gtk-3-examples.
However, to build GTK along with its examples locally it looks like what you want to do is get the source package archive with apt-get source gtk-3-examples (or similar.. I think it actually picked a different meta-package for me when I ran that command).
Then, in my new gtk+3.0-3.24.5 directory there's a nice configure binary that I can run (with subsequent make and make install commands) which produce many files including example program binaries.
So with ./gtk+3.0-3.24.5/examples/application1/exampleapp I get a running example. Voila!

How to fix "-bash: bazel: command not found" when running "bazel build //src:bazel" from windows

Hi I downloaded the last release of bazel 0.24.1 for windows and I did the same instructions But, when I run
./compile.sh
It shows the error as mentioned and I tried bazel build //src:bazel but it didn't work to it shows me
-bash: bazel: command not found
after searching I tried : bazel --output_user_root=c:\tmp build //src:bazel.exe
but the same error
-bash: bazel: command not found
Ps: I run it from msys64 any suggestions please thanks a lot for reacting
./compile.sh
🍃 Building Bazel from scratch ERROR: Must specify PROTOC if not
bootstrapping from the distribution artifact
-------------------------------------------------------------------------------- NOTE: This failure is likely occuring if you are trying to bootstrap
bazel from a developer checkout. Those checkouts do not include the
generated output of the protoc compiler (as we prefer not to version
generated files)
.
To build a developer version of bazel, do
bazel build //src:bazel
To bootstrap your first bazel binary, please download a dist archive from our release page at
https://github.com/bazelbuild/bazel/releases and run compile.sh on
the unpacked archive.
The full install instructions to install a release version of bazel
can be found at https://docs.bazel.build/install-compile-source.html
For a rationale, why the bootstrap process is organized in this way,
see https://bazel.build/designs/2016/10/11/distribution-artifact.html

How to build Courguette in Debian

Right now I am trying to compile Courguette in order to generate a diff patch. The source and some documentation can be found in the following link:
Courguette
I downloaded it but I don't find the way of compiling it.
I have Googled and found some references even to this forum, such as:
StackOverflow link
And other references:
Chromium Linux build instructions
After reading things about ninja and gpy I decided to install them, but there are not references to a .ninja file. I find a courguette.gyp file but using gpy I neither get it compiled...
I am following the guide they provide:
Installed the depot_tools and added to the path.
gclient runhooks
gclient sync
And when I execute gn gen out/Default it fails with the following message:
gn.py: Could not find gn executable at: ~/binary_diff_tools/courgette-master/courgette/buildtools/linux64/gn
Then I used git to pull from the repository the buildtools, but I get the same result.
Any help will be appreciated.
Best regards,
Iván
Ok... It seems that is needed to install all Chromium dependencies before being able to compile courgette so... it must be done as follows:
Install depot_tools git clone and you will have them installed.
After including the depot_tools in your patch (.profile or .bashsrc for example as indicate the depot_tools installation tutorial) execute fetch chromium ouside the depot_tools folder ( it always failed me when I executed it inside the same folder).
I want to build it in Debian so I have to do "gclient runhooks" instead of the .sh script for Ubuntu.
ninja -C out/Default courgette
You will find the executable in the folder out/Default, so ./courgette and it will indicate you the right parameters in order to generate your patch properly.
Best regards,
Iván.

Differences between RPM created with rpmbuild and Os-nebula-rpm plugin

I am trying to use the Nebula rpm plugin for Gradle to build RPMs. I am finding the following discrepancy between RPMs built this way and RPMs built the traditional way, with spec files and rpmbuild.
In a spec file, you might have something like this:
%dir /usr/local/myapp/logs
This would create the directory /usr/local/myapp/logs when the rpm is installed. Once myapp starts to run it would write logs to this directory. When the app is uninstalled, rpm would understand that the files under /usr/local/myapp/logs were not created by the rpm installation process and therefore not delete this directory or the files within it. If the directory were empty at the time of uninstallation, then the directory would be removed.
There is a similar directive with the Gradle plugin. If you include
directory('/usr/local/myapp/logs')
in the build script, this directory will be created similar to the rpm process. However, in this instance, when the rpm is uninstalled, the directory and any files that have been added within it since installation will be removed.
I am trying to account for this difference. The RPM plugin is based on the redline-rpm java package, and from looking at the source, and the usual RedHat rpm documentation, I cannot find any setting that governs this behavior.
Can anyone hazard a guess what might be going on here to create this difference in behavior?
Update: this post has some pretty good information on how this works, but I still don't know the name of any directive that alters this behavior.
Update 2 Now this starts to get very interesting. If I run rpm -evv myapp on the rpm built with the Gradle plugin, after installation, and after having added a file to /usr/local/myapp/logs, I see the following:
D: fini 040755 2 (7007, 500) 4096 /usr/local/myapp/logs
D: erase rmdir of /usr/local/myapp/logs failed: Directory not empty
and yet and still, after the operation is complete, the directory is gone!
How can this be? Could there be some configuration of the rpm executable itself that allows the deletion to take place?

Error when opening .tar.gz via Shell to install Apache Maven

Machine:
Mac OSX 10.5.8 32-bit.
Goal:
To install apache maven per its websites instructions, in order to install the JUNG package according to its install instructions, so I can use the JUNG classes in various Java GUIs.
What I Did:
Downloaded a .tar.gz file, and using the shell, moved it to a directory (using mv) I created for it (using mkdir), usr/local/apache-maven per the website directions
I downloaded the file apache-maven-3.0.4-bin.tar.gz. Next I tried extracting the file using tar -zxvf apache-maven-3.0.4-bin.tar.gz.
Error:
I get an error message when I try to extract the apache-maven .gz (install?) file in shell.
tar: apache-maven-3.0.4/direcoryandfile: Cannot open: No such file or directory
...
apache-maven-3.0.4/lib/ext: Cannot mkdir: No such file or directory apache-maven-3.0.4/lib/ext/README.txt
tar: apache-maven-3.0.4/lib/ext/README.txt: Cannot open: No such file or directory tar:
Error exit delayed from previous errors
Instructions:
For the maven building
Extract the distribution archive, i.e. apache-maven-3.0.4-bin.tar.gz to the directory you wish to install Maven 3.0.4... The subdirectory apache-maven-3.0.4 will be created from the archive.
...
for the JUNG installation
Appendix: How to Build JUNG
Get Maven
Download and install maven2 from maven.apache.org: http://maven.apache.org/download.html. At time of writing (early June 2012), the latest version was maven-3.0.4. Install the downloaded maven2 (there are installation instructions on the Maven website).
Follow the installation instructions and confirm a successful installation by typing 'mvn --version' in a command terminal window.
Self-Rectification Attempts
From what I can tell the archive file is missing some directories or something. I tried deleting the file, redownloading the .tar.gz file from a different mirror and repeating the process. Same result. Thanks again for the help
Background:
I'm trying to install the JUNG package to my system's Java, so I can write object-oriented code using various GUIs (Ecliplse, Dr. Java) using the classes in JUNG. I don't understand how the building/installing process works, and how I can get what I build/install to work on various GUIs and the command line. I'm new to shell and the command line, and mostly have experience using a simple IDE (DrJava, Python IDLE, R GUI) to write and compile object-oriented code.
To unpack a tar.gz archive you need to do it either in two steps:
gunzip apache-maven-3.0.4.tar.gz
tar -xf apache-maven-3.0.4.tar
or you might try to do it in a single step:
tar -zxf apache-maven-3.0.4.tar.gz
Two Step Process:
1. Extract the .tar from the .tar.gz using gunzip, and -v for having gunzip print what its doing. gunzip -v apache-maven-3.0.4.tar.gz
2. Extract the .tar file using tar, -x for telling the program to do an extraction, -v for having tar print what its doing, and -f for tar to know that the following file is the archive and appending with sudo so tar has permission to create directories. sudo tar -xvf apache-maven-3.0.4.tar

Resources