Giter Club home page Giter Club logo

tango-d2's Introduction

Tango for D2

Build Status

Last tested DMDFE: 2.102.2

This is an effort to port Tango to the D2 programming language.

This port roughly follows the guidelines outlined in the porting_guidelines file. If you want to help out, please follow that procedure.

What works so far

Modules that have not been yet ported are located in the unported folder. All those located in the tango folder are ported, in the sense that they pass the import+unittest test (sometimes imperfectly on 64 bits due to DMD bugs). Right now this means that essentially all the user modules (with the exception for tango.math.BigNum, which is aliased to std.bigint until further notice) and a large majority of tango.core modules are ported. Examples in the doc/examples folder should also work.

I do the porting on Linux, so that is the most tested platform. It generally should also compile on Windows, but might not pass all the unit-tests, since DMD does weird things with unittests on Windows. All other platforms probably don't compile at all.

Documentation can be found here: http://siegelord.github.com/Tango-D2/

See Bugs.md for a list of D compiler bugs that affect Tango and possible workabouts for them.

Breaking changes from D1

Since one of the important use cases of this port is porting programs from D1 to D2, breaking changes in functionality have been avoided as much as possible. Sometimes, however, this would introduce hidden heap usage or unsafe operation. Those things are even more detestable, especially for Tango's future, than breaking backwards compatibility. Cases where changes were introduced are documented here.

  • tango.sys.Process
    • args no longer returns the program name as the first element. Get it from programName property instead.

Installation

From packages

jordisayol maintains a APT repository with a reasonably recent version of Tango-D2 available there. Worth a try if you're using a Debian based OS. To use it, follow the directions on this website: https://code.google.com/p/d-apt/wiki/APT_Repository .

From source

It is possible to use the binary bob building tool (located in build/bin/*/bob) like so:

64-bit Linux

cd PathToTango
./build/bin/linux64/bob -vu .

Windows

cd PathToTango
build\bin\win32\bob.exe -vu .

LDC2 is the primary testing compiler, but DMD seems to compile the library as well.

There is also an experimental Makefile building system. You can invoke it like so (modify the parameters you pass to make to suit preference):

cd PathToTango
make -f build/Makefile static-lib -j4 DC=ldc2
make -f build/Makefile install-static-lib install-modules DC=ldc2

Notable version statements

Define the following version statements to customize your build of the library:

  • NoPhobos - Removes the Phobos2 dependencies from tango (tango.math.BigInt is the only dependency right now)
  • TangoDemangler - Use Tango's old demangler instead of Druntime's

License

See LICENSE.txt

tango-d2's People

Contributors

bioinfornatics avatar bitraft avatar ciechowoj avatar cybershadow avatar denis-sh avatar dhasenan avatar genuinelucifer avatar igorstepanov avatar jacob-carlborg avatar john-colvin avatar n8sh avatar siegelord avatar siegelordex avatar wilsonk avatar yilabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tango-d2's Issues

Can't compile on Windows x64 with dmd64 -m64

Error message:

../build/bin/win32/bob.exe -uv -c=dmd -p=windows ..

dmd -c -I.. -release -oftango-core-Array-release.obj ../tango/core/Array.d1
dmd -c -I.. -release -oftango-core-ArrayLiteral-release.obj ../tango/core/ArrayLiteral.d
dmd -c -I.. -release -oftango-core-BitArray-release.obj ../tango/core/BitArray.d

object.Exception@.\build\src\bob.d(632): Process exited normally with return code 1
Unsupported environment; neither Win32 or Posix is declared
..\tango\sys\Common.d(88): Error: static assert (0) is false

Probably there should be a check for version(Windows) instead of version(Win32)
(mostly fixed by find&replace in files regex " ^\s_version\s_(\s_Win32\s_)\s*$ " to "version(Windows)")

Platform: Windows 8 x64, intel core i5
Compiler: Custom-compiled 64-bit dmd (dmd version line: DMD64 D Compiler v2.064)

Time module has no timezone / DST support

This is work that I am willing to do. However, there are some open questions I have, and it's unclear to me whether Tango is intended to be the subject of ongoing new development or just in maintenance mode.

tango.time.* doesn't support timezones or DST. Also, it's unclear what TimeOfDay is supposed to represent. If TimeOfDay.hour is set to 3, for instance, does that mean "when the clock shows 3" or "3 hours into the day"? While this is usually the same, it's not always -- for instance, on 1 November where I live, the third hour of the day was 2am (as was the second), and in March there will be a day where the third hour of the day is 4am.

Without these two things, DateTime can only represent UTC times.

There's also a lot of complexity and annoyance with Calendar.

It looks a lot like the Java date/time library, and that's notoriously bad.

I'd like to write a replacement. Something that makes it convenient to use the Gregorian calendar and timezones, and certainly something that makes it convenient to format dates and parse them.

There is one essential problem I've been concerned with. When I have a datetime with a timezone, I can treat it as a point in time primarily, or I can treat it as a representation of what a person will see on a calendar and clock first and foremost.

The former approach means it's safe to work with daylight saving time, but it's harder to work with changes in timezones. The latter means it's tricky to work with daylight saving time, but it's trivial to handle timezone updates.

For instance: I set an appointment for 2020-11-01 12:00:00 in timezone America/Los_Angeles. With the point-in-time approach, this converts to Unix timestamp 1604260800. Next year, the US decides to do away with DST, leaving us on summer time all year long. I originally set the meeting for noon local time, which now corresponds to Unix timestamp 1604257200. So what does that mean? My appointment is now an hour off.

Alternatively, we could store the time as if someone in that timezone wrote down their current date and time and timezone. This makes timezone updates work as expected, but now we find it difficult to add a timespan to a datetime. If, for instance, your datetime says (2015, 11, 1, 2, "America/Los_Angeles") and you add an hour, it's ambiguous whether the result should have an hour of 2 or 3.

Probably the safest way would be to store both the point in time and the human-readable timestamp. The timestamp is primary; the point in time disambiguates for DST.

There are some other decisions such as when to read tz data and how to make up for Windows's terrible handling of timezone / DST changes. I'm seeing articles that say people saw Windows apps reporting the wrong times for past events after the US changed its DST start and end dates circa 2007, and the API seems to assume a timezone is two fixed UTC offsets with a simple recurrence for switching between the two. On Posix systems, we can just read the timezone db off disk, of course, and that includes proper history. We could import timezonedb and include it as static data on Windows, mark the date of import, and use that for any dates before the import date, while using Windows timezone info for stuff later than that...it's tough, and a second opinion would be helpful.

For Posix, creating a datetime will sometimes cause disk IO. That's unfortunate. However, it's difficult / impossible to have up-to-date timezone data otherwise without causing annoying maintenance issues. (There's a timezone update? Better recompile Tango and then relink and redeploy your application! ...no. But since Windows doesn't offer anything better...)

Anyway, the goal for the new modules is to make it easy to work with datetimes (skip Date without a time; skip TimeOfDay) and timezones correctly, assuming the idealized Gregorian calendar. That means correct time arithmetic. It means easy parsing and formatting. It means accurate serialization and deserialization. It means not exposing a type that represents a datetime without a timezone.

errors compiling Tango2 with dmd 2.059 beta

tango/time/Time.d(487): Error: variable tango.time.Time.Time.epoch enum cannot be initialized with {0}

tango/sys/Process.d(527): Error: cannot implicitly convert expression (this._env) of type const(char[][const(char)[]]) to const(char[])[const(char)[]]

no property PathSeparatorChar for type tango.io.model.IFile.FileConst

Using this file:

https://github.com/SiegeLord/Tango-D2/blob/d2port/doc/example/networking/httpget.d

I get this result:

$ dub
Performing "debug" build using C:\dmd2\windows\bin\dmd.exe for x86_64.
tango 1.0.5+2.0.85: building configuration "static"...
Unsupported environment; neither Win32 or Posix is declared
C:\Users\Steven\AppData\Local\dub\packages\tango-1.0.5_2.0.85\tango\tango\io\
FilePath.d(638,69):
Error: no property PathSeparatorChar for type tango.io.model.IFile.FileConst

building example with gdc

Hi, I've seen that GDC is not really supported, but maybe you have some clue on how to solve this issue, since TANGO is built with GDC but issue is using the library from any module.
I have a module that only imports tango.io.Stdout. When built with DMD there are no problems, with GDC I get the following error:

$ gdc -I/usr/local/include/d -I/opt/gdc/include/d/4.8.1 newmain.d -ot.o -ltango-gdc
/usr/local/lib/libtango-gdc.a(Buffered.o):(.data+0xc4): undefined reference to `_DT36_D5tango2io6device7Conduit12OutputFilter7conduitMFNdZC5tango2io5model8IConduit8IConduit'
/usr/local/lib/libtango-gdc.a(Buffered.o):(.data+0xcc): undefined reference to `_DT36_D5tango2io6device7Conduit12OutputFilter5closeMFZv'
/usr/local/lib/libtango-gdc.a(Buffered.o):(.data+0xd8): undefined reference to `_DT36_D5tango2io6device7Conduit12OutputFilter6outputMFNdZC5tango2io5model8IConduit12OutputStream'
/usr/local/lib/libtango-gdc.a(Buffered.o):(.data+0x184): undefined reference to `_DT36_D5tango2io6device7Conduit11InputFilter7conduitMFNdZC5tango2io5model8IConduit8IConduit'
/usr/local/lib/libtango-gdc.a(Buffered.o):(.data+0x18c): undefined reference to `_DT36_D5tango2io6device7Conduit11InputFilter5closeMFZv'
/usr/local/lib/libtango-gdc.a(Buffered.o):(.data+0x198): undefined reference to `_DT36_D5tango2io6device7Conduit11InputFilter5inputMFNdZC5tango2io5model8IConduit11InputStream'
collect2: error: ld returned 1 exit status

gdc is at the latest version on github. commit d2a4df411a81573c621cfb878e201223ab6c3d62

Thanks

tango/time/ISO8601.d unittest failure

Happens with dmd 2.065 but not with LDC v2.063.2:

[email protected](1366): unittest failure
----------------
.unittest/out(_d_unittestm+0x47) [0x427327]
.unittest/out(void tango.time.ISO8601.__unittest_fail(int)+0x1a) [0x4232ea]
.unittest/out(void tango.time.ISO8601.__unittestL913_1()+0x2d8a) [0x420e62]
.unittest/out(void tango.time.ISO8601.__modtest()+0x9) [0x423289]
.unittest/out(int core.runtime.runModuleUnitTests().__foreachbody3(ref object.ModuleInfo*)+0x30) [0x42b4cc]
.unittest/out(int rt.minfo.moduleinfos_apply(scope int delegate(ref object.ModuleInfo*)).__foreachbody2(ref rt.sections_linux.DSO)+0x4c) [0x429168]
.unittest/out(int rt.sections_linux.DSO.opApply(scope int delegate(ref rt.sections_linux.DSO))+0x42) [0x4291de]
.unittest/out(int rt.minfo.moduleinfos_apply(scope int delegate(ref object.ModuleInfo*))+0x25) [0x429101]
.unittest/out(runModuleUnitTests+0xae) [0x42b362]
.unittest/out(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x17) [0x427c67]
.unittest/out(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x427c1a]
.unittest/out(_d_run_main+0x1a3) [0x427b9b]
.unittest/out(main+0x17) [0x41d97f]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f51456c9de5]

errors compiling with dmd 2.062 (release)

$ dmd -c -O -release -m32 -ofobj/32/tango/io/FileScan.o tango/io/FileScan.d
tango.io.FileScan is deprecated. Please use tango.io.FilePath.toList or tango.io.vfs.* instead.

$ dmd -c -O -release -m32 -ofobj/32/tango/io/device/SerialPort.o tango/io/device/SerialPort.d
tango/core/Array.d(84): Error: argument const(char)[][][0u] to typeof is not an expression
tango/core/Array.d(2293): Error: template instance tango.core.Array.ElemTypeOf!(const(char)[][]) error instantiating
tango/io/device/SerialPort.d(193):        instantiated from here: sort!(const(char)[][])
tango/core/Array.d(2293): Error: cannot return non-void from void function
tango/io/device/SerialPort.d(193): Error: template instance tango.core.Array.sort!(const(char)[][]) error instantiating

$ dmd -c -O -release -m32 -ofobj/32/tango/math/BigInt.o tango/math/BigInt.d
tango.math.BigInt is deprecated. Please use std.bigint instead.

$ dmd -c -O -release -m32 -ofobj/32/tango/core/tools/LinuxStackTrace.o tango/core/tools/LinuxStackTrace.d
tango/core/Array.d(84): Error: argument const(char)[][0u] to typeof is not an expression
tango/core/Array.d(188): Error: template instance tango.core.Array.ElemTypeOf!(const(char)[]) error instantiating
tango/core/tools/LinuxStackTrace.d(569):        instantiated from here: find!(const(char)[], string)
tango/core/tools/LinuxStackTrace.d(569): Error: template instance tango.core.Array.find!(const(char)[], string) error instantiating

$ dmd -c -O -release -m32 -ofobj/32/tango/net/ftp/FtpClient.o tango/net/ftp/FtpClient.d
tango/net/ftp/FtpClient.d(919):        instantiated from here: find!(const(char)[], char)
tango/net/ftp/FtpClient.d(919): Error: template instance tango.core.Array.find!(const(char)[], char) error instantiating

$ dmd -c -O -release -m64 -ofobj/64/tango/io/device/SerialPort.o tango/io/device/SerialPort.d
tango/core/Array.d(84): Error: argument const(char)[][][0LU] to typeof is not an expression

$ dmd -c -O -release -m64 -ofobj/64/tango/core/tools/LinuxStackTrace.o tango/core/tools/LinuxStackTrace.d
tango/core/Array.d(84): Error: argument const(char)[][0LU] to typeof is not an expression

tango.text.Regex

Do the same thing to it as I did to tango.io.Path.PathParser.

compiler with ldc 1.12 is error

error info is :
hyy@hyy-Dell:~/dev/dlang/tango$ dub build --build=release --arch=x86_64 --compiler=ldc
Fetching tango 1.0.4+2.0.83 (getting selected version)...
Performing "release" build using ldc for x86_64.
tango 1.0.4+2.0.83: building configuration "static"...
../../../.dub/packages/tango-1.0.4_2.0.83/tango/tango/core/Vararg.d(43,19): Error: module vararg is in file 'ldc/vararg.d' which cannot be read
import path[0] = ../../../.dub/packages/tango-1.0.4_2.0.83/tango
import path[1] = /usr/local/ldc2-1.12.0-linux-x86_64/bin/../import/ldc
import path[2] = /usr/local/ldc2-1.12.0-linux-x86_64/bin/../import
ldc failed with exit code 1.

Error compiling with dmd v2.065.0 final release

$ dmd -c -O -release -fPIC -m64 -ofobj/64/tango/math/BigInt.o tango/math/BigInt.d
tango.math.BigInt is deprecated. Please use std.bigint instead.

$ dmd -c -O -release -fPIC -m64 -ofobj/64/tango/io/stream/Patterns.o tango/io/stream/Patterns.d
tango/text/Regex.d(2524): Error: associative array key type TagIndex does not have 'const int opCmp(ref const TagIndex)' member function
tango/text/Regex.d(3676): Error: template instance tango.text.Regex.TDFA!dchar error instantiating
tango/text/Regex.d(4420):        instantiated from here: RegExpT!char
tango/text/Regex.d(4407): Error: tdfa_t.Command is used as a type
tango/text/Regex.d(4420): Error: template instance tango.text.Regex.RegExpT!char error instantiating

$ dmd -c -O -release -fPIC -m64 -ofobj/64/tango/io/FileScan.o tango/io/FileScan.d
tango.io.FileScan is deprecated. Please use tango.io.FilePath.toList or tango.io.vfs.* instead.

$ dmd -c -O -release -fPIC -m64 -ofobj/64/tango/text/Regex.o tango/text/Regex.d
tango/text/Regex.d(2524): Error: associative array key type TagIndex does not have 'const int opCmp(ref const TagIndex)' member function
tango/text/Regex.d(3676): Error: template instance tango.text.Regex.TDFA!dchar error instantiating
tango/text/Regex.d(4420):        instantiated from here: RegExpT!char
tango/text/Regex.d(4407): Error: tdfa_t.Command is used as a type
tango/text/Regex.d(4420): Error: template instance tango.text.Regex.RegExpT!char error instantiating

$ dmd -c -O -release -fPIC -m64 -ofobj/64/tango/net/device/Berkeley.o tango/net/device/Berkeley.d
tango/net/device/Berkeley.d(2282): Error: cannot implicitly convert expression (cast(ulong)cast(uint)s % this.nfdbits) of type ulong to int

errors compiling with dmd 2.061 (alpha)

tango/sys/SharedLib.d(251): Error: Cannot modify 'this'
tango/core/BitArray.d(867): Error: function tango.core.BitArray.BitArray.opAssign (bool[] bits) is not callable using argument types (BitArray)
tango/core/BitArray.d(867): Error: cannot implicitly convert expression (this.dup()) of type BitArray to bool[]
tango/core/BitArray.d(892): Error: function tango.core.BitArray.BitArray.opAssign (bool[] bits) is not callable using argument types (BitArray)
tango/core/BitArray.d(892): Error: cannot implicitly convert expression (this.dup()) of type BitArray to bool[]

erros compiling with dmd 2.060 (beta)

I got these errors:

$ dmd -c -O -release -m32 -ofobj/32/tango/io/Stdout.o tango/io/Stdout.d
tango/text/convert/Layout.d(657): Error: function tango.text.convert.Layout.Layout!(char).Layout.parse.process (TypeInfo _ti, void* _arg) is not callable using argument types (const(TypeInfo),void*)
tango/text/convert/Layout.d(657): Error: cannot implicitly convert expression (tiVal) of type const(TypeInfo) to object.TypeInfo
tango/text/convert/Layout.d(686): Error: function tango.text.convert.Layout.Layout!(char).Layout.parse.process (TypeInfo _ti, void* _arg) is not callable using argument types (const(TypeInfo),void*)
tango/text/convert/Layout.d(686): Error: cannot implicitly convert expression (elTi) of type const(TypeInfo) to object.TypeInfo

Stdout infinite loop and crash in Windows program

With the following program:

import tango.io.Stdout;

extern(Windows)
int MessageBoxW(void* hWnd, const(wchar)* lpText, const(wchar)* lpCaption, uint uType);

void main() {
    Stdout.format("Bye, world").newline;
    MessageBoxW(null, "The program opened.", "Opened", 0);
}

On Windows 7 64-bit, if you compile the program as a Windows program instead of a console program using

rdmd -ofmain.exe -I..\Tango ..\Tango\libtango-dmd.lib -L/EXETYPE:NT -L/SUBSYSTEM:WINDOWS:4.0 main.d

Then when the program is run from the console, the process will go into an infinite loop instead of exiting. If you try double clicking the program in Explorer, it silently dies, presumably because it threw an exception. I tried on Windows XP, and the program opens when double clicked but still goes into an infinite loop at exit.

tango.text.Util is a mess

Try to figure out how to make it work nicely. Note that inout everywhere does NOT work, since I haven't been able to get fructs to work with them.

errors 2.067

Building tango 1.0.1+2.067 configuration "static", build type debug.
Running dmd...
tango.io.FileScan is deprecated. Please use tango.io.FilePath.toList or tango.io.vfs.* instead.
tango.math.BigInt is deprecated. Please use std.bigint instead.
not yet available for windows
tango\io\selector\SelectSelector.d(156): Error: cannot modify struct this._readSet HandleSet with immutable members
tango\io\selector\SelectSelector.d(157): Error: cannot modify struct this._writeSet HandleSet with immutable members
tango\io\selector\SelectSelector.d(158): Error: cannot modify struct this._exceptionSet HandleSet with immutable members
tango\io\selector\SelectSelector.d(159): Error: cannot modify struct this._selectedReadSet HandleSet with immutable members
tango\io\selector\SelectSelector.d(160): Error: cannot modify struct this._selectedWriteSet HandleSet with immutable members
tango\io\selector\SelectSelector.d(161): Error: cannot modify struct this._selectedExceptionSet HandleSet with immutable members
tango\math\IEEE.d(858): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<='
tango\stdc\math.d(436): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>'
tango\stdc\math.d(437): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>'
tango\stdc\math.d(438): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>'
tango\stdc\math.d(441): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>='
tango\stdc\math.d(442): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>='
tango\stdc\math.d(443): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>='
tango\stdc\math.d(446): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<'
tango\stdc\math.d(447): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<'
tango\stdc\math.d(448): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<'
tango\stdc\math.d(451): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<='
tango\stdc\math.d(452): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<='
tango\stdc\math.d(453): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<='
tango\stdc\math.d(456): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<>'
tango\stdc\math.d(457): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<>'
tango\stdc\math.d(458): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<>'
FAIL .dub\build\static-debug-windows-x86-dmd_2067-9C02248FA20BAB6DD8CA236C26D31263\ tango staticLibrary
Error executing command run:
dmd failed with exit code 1.

tango.net.util.c.OpenSSL Requires OpenSSL <= 1.0.0

Don't know where/how to document this, but it is important because it's what causes the test suite to fail on OS X. OS X has deprecated OpenSSL and hasn't upgraded it's shipped version since pre-1.0

for those on OS X using homebrew

brew install openssl
brew link --force openssl

will do the trick.

fix bug for mac os x 10.7

diff --git a/tango/stdc/fenv.d b/tango/stdc/fenv.d
index c454131..e1f92ed 100644
--- a/tango/stdc/fenv.d
+++ b/tango/stdc/fenv.d
@@ -126,8 +126,8 @@ else version( linux )
}
else version( darwin )
{

  • private extern fenv_t _FE_DFL_ENV;
  • fenv_t* FE_DFL_ENV = &_FE_DFL_ENV;
  • private extern const fenv_t _FE_DFL_ENV;
  • const fenv_t* FE_DFL_ENV = &_FE_DFL_ENV;
    }
    else version( freebsd )
    {
    @@ -136,7 +136,7 @@ else version( freebsd )
    }
    else version( solaris )
    {
  • private extern constfenv_t __fenv_dfl_env;
  • private extern const fenv_t __fenv_dfl_env;
    const fenv_t* FE_DFL_ENV = &__fe_dfl_env;
    }
    else
    diff --git a/tango/stdc/posix/sys/select.d b/tango/stdc/posix/sys/select.d
    index d972bd3..ed46785 100644
    --- a/tango/stdc/posix/sys/select.d
    +++ b/tango/stdc/posix/sys/select.d
    @@ -133,7 +133,7 @@ else version( darwin )
 extern (D) int __FDELT( int d )
 {
  •        return d / __NFDBITS;
    
  •        return d / cast(int)__NFDBITS;
     }
    
     extern (D) __fd_mask __FDMASK( int d )
    

Error 42: Symbol Undefined

$ cat aa.d
import tango.io.Console;
void main() {
   Cout("abcde").newline;
}

$ dmd aa.d libtango-dmd.lib
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
libtango-dmd.lib(WinStackTrace)
 Error 42: Symbol Undefined _D4core6thread5Fiber3runMFZv
libtango-dmd.lib(SelectSelector)
 Error 42: Symbol Undefined _select@20
Error: linker exited with status 2

Version tags for Dub

Dub is about to remove/deprecate the use branches for dependencies in favor of only using version tags. It would be great if we could start adding version tags. Preferably using semantic versioning: http://semver.org/.

Unexpected redirect for method GET

When using HttpGet to fetch a resource which is redirected I get the above exception. The reason is that is is used to compare manifest constants [1]. This comparison will always be false when using HttpGet. That's because with manifest consonants the usage is replaced with the actual values, resulting in two different strings (in memory) [2].

[1] https://github.com/SiegeLord/Tango-D2/blob/d2port/tango/net/http/HttpClient.d#L577
[2] https://github.com/SiegeLord/Tango-D2/blob/d2port/tango/net/http/HttpGet.d#L61

Strange error using tango.util.compress.Zip

When I run the following example I get files with strange names all over the working directory. Names like !%AF, ?? and similar. On 64bit I get one file. On 32bit I get around 20 files.

import tango.util.compress.Zip;

void main ()
{
    auto src = "path/to.zip";
    auto dest = "tmp";

    extractArchive(src, dest);
}

I'm using Mac OS X.

Unable

I've tried to compile the master with 3.7 but it gives me the following compile error.

dmd -O -m64 -L-ldl -m64 -c tango/math/Probability.d -ofobjs/tango/math/Probability.o tango/math/IEEE.d(858): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<=' dmd -O -m64 -L-ldl -m64 -c tango/math/random/ExpSource.d -ofobjs/tango/math/random/ExpSource.o dmd -O -m64 -L-ldl -m64 -c tango/math/random/Kiss.d -ofobjs/tango/math/random/Kiss.o dmd -O -m64 -L-ldl -m64 -c tango/math/random/NormalSource.d -ofobjs/tango/math/random/NormalSource.o tango.math.BigInt is deprecated. Please use std.bigint instead. tango/io/vfs/ZipFolder.d(302): Error: function tango.io.vfs.ZipFolder.ZipSubFolder.toString cannot have an in contract when overriden function object.Object.toString does not have an in contract tango/io/vfs/ZipFolder.d(977): Error: function tango.io.vfs.ZipFolder.ZipFile.toString cannot have an in contract when overriden function object.Object.toString does not have an in contract dmd -O -m64 -L-ldl -m64 -c tango/math/random/Random.d -ofobjs/tango/math/random/Random.o dmd -O -m64 -L-ldl -m64 -c tango/math/random/Twister.d -ofobjs/tango/math/random/Twister.o dmd -O -m64 -L-ldl -m64 -c tango/math/random/Ziggurat.d -ofobjs/tango/math/random/Ziggurat.o build/Makefile:131: recipe for target 'objs/tango/io/vfs/ZipFolder.o' failed make: *** [objs/tango/io/vfs/ZipFolder.o] Error 1 make: *** Waiting for unfinished jobs.... ==> ERROR: A failure occurred in build().

Error running when compiling on Debian 64-bit with dmd v2.064.2

A simple:

import tango.io.Stdout;

void main()
{
    Stdout("hello tango!").newline;
}

If compiled against tango shared library, I got this error when running:

$ ./test
object.Exception@tango/net/util/c/OpenSSL.d(1012): Could not load OpenSSL library.
----------------
Segmentation fault encountered at:
Segmentation fault

It properly runs when compiled with dmd v2.063.2

tango.util.Convert

I hit a dmd bug trying to get it working (http://d.puremagic.com/issues/show_bug.cgi?id=7418), either wait for it to get fix or find a workabout. Specifically the issue is with this method:

static if( is( T : const(char[]) ) )
        alias tango.text.convert.Utf.toString toString_;

    else static if( is( T : const(wchar[]) ) )
        alias tango.text.convert.Utf.toString16 toString_;

    else
        alias tango.text.convert.Utf.toString32 toString_;
}

Compilation error

There is a compilation error in tango\io\FileSystem.d
line 242:

volPath_[0..4] = \\.\;

It is complaining about wide string conversion. To solve just add an w:

volPath_[0..4] = \\.\w;

errors/ deprecations compiling with dmd 2.067.0

tango/stdc/math.d(436): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>'
tango/stdc/math.d(437): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>'
tango/stdc/math.d(438): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>'
tango/stdc/math.d(441): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>='
tango/stdc/math.d(442): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>='
tango/stdc/math.d(443): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!>='
tango/stdc/math.d(446): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<'
tango/stdc/math.d(447): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<'
tango/stdc/math.d(448): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<'
tango/stdc/math.d(451): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<='
tango/stdc/math.d(452): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<='
tango/stdc/math.d(453): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<='
tango/stdc/math.d(456): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<>'
tango/stdc/math.d(457): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<>'
tango/stdc/math.d(458): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<>'
tango/math/IEEE.d(858): Deprecation: use std.math.isNaN to deal with NaN operands rather than floating point operator '!<='
tango.math.BigInt is deprecated. Please use std.bigint instead.
tango/sys/Process.d(461): Error: escaping reference to variadic parameter args
tango/text/Regex.d(3781): Deprecation: this is not an lvalue
tango.io.FileScan is deprecated. Please use tango.io.FilePath.toList or tango.io.vfs.* instead.
tango/core/BitArray.d(112): Error: redundant attribute 'const'
tango/core/BitArray.d(469): Error: redundant attribute 'const'
tango/io/vfs/ZipFolder.d(48): Error: struct tango.io.vfs.ZipFolder.Entry destructors, postblits and invariants are not allowed in overlapping fields dir and file
tango/text/locale/Convert.d(367): Error: variable tango.time.chrono.Calendar.Calendar.JAPAN is not accessible from module Convert
tango/text/locale/Core.d(697): Error: variable tango.time.chrono.Calendar.Calendar.JAPAN is not accessible from module Core
tango/text/locale/Core.d(699): Error: variable tango.time.chrono.Calendar.Calendar.TAIWAN is not accessible from module Core
tango/text/locale/Core.d(701): Error: variable tango.time.chrono.Calendar.Calendar.KOREA is not accessible from module Core
tango/text/locale/Core.d(703): Error: variable tango.time.chrono.Calendar.Calendar.HIJRI is not accessible from module Core
tango/text/locale/Core.d(705): Error: variable tango.time.chrono.Calendar.Calendar.THAI is not accessible from module Core
tango/text/locale/Core.d(707): Error: variable tango.time.chrono.Calendar.Calendar.HEBREW is not accessible from module Core
tango/text/locale/Core.d(709): Error: variable tango.time.chrono.Calendar.Calendar.GREGORIAN_US is not accessible from module Core
tango/text/locale/Core.d(710): Error: variable tango.time.chrono.Calendar.Calendar.GREGORIAN_ME_FRENCH is not accessible from module Core
tango/text/locale/Core.d(711): Error: variable tango.time.chrono.Calendar.Calendar.GREGORIAN_ARABIC is not accessible from module Core
tango/text/locale/Core.d(712): Error: variable tango.time.chrono.Calendar.Calendar.GREGORIAN_XLIT_ENGLISH is not accessible from module Core
tango/text/locale/Core.d(713): Error: variable tango.time.chrono.Calendar.Calendar.GREGORIAN_XLIT_FRENCH is not accessible from module Core
tango/text/convert/DateTime.d(745): Error: variable tango.time.chrono.Calendar.Calendar.JAPAN is not accessible from module DateTime
tango/sys/linux/consts/socket.d(115): Error: enum member tango.sys.linux.consts.socket.AI_PASSIVE unmatched --- in DDoc comment
tango/sys/linux/consts/socket.d(128): Error: enum member tango.sys.linux.consts.socket.EAI_BADFLAGS unmatched --- in DDoc comment
tango/sys/linux/consts/socket.d(133): Error: enum member tango.sys.linux.consts.socket.EAI_FAMILY unmatched --- in DDoc comment
tango/sys/linux/consts/socket.d(134): Error: enum member tango.sys.linux.consts.socket.EAI_SOCKTYPE unmatched --- in DDoc comment
tango/sys/linux/consts/socket.d(135): Error: enum member tango.sys.linux.consts.socket.EAI_SERVICE unmatched --- in DDoc comment
dmd -o- doc/candydoc/modules.ddoc doc/candydoc/candy.ddoc -Dfdoc/tango_net_device_Berkeley.html tango/net/device/Berkeley.d
Error: radix 10 digit expected, not 'b'

error on tango/text/Util.d with dmd 2.059

tango/text/Util.d(1383): Error: delegate dg (ref const(char)[] token) is not callable using argument types (char[])
tango/text/Util.d(1391): Error: delegate dg (ref const(char)[] token) is not callable using argument types (char[])

ref required when struct declares opCmp

In tango.time.Time, I had to change

    const int opCmp(const(TimeSpan) t)

and

    const int opCmp (const(Time) t)

into

    const int opCmp(ref const(TimeSpan) t)

and

    const int opCmp (ref const(Time) t)

(see http://dlang.org/operatoroverloading.html#compare)

Otherwise, for example tango.util.container.SortedMap with Time or TimeSpan keys does not work correctly.
The compareKey function calls TypeInfo_Struct.compare, and this function requires the ref for opCmp to be callled.

failed to build under win32

Error message:can't find tango/sys/win32?

What if I build tangoD2 by the normal way:
dmd @buildfile.rsp -O -release -inline -ofTango.lib

Could you please figure me out?Thanks .

changes needed to build on win7-64, dmd2.058

G:\d\tango\Tango-D2>git diff
diff --git a/tango/stdc/fenv.d b/tango/stdc/fenv.d
index 92e54f1..998ac32 100644
--- a/tango/stdc/fenv.d
+++ b/tango/stdc/fenv.d
@@ -117,8 +117,8 @@ enum

version( Win32 )
{

  • private extern fenv_t _FE_DFL_ENV;
  • fenv_t* FE_DFL_ENV = &_FE_DFL_ENV;
  • private extern const fenv_t _FE_DFL_ENV;
  • const fenv_t* FE_DFL_ENV = &_FE_DFL_ENV;
    }
    else version( linux )
    {
    diff --git a/tango/sys/Process.d b/tango/sys/Process.d
    index f5705b0..a1aee2c 100644
    --- a/tango/sys/Process.d
    +++ b/tango/sys/Process.d
    @@ -1106,7 +1106,7 @@ class Process
     void append_arg(const(char)[] arg)
     {
  •                     const(char)[] nextarg = a.substitute(`"`, `\"`);
    
  •                     const(char)[] nextarg = arg.substitute(`"`, `\"`);
           //
           // find all instances where \" occurs, and double all the
           // backslashes.  Otherwise, it will fall under rule 1, and those
    

G:\d\tango\Tango-D2>

slow execution when shared linking

Runtime speed varies a lot for examples/concurrency/ThreadFiberGCStress.d depending is statically or dynamically linked.

Static:

$ $ dmd -I/usr/include/dmd -defaultlib=libphobos2.a -L-l:libtango-dmd.a -L-l:libbz2.a -L-l:libdl.so ThreadFiberGCStress.d
$ time ./ThreadFiberGCStress
...
real    0m0.086s
user    0m0.056s
sys     0m0.020s

Dynamic:

$ dmd -I/usr/include/dmd -defaultlib=libphobos2.so -L-l:libtango-dmd.so -L-l:libbz2.so -L-l:libdl.so ThreadFiberGCStress.d
$ time ./ThreadFiberGCStress
...
real    0m1.823s
user    0m1.588s
sys     0m0.032s

Runtime conflict with druntime

There are some conflicts between the functionality in tango.core.Runtime and core.runtime. For example, the unit test runner in Tango seems to override the one in druntime.

BTW why are some parts of the Tango runtime left, like:

tango.core. -

  • Runtime
  • Thread
  • Vararg
  • Memory

Varargs in general

Get them to work consistently for all platforms. Specific modules to look into are tango.core.Variant and tango.text.convert.Layout

tango.core.Vararg does not compile with current LDC

As of at least ldc2 version 1.24.0 the import ldc.vararg does not exist.

Demonstration:

#!/usr/bin/env dub --single --compiler=ldc2
/+dub.sdl:
dependency "tango" version="~>1.0.5+2.0.85"
+/
import tango.core.Vararg;
void main()
{
}

Trying to run the above file fails with:

.../tango/core/Vararg.d(43,19): Error: module vararg is in file 'ldc/vararg.d' which cannot be read

errors compiling with dmd 2.063.2 (windows)

object.Exception@.\build\src\bob.d(632): Process exited normally with return code 1
.\tango\core\tools\WinStackTrace.d(423): Error: argument uint[][0u] to typeof is not an expression
.\tango\core\tools\WinStackTrace.d(423): Error: argument uint[][0u] to typeof is not an expression
.\tango\core\tools\WinStackTrace.d(198): Error: template instance tango.core.tools.WinStackTrace.alloc!(uint[], const(int)) error instantiating
.\tango\core\tools\WinStackTrace.d(519): Error: argument AddrDebugInfo[][0u] to typeof is not an expression
.\tango\core\tools\WinStackTrace.d(519): Error: argument AddrDebugInfo[][0u] to typeof is not an expression
.\tango\core\tools\WinStackTrace.d(976): Error: template instance tango.core.tools.WinStackTrace.append!(AddrDebugInfo[], AddrDebugInfo) error instantiating
.\tango\core\tools\WinStackTrace.d(423): Error: argument char[][0u] to typeof is not an expression
.\tango\core\tools\WinStackTrace.d(423): Error: argument char[][0u] to typeof is not an expression
.\tango\core\tools\WinStackTrace.d(987): Error: template instance tango.core.tools.WinStackTrace.alloc!(char[], uint) error instantiating
.\tango\core\tools\WinStackTrace.d(519): Error: argument char_[][0u] to typeof is not an expression
.\tango\core\tools\WinStackTrace.d(519): Error: argument char_[][0u] to typeof is not an expression
.\tango\core\tools\WinStackTrace.d(990): Error: template instance tango.core.tools.WinStackTrace.append!(char_[], char_) error instantiating

Windows Bob is not executable

These files are all marked "Executable File":

This file is not:

https://github.com/SiegeLord/Tango-D2/blob/d2port/build/bin/win32/bob.exe

this can cause problems with Windows:

$ git clone --depth 1 git://github.com/SiegeLord/Tango-D2
$ cd Tango-D2
$ build/bin/win32/bob
sh: build/bin/win32/bob: Permission denied

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.