View mode: basic / threaded / horizontal-split · Log in · Help
November 27, 2012
Re: Errors compiling DSSS
> #!/usr/bin/rdmd
> /**rdmdoptions
> -L-lmylib
> */
> ...
> 
> What would be some useful options to add, aside from those already 
> supported?
> 

Providing arbitrary compiler flags would already be a huge gain. So one
can pass libs, -I include paths, ...
November 27, 2012
Re: Errors compiling DSSS
> Providing arbitrary compiler flags would already be a huge 
> gain. So one
> can pass libs, -I include paths, ...

You can already pass -I and -L and they are passed on to DMD 
(along with any other flags that rdmd doesn't recognize AFAIK.
November 27, 2012
Re: Errors compiling DSSS
On 11/27/12 12:37 PM, jerro wrote:
>> Providing arbitrary compiler flags would already be a huge gain. So one
>> can pass libs, -I include paths, ...
>
> You can already pass -I and -L and they are passed on to DMD (along with
> any other flags that rdmd doesn't recognize AFAIK.

The advantage would be that you get to wire the options inside the 
script instead of requiring them in the invocation thereof.

Again, --shebang does help there but my experience with it has been 
terrible: I recall on one OS the shebang line was silently truncated so 
some of my options were not passed although I was convinced they were.


Andrei
November 27, 2012
Re: Errors compiling DSSS
I didn't see a single example of build script usage where it wasn't tied to
the sources and where the sources could be easily compiled without it. The
sources define what the binary will look like and so do the build scripts.
That's why I think it's a good idea to combine them.

As for the question "where to put those comments?":
There was an enhancement issue in bugzilla about allowing modules to be
named "package" in which case they are imported by their package name
alone. The build comments in those modules would be propagated to the
entire package and the subpackages would be able to override.


On Tue, Nov 27, 2012 at 9:40 PM, Andrei Alexandrescu <
SeeWebsiteForEmail@erdani.org> wrote:

> On 11/27/12 12:37 PM, jerro wrote:
>
>> Providing arbitrary compiler flags would already be a huge gain. So one
>>> can pass libs, -I include paths, ...
>>>
>>
>> You can already pass -I and -L and they are passed on to DMD (along with
>> any other flags that rdmd doesn't recognize AFAIK.
>>
>
> The advantage would be that you get to wire the options inside the script
> instead of requiring them in the invocation thereof.
>
> Again, --shebang does help there but my experience with it has been
> terrible: I recall on one OS the shebang line was silently truncated so
> some of my options were not passed although I was convinced they were.
>
>
> Andrei
>



-- 
Bye,
Gor Gyolchanyan.
November 27, 2012
Re: Errors compiling DSSS
On Tuesday, 27 November 2012 at 16:04:47 UTC, Andrei Alexandrescu 
wrote:

> #!/usr/bin/rdmd
> /**rdmdoptions
> -L-lmylib
> */
> ...

#!/usr/bin/rdmd
@("compiler options", "-L-lmylib") module main;
...

Maybe... sorry I don't know if this would work with current UDA.
November 27, 2012
Re: Errors compiling DSSS
On 2012-11-27 16:50, Gor Gyolchanyan wrote:
> Why do you think so? The build script is inseparable from the project
> source files. What makes the build script necessary to be separate?

BTW, how should the compiler handle these build settings? I mean, the 
compiler need to first find the file containing the build settings, 
somehow. Either by convention or by specify on the command line the file 
containing the build settings.

The problem, if you can have build settings in any source file, is that 
the compiler will first need to scan all source files for these 
settings. Then it needs to rescan the files again for the regular 
compile phase.

-- 
/Jacob Carlborg
November 27, 2012
Re: Errors compiling DSSS
On Tue, 2012-11-27 at 10:51 -0500, Andrei Alexandrescu wrote:
> Thats why I included the --shebang flag in rdmd.
> 
> 

Thanks a lot! That is very very nice. I wasn't aware of this because I
relied on the very outdated man page, instead on rdmd -h. Wow rdmd is
far more powerful now :-)
November 28, 2012
Re: Errors compiling DSSS
On 11/28/2012 3:04 AM, Andrei Alexandrescu wrote:
> Even with --shebang there are odd limitations of the shebang line length
> etc. I think it would make sense to add options in the form of a
> stylized comment below the shebang line. That comment can be read and
> parsed by rdmd appropriately. For example:
>
> #!/usr/bin/rdmd
> /**rdmdoptions
> -L-lmylib
> */
> ...

There's gotta be a better syntax than that!
November 28, 2012
Re: Errors compiling DSSS
On 11/28/12 8:00 AM, Walter Bright wrote:
> On 11/28/2012 3:04 AM, Andrei Alexandrescu wrote:
>> Even with --shebang there are odd limitations of the shebang line length
>> etc. I think it would make sense to add options in the form of a
>> stylized comment below the shebang line. That comment can be read and
>> parsed by rdmd appropriately. For example:
>>
>> #!/usr/bin/rdmd
>> /**rdmdoptions
>> -L-lmylib
>> */
>> ...
>
> There's gotta be a better syntax than that!

I think so too. Ideas?

Andrei
November 28, 2012
Re: Errors compiling DSSS
How about:

//! -L-lmylib


On Wed, Nov 28, 2012 at 6:29 PM, Andrei Alexandrescu <
SeeWebsiteForEmail@erdani.org> wrote:

> On 11/28/12 8:00 AM, Walter Bright wrote:
>
>> On 11/28/2012 3:04 AM, Andrei Alexandrescu wrote:
>>
>>> Even with --shebang there are odd limitations of the shebang line length
>>> etc. I think it would make sense to add options in the form of a
>>> stylized comment below the shebang line. That comment can be read and
>>> parsed by rdmd appropriately. For example:
>>>
>>> #!/usr/bin/rdmd
>>> /**rdmdoptions
>>> -L-lmylib
>>> */
>>> ...
>>>
>>
>> There's gotta be a better syntax than that!
>>
>
> I think so too. Ideas?
>
> Andrei
>



-- 
Bye,
Gor Gyolchanyan.
1 2 3 4 5 6 7
Top | Discussion index | About this forum | D home