[Issue 17709] New: std.xml doesn't parse the root element

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17709

  Issue ID: 17709
   Summary: std.xml doesn't parse the root element
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: slavo5...@yahoo.com

import std.xml;
import std.stdio;

void main()
{
auto parser = new DocumentParser("");
parser.onStartTag["device"] = (ElementParser parser)
{
writeln("device");
};
parser.parse();
}

That code does not print "device",  However...

import std.xml;
import std.stdio;

void main()
{
auto parser = new DocumentParser("");
parser.onStartTag["peripheral"] = (ElementParser parser)
{
writeln("peripheral");
};
parser.parse();
}

that code will print "peripheral".

--


[Issue 16744] We should have a TypeOf template so that typeof can be used with templates like staticMap

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16744

--- Comment #12 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/be351ebe20df55b72e7441e43b84cfacee42f8ea
Revert "Fix Issue 16744: Add Typeof"

https://github.com/dlang/phobos/commit/f0eaf4456355f3ed68e4fe078663fbb7ccaf46de
Merge pull request #5664 from dlang/revert-5662-MetaLang-patch-1-3

Revert "Fix Issue 16744: Add Typeof"
merged-on-behalf-of: MetaLang 

--


[Issue 17708] Escape control characters in std.conv.to error messages

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17708

Vladimir Panteleev  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=12260

--


[Issue 12260] Improve error of std.stdio.readf when involving whitespace

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12260

Vladimir Panteleev  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=17708

--


[Issue 17708] New: Escape control characters in std.conv.to error messages

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17708

  Issue ID: 17708
   Summary: Escape control characters in std.conv.to error
messages
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: minor
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: dlang-bugzi...@thecybershadow.net

Currently this program:

/ test.d 
import std.conv;

void main()
{
to!int("\r");
}
/

will produce output which looks like this in a terminal:

' when converting from type string to type intbin/../phobos/std/conv.d(2168):
Unexpected '

??:? pure @safe int std.conv.parse!(int, immutable(char)[]).parse(ref
immutable(char)[]) [0x4331de]
??:? pure @safe int std.conv.toImpl!(int,
immutable(char)[]).toImpl(immutable(char)[]) [0x436a70]
??:? pure @safe int
std.conv.to!(int).to!(immutable(char)[]).to(immutable(char)[]) [0x432a83]
??:? _Dmain [0x432a5d]

The error message appears malformed.

std.conv.to should escape whitespace / control / non-printable characters in
its error messages. Perhaps the existing functionality in std.conv / std.format
can be reused: format!"%(%s%)"(c.only) will already correctly escape such
characters.

See discussion in https://github.com/dlang/phobos/pull/5591 (which fixed this
issue specifically for the newline character only) for more details.

--


[Issue 16744] We should have a TypeOf template so that typeof can be used with templates like staticMap

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16744

--- Comment #11 from github-bugzi...@puremagic.com ---
Commit pushed to revert-5662-MetaLang-patch-1-3 at
https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/be351ebe20df55b72e7441e43b84cfacee42f8ea
Revert "Fix Issue 16744: Add Typeof"

--


[Issue 17707] New: unimported modules in libraries do not have their module constructors run

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17707

  Issue ID: 17707
   Summary: unimported modules in libraries do not have their
module constructors run
   Product: D
   Version: D2
  Hardware: x86_64
OS: All
Status: NEW
  Severity: major
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: john.loughran.col...@gmail.com

First with object files:

% ls
app.d foo.d
% cat app.d
void main() { import core.stdc.stdio; puts("and from here"); }
% cat foo.d
static this() { import core.stdc.stdio; puts("hello"); }
% dmd -c app.d foo.d
% ls
app.d app.o foo.d foo.o
% gcc app.o foo.o -lphobos2
% ./a.out
hello
and from here

Everything looks fine there

% ar rcs foo.a foo.o
% gcc app.o foo.a -lphobos2
% ./a.out
and from here

the module constructor from foo.d has gone missing!

test on macOS and linux, with many different permutations. Splitting the object
file back out of the library makes it work again, so no information is lost.

On macOS it was easy to discover that the result of getsectbynamefromheader_64
for __DATA __minfodata is missing an entry for foo in the library case, but not
in the object case.

--


[Issue 16744] We should have a TypeOf template so that typeof can be used with templates like staticMap

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16744

--- Comment #10 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/d39cc3ff43501a753c14dc1d7461603dc77640ba
Fix Issue 16744: Add Typeof

https://github.com/dlang/phobos/commit/674f87e061ad55a2a2d312b099d32e58404d92ab
Merge pull request #5662 from dlang/MetaLang-patch-1-3

Fix Issue 16744: Add Typeof
merged-on-behalf-of: Stefan Koch 

--


[Issue 12260] Improve error of std.stdio.readf when involving whitespace

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12260

--- Comment #3 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/afc732661a5cbdd69b22d5bffa57fddab76172ad
Fix Issue 12260 - Improve error of std.stdio.readf when involving whitespace

https://github.com/dlang/phobos/commit/63de27b5308b6bdb4e0489cc53e87e603f0c95cf
Merge pull request #5591 from RazvanN7/Issue_12260

Fix Issue 12260 - Improve error of std.stdio.readf when involving whitespace
merged-on-behalf-of: Andrei Alexandrescu 

--


[Issue 6384] std.traits.isComparable

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6384

--- Comment #3 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/24bfb294b7523307d10aaaf41ad2021c6cb38501
Fix Issue 6384 - add std.traits.isComparable

https://github.com/dlang/phobos/commit/a6ef870042c2c569c31173645f01a2ec682fc283
Merge pull request #5566 from RazvanN7/Issue_6384

Fix Issue 6384 - add std.traits.isComparable
merged-on-behalf-of: Andrei Alexandrescu 

--


[Issue 17666] std.c.linux.socket has no replacement

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17666

Sebastiaan Koppe  changed:

   What|Removed |Added

   Assignee|nob...@puremagic.com|m...@skoppe.eu

--


[Issue 17666] std.c.linux.socket has no replacement

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17666

--- Comment #3 from Sebastiaan Koppe  ---
(In reply to Sebastiaan Koppe from comment #2)
> Just so that you know, I am working on a PR to add them to druntime.

I am a bit stuck on the issue.

In src/core/sys/posix/netinet/in_.d there are 2 general sections, one for ipv4
and one for ipv6. In each section constants are defined for CRuntime_Glibc,
Darwin, FreeBSD, NetBSD, Solaris and linux (in that order). Except there is no
linux version for ipv6.

Which makes me wonder how things for linux can actually compile, since basic
things like in6_addr and sockaddr_in6 structures are not defined.

I suppose the CRuntime_Glibc branch is taken, but that would be invalid since
the constants differ slightly with linux.

--


[Issue 17375] colliding modules detected with binutils 2.28 linker and shared libraries

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17375

Thomas Mader  changed:

   What|Removed |Added

 CC||thomas.ma...@gmail.com

--- Comment #10 from Thomas Mader  ---
Had the same problem with binutils 2.28 and dmd 2.075.0 on NixOS with druntime
and phobos.

Working around the problem as suggested with

  make -f posix.mak PIC=-fPIC INSTALL_DIR=$out DMD=$DMD

works for phobos.

But for druntime I needed to patch a Makefile, 

substituteInPlace druntime/test/common.mak \
--replace "DFLAGS:=" "DFLAGS:=-fPIC "

otherwise the link test in the druntime unittests would fail when running with

  make -f posix.mak unittest PIC=-fPIC DMD=$DMD BUILD=release

--


[Issue 15391] Problems loading libcurl.so and running datetime unittest on NixOS package build

2017-07-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15391

--- Comment #8 from Thomas Mader  ---
(In reply to Thomas Mader from comment #3)
> I was able to hack around the issue by patching the curl.d sourcefile.
> 
>   #Ugly hack so the dlopen call has a chance to succeed.
>   substituteInPlace src/phobos/std/net/curl.d --replace libcurl.so
> ${curl}/lib/libcurl.so
> 
> 
> That's in the package description for the dmd package on NixOS. That's
> necessary because in NixOS every package is stored in isolation to
> everything else.
> So libcurl on my system resides in
> /nix/store/v5a69m1b823zm1yy8yvhrd2zi2w385b1-curl-7.44.0/lib/libcurl.so.

With dmd 2.075.0 I also needed to patch the Makefile of phobos to include the
full path to the shared lib:

substituteInPlace phobos/posix.mak \
--replace "-soname=libcurl.so.4" "-soname=${curl.out}/lib/libcurl.so.4"

--