RejectedSoftware Forums

Sign up

Building vibenews

Hi,

Using dmd v2.066.1 I am unable to build vibenews:

$ dub build
Target vibe-d 0.7.22 is up to date. Use --force to rebuild.
Target antispam 0.0.5 is up to date. Use --force to rebuild.
Target userman 0.2.0 is up to date. Use --force to rebuild.
Building vibenews 0.6.4+commit.4.g361e94e configuration "application", build type debug.
Compiling using dmd...
Compiling diet template 'vibenews.admin.index.dt'...
Compiling diet template 'vibenews.admin.editcategory.dt'...
Compiling diet template 'vibenews.admin.editgroup.dt'...
Compiling diet template 'vibenews.admin.listarticles.dt' (compat)...
Compiling diet template 'vibenews.admin.listusers.dt' (compat)...
vibenews.admin.listusers.dt(49): Error: no property '_id' for type 'UserInfo'
vibenews.admin.listusers.dt(52): Error: template std.array.join cannot deduce function from argument types !()(ID!(Group)[], string), candidates are:
/usr/include/dmd/phobos/std/array.d(1638):        std.array.join(RoR, R)(RoR ror, R sep) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)) && isInputRange!R && is(Unqual!(ElementType!(ElementType!RoR)) == Unqual!(ElementType!R)))
/usr/include/dmd/phobos/std/array.d(1685):        std.array.join(RoR)(RoR ror) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)))
vibenews.admin.listusers.dt(54): Error: no property '_id' for type 'UserInfo'
../.dub/packages/vibe-d-0.7.22/source/vibe/http/server.d(1086): Error: template instance vibe.templ.diet.compileDietFileCompatV!("vibenews.admin.listusers.dt", HTTPServerRequest, "req", Info*, "info") error instantiating
source/vibenews/admin.d(269):        instantiated from here: renderCompat!("vibenews.admin.listusers.dt", HTTPServerRequest, "req", Info*, "info")
Compiling diet template 'vibenews.admin.edituser.dt' (compat)...
vibenews.admin.edituser.dt(19): Error: no property '_id' for type 'User', did you mean 'id'?
vibenews.admin.edituser.dt(52): Error: template std.array.join cannot deduce function from argument types !()(ID!(Group)[], string), candidates are:
/usr/include/dmd/phobos/std/array.d(1638):        std.array.join(RoR, R)(RoR ror, R sep) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)) && isInputRange!R && is(Unqual!(ElementType!(ElementType!RoR)) == Unqual!(ElementType!R)))
/usr/include/dmd/phobos/std/array.d(1685):        std.array.join(RoR)(RoR ror) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)))
vibenews.admin.edituser.dt(59): Error: no property '_id' for type 'User', did you mean 'id'?
../.dub/packages/vibe-d-0.7.22/source/vibe/http/server.d(1086): Error: template instance vibe.templ.diet.compileDietFileCompatV!("vibenews.admin.edituser.dt", HTTPServerRequest, "req", Info*, "info") error instantiating
source/vibenews/admin.d(283):        instantiated from here: renderCompat!("vibenews.admin.edituser.dt", HTTPServerRequest, "req", Info*, "info")
source/vibenews/admin.d(297): Error: cannot implicitly convert expression (array(map(split(*pv, ",")))) of type string[] to ID!(Group)[]
source/vibenews/controller.d(41): Error: no property 'databaseName' for type 'userman.userman.UserManSettings'
source/vibenews/controller.d(47): Error: cannot create instance of abstract class UserManController
source/vibenews/controller.d(47):        function 'bool isEmailRegistered(string email)' is not implemented
source/vibenews/controller.d(47):        function 'ID!(User) addUser(ref User usr)' is not implemented
source/vibenews/controller.d(47):        function 'User getUser(ID!(User) id)' is not implemented
source/vibenews/controller.d(47):        function 'User getUserByName(string name)' is not implemented
source/vibenews/controller.d(47):        function 'User getUserByEmail(string email)' is not implemented
source/vibenews/controller.d(47):        function 'User getUserByEmailOrName(string email_or_name)' is not implemented
source/vibenews/controller.d(47):        function 'void enumerateUsers(int first_user, int max_count, void delegate(ref User usr) del)' is not implemented
source/vibenews/controller.d(47):        function 'long getUserCount()' is not implemented
source/vibenews/controller.d(47):        function 'void deleteUser(ID!(User) user_id)' is not implemented
source/vibenews/controller.d(47):        function 'void updateUser(ref const(User) user)' is not implemented
source/vibenews/controller.d(47):        function 'void setEmail(ID!(User) user, string email)' is not implemented
source/vibenews/controller.d(47):        function 'void setFullName(ID!(User) user, string full_name)' is not implemented
source/vibenews/controller.d(47):        function 'void setPassword(ID!(User) user, string password)' is not implemented
source/vibenews/controller.d(47):        function 'void setProperty(ID!(User) user, string name, string value)' is not implemented
source/vibenews/controller.d(47):        function 'void addGroup(string name, string description)' is not implemented
source/vibenews/controller.d(130): Error: function userman.controller.UserManController.getUser (ID!(User) id) is not callable using argument types (BsonObjectID)
source/vibenews/controller.d(141): Error: function userman.controller.UserManController.deleteUser (ID!(User) user_id) is not callable using argument types (BsonObjectID)
Serializing composite type Empty which has no serializable fields
Serializing composite type Empty which has no serializable fields
source/vibenews/controller.d(499): Error: function userman.controller.UserManController.getUser (ID!(User) id) is not callable using argument types (BsonObjectID)
source/vibenews/controller.d(502): Error: expression usr of type User does not have a boolean value
source/vibenews/controller.d(502): Error: no property '_id' for type 'User', did you mean 'id'?
source/vibenews/controller.d(688): Error: function userman.controller.UserManController.getUser (ID!(User) id) is not callable using argument types (BsonObjectID)
source/vibenews/controller.d(706): Error: function userman.controller.UserManController.getUser (ID!(User) id) is not callable using argument types (BsonObjectID)
Serializing composite type Empty which has no serializable fields
source/vibenews/news.d(255): Deprecation: function vibe.crypto.passwordhash.testSimplePasswordHash is deprecated - This function is considered insecure and will be removed. The DUB packages dauth or scrypt may be suitable alternatives.
source/vibenews/news.d(256): Error: no property '_id' for type 'User', did you mean 'id'?
source/vibenews/web.d(104): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
source/vibenews/web.d(105): Error: cannot implicitly convert expression (usr.groups) of type ID!(Group)[] to string[]
Compiling diet template 'vibenews.web.index.dt' (compat)...
vibenews.web.layout.dt(7): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
Compiling diet template 'vibenews.web.edit_profile.dt' (compat)...
vibenews.web.layout.dt(7): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
Compiling diet template 'vibenews.web.view_group.dt' (compat)...
vibenews.web.layout.dt(7): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
Compiling diet template 'vibenews.web.view_thread.dt' (compat)...
vibenews.web.layout.dt(7): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
Compiling diet template 'vibenews.web.view_post.dt' (compat)...
vibenews.web.layout.dt(7): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
source/vibenews/web.d(309): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
source/vibenews/web.d(310): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
source/vibenews/web.d(312): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
source/vibenews/web.d(313): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
Compiling diet template 'vibenews.web.reply.dt' (compat)...
vibenews.web.layout.dt(7): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
source/vibenews/web.d(359): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
source/vibenews/web.d(360): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
source/vibenews/web.d(413): Deprecation: function vibe.http.session.Session.opIndexAssign is deprecated - Use set() instead.
source/vibenews/web.d(414): Deprecation: function vibe.http.session.Session.opIndexAssign is deprecated - Use set() instead.
source/vibenews/web.d(444): Deprecation: function vibe.http.session.Session.opIndex is deprecated - Use get() instead.
source/vibenews/web.d(445): Error: cannot implicitly convert expression (usr.groups) of type ID!(Group)[] to string[]
FAIL .dub/build/application-debug-linux.posix-x86_64-dmd_2066-9F1D17425FFCAA9DDDB82356A087D405/ vibenews executable
Error executing command build: dmd failed with exit code 1.

Suggestions?

Re: Building vibenews

I've checked that vibenews almost compiles with vibe.d 0.7.20 (the one in package.json, which is not chosen because the repo does not have a dub.selections.json), except that version of vibe.d does not compile with the latest DMD due to a collision. I've tried to understand the errors that start happening with vibe.d 0.7.21, even doing a diff between 0.7.20 and ~master of bson.d, but I didn't yet understand the source of the error. I hope that helps a little bit.

BTW: I would argue that if dub.json says foo version "==1.0.0" and dub.selections.json says version "1.1.0" than dub.json should either win (and replace dub.selections.json with the older version) or dub should just complain, instead of silently going with dub.selections.json.

Re: Building vibenews

Am 19.02.2015 um 18:39 schrieb Luís Marques:

I've checked that vibenews almost compiles with vibe.d 0.7.20 (the one in package.json, which is not chosen because the repo does not have a dub.selections.json), except that version of vibe.d does not compile with the latest DMD due to a collision. I've tried to understand the errors that start happening with vibe.d 0.7.21, even doing a diff between 0.7.20 and ~master of bson.d, but I didn't yet understand the source of the error. I hope that helps a little bit.

I've pushed an update to the latest versions of the dependencies now.
The errors were caused by the wrong version of userman being selected
due to the bug below. To fix this, the code is now properly updated.

However, at least on Windows, I'm getting a strange crash caused by a
corrupted stack. I'll need to investigate this further.

BTW: I would argue that if dub.json says foo version "==1.0.0" and dub.selections.json says version "1.1.0" than dub.json should either win (and replace dub.selections.json with the older version) or dub should just complain, instead of silently going with dub.selections.json.

In this case, something like the following message should appear:
Selected package X 1.1.0 does not match the dependency specification in
package Y (1.0.0). Need to "dub upgrade"?

However, there was a bug where "~>1.0.0" would match "1.1.0" that I've
fixed now.

Re: Building vibenews

On Fri, 20 Feb 2015 00:18:05 +0100, Sönke Ludwig wrote:

Am 19.02.2015 um 18:39 schrieb Luís Marques:

I've checked that vibenews almost compiles with vibe.d 0.7.20 (the one in package.json, which is not chosen because the repo does not have a dub.selections.json), except that version of vibe.d does not compile with the latest DMD due to a collision. I've tried to understand the errors that start happening with vibe.d 0.7.21, even doing a diff between 0.7.20 and ~master of bson.d, but I didn't yet understand the source of the error. I hope that helps a little bit.

I've pushed an update to the latest versions of the dependencies now.
The errors were caused by the wrong version of userman being selected
due to the bug below. To fix this, the code is now properly updated.

You didn't include the dub.selections.json in the repo. Isn't the idea of dub.selections.json that it should be part of the software distribution, so that the selected versions are part of the commit?

Re: Building vibenews

On Fri, 20 Feb 2015 00:18:05 +0100, Sönke Ludwig wrote:

However, at least on Windows, I'm getting a strange crash caused by a
corrupted stack. I'll need to investigate this further.

I don't know if it's related, but could be ("exception trap"): https://github.com/rejectedsoftware/vibenews/issues/26

Re: Building vibenews

Am 20.02.2015 um 03:51 schrieb Luís Marques:

On Fri, 20 Feb 2015 00:18:05 +0100, Sönke Ludwig wrote:

However, at least on Windows, I'm getting a strange crash caused by a
corrupted stack. I'll need to investigate this further.

I don't know if it's related, but could be ("exception trap"): https://github.com/rejectedsoftware/vibenews/issues/26

I think its unrelated (stepping through the code, there was no exception
involved, just EBP gets zeroed out with the "leave" instruction in
Controller.getUserByEmail). I'll look into that other issue, though.

Re: Building vibenews

On Fri, 20 Feb 2015 08:24:25 +0100, Sönke Ludwig wrote:

Am 20.02.2015 um 03:51 schrieb Luís Marques:
I think its unrelated (stepping through the code, there was no exception
involved, just EBP gets zeroed out with the "leave" instruction in
Controller.getUserByEmail). I'll look into that other issue, though.

Thanks for the quick support. By the way, what did you use to debug? VisualD's debugger? (mango, or whatever its called?). I'm on OS X and Linux, the last time I tried gdb it didn't play very well with D, so I always go back to printf-style debugging...

Re: Building vibenews

Am 20.02.2015 um 15:29 schrieb Luís Marques:

On Fri, 20 Feb 2015 08:24:25 +0100, Sönke Ludwig wrote:

Am 20.02.2015 um 03:51 schrieb Luís Marques:
I think its unrelated (stepping through the code, there was no exception
involved, just EBP gets zeroed out with the "leave" instruction in
Controller.getUserByEmail). I'll look into that other issue, though.

Thanks for the quick support. By the way, what did you use to debug? VisualD's debugger? (mango, or whatever its called?). I'm on OS X and Linux, the last time I tried gdb it didn't play very well with D, so I always go back to printf-style debugging...

It always depends on the situation. Sometimes the VisualStudio debugger
works best, sometimes Mago, sometimes GDB (at least the latest
versions), and more often than I'd like I also have to revert to printf
debugging (or assembler single stepping within VisualStudio). The
situation is still not optimal, but it's definitely getting better.

But in this case, I just fixed the root cause by going with the error
message (accessing the Nullable), but couldn't directly see in the
debugger where in the exception handling code the segmentation fault was
caused. Seems like there is still a bug in the runtime.