www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DS3

reply "David B. Held" <dheld codelogicconsulting.com> writes:
So I d/led and installed DS3, ran over to my favorite D project, and 
typed 'dsss build' to see what would happen.  It tried compiling 
everything in the directory and gave me a lot of warnings about no 
module declaration; so I thought that was handy, fixed it, and tried it 
again.  This time, rebuild tells me I'm an idiot and I haven't invoked 
it correctly, and gives me the help page for rebuild.  Well, I guess 
that's ok, but I don't really want to have to know that DS3 is built on 
top of rebuild, because I couldn't feed it the right arguments anyway.

It seems to me that in this case, DS3 should tell me something like: 
"Hey you moron, I couldn't find a config file so I don't know how to 
build your project."  That's actually what I was hoping and expecting to 
see, so how likely is it we can get this kind of idiot-proofing added? 
I suspect it may help the adoption rate a little if the tool gives hints 
to impatient people who don't like to RTFM, and it will make it look 
just a little more polished.  Thanks.

Dave
Aug 26 2007
next sibling parent reply Gregor Richards <Richards codu.org> writes:
David B. Held wrote:
 So I d/led and installed DS3, ran over to my favorite D project, and 
 typed 'dsss build' to see what would happen.  It tried compiling 
 everything in the directory and gave me a lot of warnings about no 
 module declaration; so I thought that was handy, fixed it, and tried it 
 again.  This time, rebuild tells me I'm an idiot and I haven't invoked 
 it correctly, and gives me the help page for rebuild.  Well, I guess 
 that's ok, but I don't really want to have to know that DS3 is built on 
 top of rebuild, because I couldn't feed it the right arguments anyway.
 
 It seems to me that in this case, DS3 should tell me something like: 
 "Hey you moron, I couldn't find a config file so I don't know how to 
 build your project."  That's actually what I was hoping and expecting to 
 see, so how likely is it we can get this kind of idiot-proofing added? I 
 suspect it may help the adoption rate a little if the tool gives hints 
 to impatient people who don't like to RTFM, and it will make it look 
 just a little more polished.  Thanks.
 
 Dave

DSSS is able to build libraries without dsss.conf files, as a semi-backwards-compatibility thing. I'm not sure whether it was the best decision I ever made ... I think I'll add a warning for lack of dsss.conf files (but still allow it to work). Basically, I'm trying to decide whether to drop that feature or make it smarter. The smarter version would grope around for possible binaries, and basically "do the right thing" in the general case. But, having it infer things is generally bad when you accidentally type 'dsss build' in your home directory. So, rock and a hard place. - Gregor Richards - Gregor Richards
Aug 26 2007
parent Gregor Richards <Richards codu.org> writes:
Gregor Richards wrote:
 David B. Held wrote:
 So I d/led and installed DS3, ran over to my favorite D project, and 
 typed 'dsss build' to see what would happen.  It tried compiling 
 everything in the directory and gave me a lot of warnings about no 
 module declaration; so I thought that was handy, fixed it, and tried 
 it again.  This time, rebuild tells me I'm an idiot and I haven't 
 invoked it correctly, and gives me the help page for rebuild.  Well, I 
 guess that's ok, but I don't really want to have to know that DS3 is 
 built on top of rebuild, because I couldn't feed it the right 
 arguments anyway.

 It seems to me that in this case, DS3 should tell me something like: 
 "Hey you moron, I couldn't find a config file so I don't know how to 
 build your project."  That's actually what I was hoping and expecting 
 to see, so how likely is it we can get this kind of idiot-proofing 
 added? I suspect it may help the adoption rate a little if the tool 
 gives hints to impatient people who don't like to RTFM, and it will 
 make it look just a little more polished.  Thanks.

 Dave

DSSS is able to build libraries without dsss.conf files, as a semi-backwards-compatibility thing. I'm not sure whether it was the best decision I ever made ... I think I'll add a warning for lack of dsss.conf files (but still allow it to work). Basically, I'm trying to decide whether to drop that feature or make it smarter. The smarter version would grope around for possible binaries, and basically "do the right thing" in the general case. But, having it infer things is generally bad when you accidentally type 'dsss build' in your home directory. So, rock and a hard place. - Gregor Richards - Gregor Richards

PS all the cool kids double-sign. - Gregor Richards - Gregor Richards - Gregor Richards PPS at least double
Aug 26 2007
prev sibling parent reply torhu <no spam.invalid> writes:
David B. Held wrote:
 So I d/led and installed DS3, ran over to my favorite D project, and 
 typed 'dsss build' to see what would happen.  It tried compiling 
 everything in the directory and gave me a lot of warnings about no 
 module declaration; so I thought that was handy, fixed it, and tried it 
 again.  This time, rebuild tells me I'm an idiot and I haven't invoked 
 it correctly, and gives me the help page for rebuild.  Well, I guess 
 that's ok, but I don't really want to have to know that DS3 is built on 
 top of rebuild, because I couldn't feed it the right arguments anyway.
 
 It seems to me that in this case, DS3 should tell me something like: 
 "Hey you moron, I couldn't find a config file so I don't know how to 
 build your project."  That's actually what I was hoping and expecting to 
 see, so how likely is it we can get this kind of idiot-proofing added? 
 I suspect it may help the adoption rate a little if the tool gives hints 
 to impatient people who don't like to RTFM, and it will make it look 
 just a little more polished.  Thanks.
 
 Dave

I'm not sure if you already know this or not, sorry if you do. :) If you just want to build an app, you can just do 'rebuild myapp', rebuild works the same way as bud does. It will then parse a file called myapp.d, and compile and link everything by looking at the import statements to find the other files needed. The output will be 'myapp.exe'. Can't get much easier. Additional compiler arguments, libs, etc. can be added to rebuild's command line unaltered. DSSS basically reads what you would put on the command line for rebuild from the file dsss.conf, and then runs rebuild based on that. Once you've got the basics working, DSSS can do a lot more than that. Nothing I've had the need for myself yet, though.
Aug 27 2007
parent reply "David B. Held" <dheld codelogicconsulting.com> writes:
torhu wrote:
 [...]
 If you just want to build an app, you can just do 'rebuild myapp', 
 rebuild works the same way as bud does.  It will then parse a file 
 called myapp.d, and compile and link everything by looking at the import 
 statements to find the other files needed.  The output will be 
 'myapp.exe'.  Can't get much easier.  Additional compiler arguments, 
 libs, etc. can be added to rebuild's command line unaltered.
 [...]

Well, I haven't used rebuild or bud either. ;) This still doesn't work for my app, because I'm not actually building an app...I'm building a library with unit tests. So I have a main(), but it doesn't do anything interesting, and I don't need to import any modules from the library, because I normally just add those in by hand. Since unit tests are global functions that get called magically, you can have a disjoint import lattice that might be confusing rebuild. Here is a sample that will confuse dsss: main.d: module main; void main() { } lib.d: module lib; import std.stdio; unittest { writefln("Hello, world!"); } Now, tell me what you expect to happen when you do 'dsss build -unittest', and tell me what does happen. Dave P.S. Normally, I would just do 'dmd main lib -unittest', and it would just work (well, it *does* work). I was hoping dsss was this easy, but I think I found a corner case.
Aug 27 2007
parent reply Gregor Richards <Richards codu.org> writes:
David B. Held wrote:
 torhu wrote:
 [...]
 If you just want to build an app, you can just do 'rebuild myapp', 
 rebuild works the same way as bud does.  It will then parse a file 
 called myapp.d, and compile and link everything by looking at the 
 import statements to find the other files needed.  The output will be 
 'myapp.exe'.  Can't get much easier.  Additional compiler arguments, 
 libs, etc. can be added to rebuild's command line unaltered.
 [...]

Well, I haven't used rebuild or bud either. ;) This still doesn't work for my app, because I'm not actually building an app...I'm building a library with unit tests. So I have a main(), but it doesn't do anything interesting, and I don't need to import any modules from the library, because I normally just add those in by hand. Since unit tests are global functions that get called magically, you can have a disjoint import lattice that might be confusing rebuild. Here is a sample that will confuse dsss: main.d: module main; void main() { } lib.d: module lib; import std.stdio; unittest { writefln("Hello, world!"); } Now, tell me what you expect to happen when you do 'dsss build -unittest', and tell me what does happen. Dave P.S. Normally, I would just do 'dmd main lib -unittest', and it would just work (well, it *does* work). I was hoping dsss was this easy, but I think I found a corner case.

OK, two things. 1) You usually need a dsss.conf. Mind you, it shouldn't have spewed random output, but all that DSSS does is say "any package is probably a library" when it's figuring it out automatically. As I posted in some other NG (or was it this one :) ), that needs improvement. 2) You don't need an empty main to run unit tests with DSSS. So, First, make a dsss.conf that looks something like this: name = <somename> [lib.d] type = library Then, run unit tests like this: dsss build --test - Gregor Richards
Aug 27 2007
parent reply "David B. Held" <dheld codelogicconsulting.com> writes:
Gregor Richards wrote:
 [...]
 First, make a dsss.conf that looks something like this:
 name = <somename>
 [lib.d]
 type = library
 
 Then, run unit tests like this:
 dsss build --test

Ok, this gets me further...great! Now, I like to develop in Eclipse (and the latest Descent version makes this a very compelling option), which likes to organize stuff into a src/ and bin/ dir that are sisters, like so: project/ dsss.conf src/ lib.d main.d bin/ lib.obj main.obj main.exe I tried 'dsss build --bindir=bin --test' using the unit test example, but all the build artifacts ended up in my project/ dir anyway. Any suggestions on how to convince dsss to really use bin/? Also, putting things in a directory doesn't work out so well. With a dsss.conf that looks like so: name = test [src\lib.d] type = library I get this: ---------------------------------8<-------------------------------------- Creating imports for src\lib src\lib.d => src\lib + D:\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\ -ID:\dsss\include\d -SD:\dsss \lib\ -ID:\dsss\include\d -SD:\dsss\lib -oqdsss_objs -explicit -lib -full src \lib.d -ofSsrc\lib.lib Digital Mars Librarian Version 8.02n Copyright (C) Digital Mars 2000-2007 All Rights Reserved http://www.digitalmars.com/ctg/lib.html Error: unable to create 'Ssrc\lib.lib' : No such file or directory Command D:\dsss\bin\rebuild.exe returned with code -1, aborting. ---------------------------------8<-------------------------------------- Clearly, I'm not doing something right, but I'm also not sure what "something" is, or "right". Dave
Aug 27 2007
parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
David B. Held wrote:
 Gregor Richards wrote:
 [...]
 First, make a dsss.conf that looks something like this:
 name = <somename>
 [lib.d]
 type = library

 Then, run unit tests like this:
 dsss build --test

Ok, this gets me further...great! Now, I like to develop in Eclipse (and the latest Descent version makes this a very compelling option), which likes to organize stuff into a src/ and bin/ dir that are sisters, like so: project/ dsss.conf src/ lib.d main.d bin/ lib.obj main.obj main.exe I tried 'dsss build --bindir=bin --test' using the unit test example, but all the build artifacts ended up in my project/ dir anyway. Any suggestions on how to convince dsss to really use bin/? Also, putting things in a directory doesn't work out so well. With a dsss.conf that looks like so: name = test [src\lib.d] type = library I get this: ---------------------------------8<-------------------------------------- Creating imports for src\lib src\lib.d => src\lib + D:\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\ -ID:\dsss\include\d -SD:\dsss \lib\ -ID:\dsss\include\d -SD:\dsss\lib -oqdsss_objs -explicit -lib -full src \lib.d -ofSsrc\lib.lib Digital Mars Librarian Version 8.02n Copyright (C) Digital Mars 2000-2007 All Rights Reserved http://www.digitalmars.com/ctg/lib.html Error: unable to create 'Ssrc\lib.lib' : No such file or directory Command D:\dsss\bin\rebuild.exe returned with code -1, aborting. ---------------------------------8<-------------------------------------- Clearly, I'm not doing something right, but I'm also not sure what "something" is, or "right". Dave

DSSS doesn't really like working from .conf files in directories other than where the "meat" is. So for your case, you need to have a dsss.conf in the src directory like: name=test [lib.d] type = library and if you want to build from the directory one above you can add a dsss.conf there like: name=project [src] type = subdir I think that will fix the basic getting-it-to-build issue. But probably won't fix your --bindir issue. -- I have a similar directory issue with package library projects. Right now DSSS really wants you to organize your source like topdir - dsss.conf + mymodule + source1.d + source2.d With a dsss conf like: [mymodule] type=library But that makes it so that all other build tools have to work harder to get the locations of sources to build with. They'll need a -Itopdir for each such library, whereas without dsss-ification they worked just fine all being in a common directory with one -Icommon. --bb
Aug 27 2007
parent Bill Baxter <dnewsgroup billbaxter.com> writes:
Bill Baxter wrote:
 I have a similar directory issue with package library projects.  Right 
 now DSSS really wants you to organize your source like
 
 topdir
 - dsss.conf
 + mymodule
   - source1.d
   - source2.d
 
 With a dsss conf like:
 
 [mymodule]
 type=library
 
 But that makes it so that all other build tools have to work harder to 
 get the locations of sources to build with.  They'll need a -Itopdir for 
 each such library, whereas without dsss-ification they worked just fine 
 all being in a common directory with one -Icommon.

Hit 'send' too soon... This is the layout I'd like to be able to use (since it was what I used and found to work best for me pre-dsss): common + mypackage - dsss.conf - source1.d - source2.d + other_persons_package - dsss.conf - source1.d + non_dsss_package - source1.d It almost works now if you make a dsss.conf like [.] type = library but I think the problem I ran into with that was that 'dsss install' then installs stuff in the wrong place. --bb
Aug 27 2007