Re: Dub - vibe.d - hunt framework ... problems

2020-02-06 Thread Gregor Mückl via Digitalmars-d-learn

On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:

Hi
I want to start a small server, that will be accessible form 
outside. Not a huge deal right?

Not quite.

My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 
UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


DMD : DMD64 D Compiler v2.090.0
Copyright (C) 1999-2019 by The D Language Foundation, All 
Rights Reserved written by Walter Bright




How much memory does this machine have? Is it a virtual machine 
provided by a hosting company? My suspicion is that your server 
is very slow for some peculiar reason.


Re: Dub - vibe.d - hunt framework ... problems

2020-02-06 Thread zoujiaqing via Digitalmars-d-learn

On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:

Hi
I want to start a small server, that will be accessible form 
outside. Not a huge deal right?

Not quite.

My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 
UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


DMD : DMD64 D Compiler v2.090.0
Copyright (C) 1999-2019 by The D Language Foundation, All 
Rights Reserved written by Walter Bright



Now, I try to install dub from the official repo.
Then I do

* dub init server -t vibe.d
* cd server
* dub

I hit this issue : https://github.com/dlang/dub/issues/1712

As suggested, i try to build dub from github, following: 
https://github.com/dlang/dub/releases


I call ./build.d - and everything stops, and machine crashes.

I then try to install DaNode: 
https://github.com/DannyArends/DaNode


It breaks with : module std.algorithm import 'mean' not found

Then I try to install the Hunt Framework. It breaks with : 
basic type

expected, not foreach


Please help. I really want this issue to be resolved-


## 1. For simple server you can using hunt-http library.

Sample code:
```
import hunt.http;

void main()
{
HttpServer server = HttpServer.builder()
.setListener(8080, "0.0.0.0")
.onPost("/", (RoutingContext context) {
context.end("Hello World!");
})
.onGet("/user/:name", (RoutingContext ctx) {
string name = ctx.getRouterParameter("name");

ctx.write("Hello " ~ name);
ctx.end();
})
.build();

server.start();
}
```

## 2. For full server, you can using hunt-skeleton 
(hunt-framework based):

```bash
git clone https://github.com/huntlabs/hunt-skeleton.git myproject/
cd myproject/
dub run -v
```

You can Add pages in `config/routes` , like this:
```
GET   /   index.index
GET   /user/{name}user.detail
```

Add Controller file `controller/UserController.d` :
```
module app.controller.UserController;

import hunt.framework;

class UserController : Controller
{
mixin MakeController;

@Action
string detail(string name)
{
return "Hello " ~ name;
}
}
```

Build and run it:
```
cd myproject/
dub run -v
```

You can see it in the borwser:
```
http://localhost:8080
```


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn

On Saturday, 1 February 2020 at 22:25:38 UTC, Danny Arends wrote:

On Saturday, 1 February 2020 at 20:06:42 UTC, seany wrote:

[...]


Hey Seany,

A quick follow up post. I think/suspect that something might be 
broken in your dub installation if the mean import is not 
found. This is the first import from the phobos standard 
library in the project.


Could you try compiling the DaNode web server without using dub 
?


git clone https://github.com/DannyArends/DaNode.git
cd DaNode
rdmd danode/server.d -p=8080

This should work, when you have a working D+Phobos standard 
library installation. If this throws error of being unable to 
find the canFind import (now the first one) then somehing in 
your dub/dmd installation is broken and you will probably have 
to reinstall dmd+dub


Kind regards,
Danny


I will test this tomorrow.


Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn

I solved this by following:

sudo wget 
https://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list

sudo apt-get update --allow-insecure-repositories
sudo apt-get -y --allow-unauthenticated install --reinstall 
d-apt-keyring

sudo apt-get update && sudo apt-get install dmd-compiler dub


then dub showed the error : out of memory.

I applied: dub --build-mode=singleFile

That seems to work


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Danny Arends via Digitalmars-d-learn

On Saturday, 1 February 2020 at 20:06:42 UTC, seany wrote:

On Saturday, 1 February 2020 at 14:42:58 UTC, Seb wrote:

On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:

Hi
I want to start a small server, that will be accessible form 
outside. Not a huge deal right?

Not quite.

[...]


What version of dub did you install? 1.19 should be the latest.


PS:
As suggested, i try to build dub from github, following: 
https://github.com/dlang/dub/releases


I call ./build.d - and everything stops, and machine crashes.

Same for the master branch


Hey Seany,

A quick follow up post. I think/suspect that something might be 
broken in your dub installation if the mean import is not found. 
This is the first import from the phobos standard library in the 
project.


Could you try compiling the DaNode web server without using dub ?

git clone https://github.com/DannyArends/DaNode.git
cd DaNode
rdmd danode/server.d -p=8080

This should work, when you have a working D+Phobos standard 
library installation. If this throws error of being unable to 
find the canFind import (now the first one) then somehing in your 
dub/dmd installation is broken and you will probably have to 
reinstall dmd+dub


Kind regards,
Danny


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Danny Arends via Digitalmars-d-learn

On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:

Hi
I want to start a small server, that will be accessible form 
outside. Not a huge deal right?

Not quite.

My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 
UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


DMD : DMD64 D Compiler v2.090.0
Copyright (C) 1999-2019 by The D Language Foundation, All 
Rights Reserved written by Walter Bright



Now, I try to install dub from the official repo.
Then I do

* dub init server -t vibe.d
* cd server
* dub

I hit this issue : https://github.com/dlang/dub/issues/1712

As suggested, i try to build dub from github, following: 
https://github.com/dlang/dub/releases


I call ./build.d - and everything stops, and machine crashes.

I then try to install DaNode: 
https://github.com/DannyArends/DaNode


It breaks with : module std.algorithm import 'mean' not found

Then I try to install the Hunt Framework. It breaks with : 
basic type

expected, not foreach


Please help. I really want this issue to be resolved-


Hey Seany,

DaNode author here, the mean function is only used to compute 
some server statistics. I am sorry to hear it didn't compile out 
of the box with the latest DMD compiler, I only tested up-to 
2.088.0


I just installed the latest version 2.090.0 but also using this 
version it compiles fine. Looking into the dlang docs it seems it 
was moved from std.algorithm to std.algorithm.iteration, I wonder 
why it doesn't find this function.


However I just added a mean function to the web server since it 
should always find this function.


Could you pull the latest master branch and try compiling it 
again ?


dub -- -p=8080

then see if the web server works by navigating to

http://localhost:8080/

let me know if you run into any other issues

Kind regards,
Danny


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn

On Saturday, 1 February 2020 at 14:42:58 UTC, Seb wrote:

On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:

Hi
I want to start a small server, that will be accessible form 
outside. Not a huge deal right?

Not quite.

[...]


What version of dub did you install? 1.19 should be the latest.


PS:
As suggested, i try to build dub from github, following: 
https://github.com/dlang/dub/releases


I call ./build.d - and everything stops, and machine crashes.

Same for the master branch


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn

On Saturday, 1 February 2020 at 14:42:58 UTC, Seb wrote:

On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:

Hi
I want to start a small server, that will be accessible form 
outside. Not a huge deal right?

Not quite.

[...]


What version of dub did you install? 1.19 should be the latest.


1.18.2


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 14:30:36 UTC, Steven 
Schveighoffer wrote:


How is your network connection to the dub server? Maybe there 
is a separate problem with network connectivity.


This thing works for me (dub upgrade takes about 2.5 seconds 
and finishes). How long does it take for your process to give 
up?


In any case, maybe the dub check to see if it's "taking too 
long" needs to take into account progress that is being made (a 
"pathalogical case" suggests it's not making progress).


-Steve


With dub 1.18 more than 5 minutes.

If i use dub search dub, it finishes in seconds.

dub fetch dub is fine too.

dub run dub takes 10-12 seconds, and throws the same dependency 
error


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Seb via Digitalmars-d-learn

On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:

Hi
I want to start a small server, that will be accessible form 
outside. Not a huge deal right?

Not quite.

[...]


What version of dub did you install? 1.19 should be the latest.


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Steven Schveighoffer via Digitalmars-d-learn

On 2/1/20 6:15 AM, seany wrote:



$ dub init server -t vibe.d
Package recipe format (sdl/json) [json]:
Name [server]:
Description [A simple vibe.d server application.]:
Author name [root]:
License [proprietary]:
Copyright string [Copyright © 2020, root]:
Add dependency (leave empty to skip) []:
Successfully created an empty project in '/root/progs/D/server'.
Package successfully created in server

$ cd server
$ dub upgrade
Upgrading project in /root/progs/D/server
The dependency resolution process is taking too long. The dependency 
graph is likely hitting a pathological case in the resolution algorithm. 
Please file a bug report at https://github.com/dlang/dub/issues and 
mention the package recipe that reproduces this error.



$ dub upgrade vibe.d
Upgrading project in /root/progs/D/server
The dependency resolution process is taking too long. The dependency 
graph is likely hitting a pathological case in the resolution algorithm. 
Please file a bug report at https://github.com/dlang/dub/issues and 
mention the package recipe that reproduces this error.


How is your network connection to the dub server? Maybe there is a 
separate problem with network connectivity.


This thing works for me (dub upgrade takes about 2.5 seconds and 
finishes). How long does it take for your process to give up?


In any case, maybe the dub check to see if it's "taking too long" needs 
to take into account progress that is being made (a "pathalogical case" 
suggests it's not making progress).


-Steve


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn

On Saturday, 1 February 2020 at 11:15:49 UTC, seany wrote:
On Saturday, 1 February 2020 at 11:08:46 UTC, Ferhat Kurtulmuş 
wrote:

[...]


I even tried:

$ dub fetch dub
Fetching dub 1.19.0...
Please note that you need to use `dub run ` or add it to 
dependencies of your package to actually use/run it. dub does not 
do actual installation of packages outside of its own ecosystem.



$ dub run dub
Building package dub in /root/.dub/packages/dub-1.19.0/dub/
Fetching libevent 2.0.2+2.0.16 (getting selected version)...
Fetching diet-ng 1.6.0 (getting selected version)...
Fetching taggedalgebraic 0.11.8 (getting selected version)...
Fetching botan 1.12.10 (getting selected version)...
Fetching stdx-allocator 2.77.5 (getting selected version)...
Fetching vibe-d 0.8.6 (getting selected version)...
Fetching mir-linux-kernel 1.0.1 (getting selected version)...
Fetching memutils 0.4.13 (getting selected version)...
Fetching vibe-core 1.8.1 (getting selected version)...
Fetching libasync 0.8.4 (getting selected version)...
Fetching botan-math 1.0.3 (getting selected version)...
Fetching eventcore 0.8.48 (getting selected version)...
The dependency resolution process is taking too long. The 
dependency graph is likely hitting a pathological case in the 
resolution algorithm. Please file a bug report at 
https://github.com/dlang/dub/issues and mention the package 
recipe that reproduces this error.




Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 11:08:46 UTC, Ferhat Kurtulmuş 
wrote:



Have you tried
dub upgrade



$ dub init server -t vibe.d
Package recipe format (sdl/json) [json]:
Name [server]:
Description [A simple vibe.d server application.]:
Author name [root]:
License [proprietary]:
Copyright string [Copyright © 2020, root]:
Add dependency (leave empty to skip) []:
Successfully created an empty project in '/root/progs/D/server'.
Package successfully created in server

$ cd server
$ dub upgrade
Upgrading project in /root/progs/D/server
The dependency resolution process is taking too long. The 
dependency graph is likely hitting a pathological case in the 
resolution algorithm. Please file a bug report at 
https://github.com/dlang/dub/issues and mention the package 
recipe that reproduces this error.



$ dub upgrade vibe.d
Upgrading project in /root/progs/D/server
The dependency resolution process is taking too long. The 
dependency graph is likely hitting a pathological case in the 
resolution algorithm. Please file a bug report at 
https://github.com/dlang/dub/issues and mention the package 
recipe that reproduces this error.



$ cd
$ dub upgrade
There was no package description found for the application in 
'/root/progs/D'.

Upgrading project in /root/progs/D


Now I repeated:

$ cd server
$ dub upgrade
Upgrading project in /root/progs/D/server
The dependency resolution process is taking too long. The 
dependency graph is likely hitting a pathological case in the 
resolution algorithm. Please file a bug report at 
https://github.com/dlang/dub/issues and mention the package 
recipe that reproduces this error.



$ dub upgrade vibe.d
Upgrading project in /root/progs/D/server
The dependency resolution process is taking too long. The 
dependency graph is likely hitting a pathological case in the 
resolution algorithm. Please file a bug report at 
https://github.com/dlang/dub/issues and mention the package 
recipe that reproduces this error.


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Ferhat Kurtulmuş via Digitalmars-d-learn

On Saturday, 1 February 2020 at 11:02:45 UTC, seany wrote:
On Saturday, 1 February 2020 at 10:58:14 UTC, Ferhat Kurtulmuş 
wrote:

On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:

As suggested, i try to build dub from github, following: 
https://github.com/dlang/dub/releases



I don't know if it is a solution. But you can try using 
~master branch, not a release on GitHub.



You can also try my vibed app skeleton:
https://github.com/aferust/simplerestvibed
İ simply run it with dub command.


sadly, also doesn't work. same as the full system crash


Have you tried
dub upgrade


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 10:58:14 UTC, Ferhat Kurtulmuş 
wrote:

On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:

As suggested, i try to build dub from github, following: 
https://github.com/dlang/dub/releases



I don't know if it is a solution. But you can try using ~master 
branch, not a release on GitHub.



You can also try my vibed app skeleton:
https://github.com/aferust/simplerestvibed
İ simply run it with dub command.


sadly, also doesn't work. same as the full system crash


Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Ferhat Kurtulmuş via Digitalmars-d-learn

On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:

As suggested, i try to build dub from github, following: 
https://github.com/dlang/dub/releases



I don't know if it is a solution. But you can try using ~master 
branch, not a release on GitHub.



You can also try my vibed app skeleton:
https://github.com/aferust/simplerestvibed
İ simply run it with dub command.


Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn

Hi
I want to start a small server, that will be accessible form 
outside. Not a huge deal right?

Not quite.

My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 
UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


DMD : DMD64 D Compiler v2.090.0
Copyright (C) 1999-2019 by The D Language Foundation, All Rights 
Reserved written by Walter Bright



Now, I try to install dub from the official repo.
Then I do

* dub init server -t vibe.d
* cd server
* dub

I hit this issue : https://github.com/dlang/dub/issues/1712

As suggested, i try to build dub from github, following: 
https://github.com/dlang/dub/releases


I call ./build.d - and everything stops, and machine crashes.

I then try to install DaNode: 
https://github.com/DannyArends/DaNode


It breaks with : module std.algorithm import 'mean' not found

Then I try to install the Hunt Framework. It breaks with : basic 
type

expected, not foreach


Please help. I really want this issue to be resolved-