Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
January 11, 2014 Is it true that dub compiles everything in the source dir whether it's imported or not? | ||||
---|---|---|---|---|
| ||||
Is it true that dub compiles everything in the source dir whether it's imported or not? Using it to compile a project that seems to be the case but i want to learn if that's true. I draw this conclusion when investigating this problem: http://forum.dlang.org/thread/fvhdqcjfqfojzsyjpidl@forum.dlang.org?page=2#post-qavrnsytpszqiofgavgi:40forum.dlang.org If it is true then perhaps dub needs to be re-engineered to only compile imported source files. |
January 11, 2014 Re: Is it true that dub compiles everything in the source dir whether it's imported or not? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On 1/11/2014 9:16 PM, Gary Willoughby wrote: > Is it true that dub compiles everything in the source dir whether it's > imported or not? > > Using it to compile a project that seems to be the case but i want to > learn if that's true. > > I draw this conclusion when investigating this problem: > http://forum.dlang.org/thread/fvhdqcjfqfojzsyjpidl@forum.dlang.org?page=2#post-qavrnsytpszqiofgavgi:40forum.dlang.org > > > If it is true then perhaps dub needs to be re-engineered to only compile > imported source files. I think adding an "excludedSourceFiles" entry to your package.json is is what you want. See [1]. [1] http://code.dlang.org/package-format |
January 11, 2014 Re: Is it true that dub compiles everything in the source dir whether it's imported or not? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On Saturday, 11 January 2014 at 12:16:36 UTC, Gary Willoughby wrote:
> Is it true that dub compiles everything in the source dir whether it's imported or not?
>
> Using it to compile a project that seems to be the case but i want to learn if that's true.
>
> I draw this conclusion when investigating this problem: http://forum.dlang.org/thread/fvhdqcjfqfojzsyjpidl@forum.dlang.org?page=2#post-qavrnsytpszqiofgavgi:40forum.dlang.org
>
> If it is true then perhaps dub needs to be re-engineered to only compile imported source files.
There's the --rdmd switch to use rdmd for building, so it'll only compile imported files. I'm not sure what it uses as 'main' file though.
|
January 11, 2014 Re: Is it true that dub compiles everything in the source dir whether it's imported or not? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | On Saturday, 11 January 2014 at 13:01:26 UTC, Mike Parker wrote:
> I think adding an "excludedSourceFiles" entry to your package.json is is what you want. See [1].
>
> [1] http://code.dlang.org/package-format
I've seen this but the problem is not with my project but a dependency. I only include two files from the dependency but when my project is compiled the entire source of the dependency is compiled and produces the error.
|
January 11, 2014 Re: Is it true that dub compiles everything in the source dir whether it's imported or not? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rene Zwanenburg | On Saturday, 11 January 2014 at 13:19:10 UTC, Rene Zwanenburg wrote:
> There's the --rdmd switch to use rdmd for building, so it'll only compile imported files. I'm not sure what it uses as 'main' file though.
Yes, that's what i have to use to build correctly as dub creates errors.
|
January 11, 2014 Re: Is it true that dub compiles everything in the source dir whether it's imported or not? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On Saturday, 11 January 2014 at 13:46:51 UTC, Gary Willoughby wrote: > On Saturday, 11 January 2014 at 13:01:26 UTC, Mike Parker wrote: >> I think adding an "excludedSourceFiles" entry to your package.json is is what you want. See [1]. >> >> [1] http://code.dlang.org/package-format > > I've seen this but the problem is not with my project but a dependency. I only include two files from the dependency but when my project is compiled the entire source of the dependency is compiled and produces the error. Actuall i may be able to handle this as a sub configuration: https://gist.github.com/s-ludwig/7916080 |
January 11, 2014 Re: Is it true that dub compiles everything in the source dir whether it's imported or not? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On Saturday, 11 January 2014 at 13:46:51 UTC, Gary Willoughby wrote:
> I've seen this but the problem is not with my project but a dependency. I only include two files from the dependency but when my project is compiled the entire source of the dependency is compiled and produces the error.
Is that by any chance also why compiling with Dub is slower than just with Dmd? If so, it would be nice to not do for non-release builds.
|
January 11, 2014 Re: Is it true that dub compiles everything in the source dir whether it's imported or not? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Casper Færgemand | On Saturday, 11 January 2014 at 14:10:20 UTC, Casper Færgemand wrote:
> On Saturday, 11 January 2014 at 13:46:51 UTC, Gary Willoughby wrote:
>> I've seen this but the problem is not with my project but a dependency. I only include two files from the dependency but when my project is compiled the entire source of the dependency is compiled and produces the error.
>
> Is that by any chance also why compiling with Dub is slower than just with Dmd? If so, it would be nice to not do for non-release builds.
Yes probably because with DMD you only specify what you need compiling and RDMD actually parses the imports so it only compiles what is needed. As evidence suggests Dub compiles everything, which is slower and results in larger executables.
|
Copyright © 1999-2021 by the D Language Foundation