adamdruppe / arsd

This is a collection of modules that I've released over the years. Most of them stand alone, or have just one or two dependencies in here, so you don't have to download this whole repo.
http://arsd-official.dpldocs.info/arsd.html
531 stars 128 forks source link

cgi.d does not work with musl #174

Closed andre2007 closed 5 years ago

andre2007 commented 5 years ago

I try to compile a server application with musl. Linker fail, just by adding dub dependency to arsd-official:cgi.

.dub/obj/application.o:cgi.d:function _D3std5stdio4File17LockingTextWriter__T3putTyaZQiMFNfyaZ12trustedFPUTCFNbNiNeiPS4core4stdcQDg8_IO_FILEZi: error: undefined reference to '_D3std5stdio14fputc_unlockedFNbNiiPS4core4stdcQBo8_IO_FILEZi'
.dub/obj/application.o:cgi.d:function _D3std5stdio4File17LockingTextWriter__T3putTyaZQiMFNfyaZ13trustedFPUTWCFNbNiNewPS4core4stdcQDh8_IO_FILEZi: error: undefined reference to '_D3std5stdio15fputwc_unlockedFNbNiwPS4core4stdcQBp8_IO_FILEZi'
.dub/obj/application.o:cgi.d:function _D3std5stdio4File17LockingTextWriter__T3putTaZQhMFNfaZ12trustedFPUTCFNbNiNeiPS4core4stdcQDe8_IO_FILEZi: error: undefined reference to '_D3std5stdio14fputc_unlockedFNbNiiPS4core4stdcQBo8_IO_FILEZi'
.dub/obj/application.o:cgi.d:function _D3std5stdio4File17LockingTextWriter__T3putTaZQhMFNfaZ13trustedFPUTWCFNbNiNewPS4core4stdcQDf8_IO_FILEZi: error: undefined reference to '_D3std5stdio15fputwc_unlockedFNbNiwPS4core4stdcQBp8_IO_FILEZi'
.dub/obj/application.o:cgi.d:function _D3std5stdio4File17LockingTextWriter__T3putTxaZQiMFNfxaZ12trustedFPUTCFNbNiNeiPS4core4stdcQDg8_IO_FILEZi: error: undefined reference to '_D3std5stdio14fputc_unlockedFNbNiiPS4core4stdcQBo8_IO_FILEZi'
.dub/obj/application.o:cgi.d:function _D3std5stdio4File17LockingTextWriter__T3putTxaZQiMFNfxaZ13trustedFPUTWCFNbNiNewPS4core4stdcQDh8_IO_FILEZi: error: undefined reference to '_D3std5stdio15fputwc_unlockedFNbNiwPS4core4stdcQBp8_IO_FILEZi'
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1
/home/user/dlang/ldc-1.13.0-beta1/bin/ldc2 failed with exit code 1.

My test application

/+ dub.sdl:
    name "application"
    dependency "arsd-official:cgi" version="~>2.1.2"
    dflags "-mtriple=x86_64-unknown-linux-musl" platform="ldc"
+/
void main(){}

I compile the application from windows using WSL (Ubuntu) with following command

wsl bash -c "source ~/dlang/ldc-1.13.0-beta1/activate && dub build --single app.d -b plain --force"
andre2007 commented 5 years ago

Dustmite is great, std.regex is the issue:

// FIXME: I don't think this class correctly decodes/encodes the individual parts
/// Represents a url that can be broken down or built up through properties
struct Uri {
void reparse() {
        import std.regex;
regex("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?");

        // uriInvalidated = false;
    }

}
andre2007 commented 5 years ago

https://github.com/ldc-developers/ldc/issues/2911

adamdruppe commented 5 years ago

I have been kinda wanting to remove that regex anyway - std.regex consistently sees compile performance regressions and it is making my builds exceedingly slow :(