Re: Why -I flag does not work?

2019-02-09 Thread Victor Porton via Digitalmars-d-learn

On Saturday, 9 February 2019 at 11:40:57 UTC, Victor Porton wrote:

On Saturday, 9 February 2019 at 08:35:53 UTC, JN wrote:
On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton 
wrote:

Why does -I flag in DFLAGS does not work? (Ubuntu Linux)


I'm no expert on dub, but it's possible that it's overriding 
the import path anyway. One of the main points of dub is that 
you shouldn't have to handle the import paths yourself.


I think what could work is adding a librdf in dub.json 
dependencies section, and then using "dub add-local" command 
to point to the library. Something like:


dub add-local /usr/local/include/d/librdf ~master

and then in dependencies section:

"dependencies": {
"librdf": "~master"
}


As I understand it would pollute the Git version of dub.json 
with my local changes. That's no good.


I did

// dub.json:
"dependencies": {
"rdf_dlang": "~>1.0.17",
"ae": "~>0.0.2331"
},

// dub.selections.json:
{
"fileVersion": 1,
"versions": {
"ae": "0.0.2331",
"rdf_dlang": "1.0.17"
}
}

I also installed /usr/local/include/d/librdf/dub.json with 
"sourcePaths": 
["/usr/local/stow/rendland-bindings/include/d/librdf"]


and did

$ dub add-local /usr/local/include/d/librdf/ 1.0.17

But nevertheless:

$ dub build --compiler=dmd --build=unittest
Dynamic libraries are not yet supported as dependencies - 
building as static library.

Performing "unittest" build using dmd for x86_64.
xml-boiler-dlang ~master: building configuration "library"...
source/xmlboiler/options.d(4,8): Error: module `model` is in file 
'rdf/redland/model.d' which cannot be read

import path[0] = source/
import path[1] = ../../.dub/packages/ae-0.0.2331/ae/sys
import path[2] = ../../.dub/packages/ae-0.0.2331/ae/utils
import path[3] = ../../.dub/packages/ae-0.0.2331/ae/net
import path[4] = /snap/dmd/40/bin/../import/druntime
import path[5] = /snap/dmd/40/bin/../import/phobos
dmd failed with exit code 1.


Re: Why -I flag does not work?

2019-02-09 Thread Victor Porton via Digitalmars-d-learn

On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton wrote:

Why does -I flag in DFLAGS does not work? (Ubuntu Linux)


https://github.com/dlang/dub/issues/1645


Re: Should D file end with newline?

2019-02-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, February 9, 2019 2:19:27 PM MST Victor Porton via Digitalmars-
d-learn wrote:
> ISO C++ specifies that the C++ file must end with a newline.
>
> Should D file end with newline, too?

No, there is no need to end D files with a newline. I would guess that the
vast majority of D files end with a closing brace. I just looked at a bunch
of files in the standard library for the heck of it, and almost all of the
ones I looked at ended with a closing brace. And those that didn't ended
with something like an enum declaration and not a newline. Personally, I
don't leave newlines at the end of files, because it looks messy. I don't
even recall doing that in C++, though I do recall that there supposedly be a
rule about it. It seems like a pretty bizarre requirement to me, but
regardless, I'm quite sure that D does not have that requirement.

- Jonathan M Davis





Re: Should D file end with newline?

2019-02-09 Thread sarn via Digitalmars-d-learn

On Saturday, 9 February 2019 at 21:19:27 UTC, Victor Porton wrote:

ISO C++ specifies that the C++ file must end with a newline.

Should D file end with newline, too?


I'm sure you could mostly get away without one, but POSIX says 
that all text files should end with a newline.  There are some 
POSIX tools that don't work properly without the final newline.


Should D file end with newline?

2019-02-09 Thread Victor Porton via Digitalmars-d-learn

ISO C++ specifies that the C++ file must end with a newline.

Should D file end with newline, too?


Re: Why -I flag does not work?

2019-02-09 Thread DanielG via Digitalmars-d-learn

On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton wrote:

Why does -I flag in DFLAGS does not work? (Ubuntu Linux)


Try adding the -i flag as well ("include imported modules in the 
compilation"), or setting both importPaths and sourcePaths in 
dub.json.


I'm not certain that will help, but long ago I was having similar 
trouble and it was because I was importing, but not compiling, a 
certain file.


For reference: https://dub.pm/package-format-json


Re: Why -I flag does not work?

2019-02-09 Thread Victor Porton via Digitalmars-d-learn

On Saturday, 9 February 2019 at 10:32:36 UTC, DanielG wrote:
On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton 
wrote:

Why does -I flag in DFLAGS does not work? (Ubuntu Linux)


Try adding the -i flag as well ("include imported modules in


-i in DFLAGS does not help.

-I works when passed on the command line but not in DFLAGS :-(

the compilation"), or setting both importPaths and sourcePaths 
in dub.json.


This would pollute the Git version of the dub.json with my local 
changes.


I'm not certain that will help, but long ago I was having 
similar trouble and it was because I was importing, but not 
compiling, a certain file.


It should not be compiled, only imported. It was already compiled 
to a shared library.


Re: Why -I flag does not work?

2019-02-09 Thread Victor Porton via Digitalmars-d-learn

On Saturday, 9 February 2019 at 08:35:53 UTC, JN wrote:
On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton 
wrote:

Why does -I flag in DFLAGS does not work? (Ubuntu Linux)


I'm no expert on dub, but it's possible that it's overriding 
the import path anyway. One of the main points of dub is that 
you shouldn't have to handle the import paths yourself.


I think what could work is adding a librdf in dub.json 
dependencies section, and then using "dub add-local" command to 
point to the library. Something like:


dub add-local /usr/local/include/d/librdf ~master

and then in dependencies section:

"dependencies": {
"librdf": "~master"
}


As I understand it would pollute the Git version of dub.json with 
my local changes. That's no good.


Why -I flag does not work?

2019-02-09 Thread Victor Porton via Digitalmars-d-learn
For this project: 
https://github.com/vporton/xml-boiler-dlang/tree/85b5587f50617ad1b001c035c72a5780a1e69c24


$ DFLAGS="-I/usr/local/include/d/librdf -L-L/usr/local/lib" dub 
build --compiler=dmd --build=unittest

Performing "unittest" build using dmd for x86_64.
xml-boiler-dlang ~master: building configuration "library"...
source/xmlboiler/options.d(4,8): Error: module `model` is in file 
'rdf/redland/model.d' which cannot be read

import path[0] = source/
import path[1] = ../../.dub/packages/ae-0.0.2331/ae/sys
import path[2] = ../../.dub/packages/ae-0.0.2331/ae/utils
import path[3] = ../../.dub/packages/ae-0.0.2331/ae/net
import path[4] = /snap/dmd/40/bin/../import/druntime
import path[5] = /snap/dmd/40/bin/../import/phobos
dmd failed with exit code 1.
$ ls /usr/local/include/d/librdf/rdf/redland/model.d
/usr/local/include/d/librdf/rdf/redland/model.d
$ dmd --version
DMD64 D Compiler v2.080.1
Copyright (C) 1999-2018 by The D Language Foundation, All Rights 
Reserved written by Walter Bright


Why does -I flag in DFLAGS does not work? (Ubuntu Linux)


Re: Why -I flag does not work?

2019-02-09 Thread Victor Porton via Digitalmars-d-learn

On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton wrote:
$ DFLAGS="-I/usr/local/include/d/librdf -L-L/usr/local/lib" dub 
build --compiler=dmd --build=unittest

...

Why does -I flag in DFLAGS does not work? (Ubuntu Linux)


This does not work too:

$ DFLAGS="-I/usr/local/include/d/librdf -L-L/usr/local/lib" dmd 
-unittest source/xmlboiler/options.d


Why?!


Re: Why -I flag does not work?

2019-02-09 Thread JN via Digitalmars-d-learn

On Saturday, 9 February 2019 at 08:15:36 UTC, Victor Porton wrote:

Why does -I flag in DFLAGS does not work? (Ubuntu Linux)


I'm no expert on dub, but it's possible that it's overriding the 
import path anyway. One of the main points of dub is that you 
shouldn't have to handle the import paths yourself.


I think what could work is adding a librdf in dub.json 
dependencies section, and then using "dub add-local" command to 
point to the library. Something like:


dub add-local /usr/local/include/d/librdf ~master

and then in dependencies section:

"dependencies": {
"librdf": "~master"
}