Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile two files with same name (in different dirs) #1781

Closed
thewilsonator opened this issue Sep 24, 2016 · 17 comments
Closed

Cannot compile two files with same name (in different dirs) #1781

thewilsonator opened this issue Sep 24, 2016 · 17 comments

Comments

@thewilsonator
Copy link
Contributor

thewilsonator commented Sep 24, 2016

the write objects as fully qualified has stopped after a rebase from july to trunk.

tested with
source/
a/File.d
b/File.d
with flags in the dub.json set to "dflags" : ["-oq"]

running with dub build --compiler=/path/to/ldc2 -v
gives


Running ../ldcbuild/bin/ldc2...
../ldcbuild/bin/ldc2 -oq -of.dub/build/application-debug-posix.osx-x86_64-ldc_0-1F6812A58C8D17B1F6048EEE6633F2C7/oqtest -d-debug -g -w -oq -od=.dub/obj -d-version=Have_oqtest -Isource/ source/B/File.d source/a/File.d source/app.d

Error: module File from file source/a/File.d conflicts with another module File from file source/B/File.d
(dub errors)```
@JohanEngelen
Copy link
Member

@thewilsonator Can you git bisect to find the commit that broke things?

@thewilsonator
Copy link
Contributor Author

maybe, i'll have a go.

@kinke
Copy link
Member

kinke commented Sep 24, 2016

Not necessary, it's most likely one of my recent changes.

@thewilsonator
Copy link
Contributor Author

Urgh cmake is not plying nice, but the only files that seem to be involved are
ddmd/dmodule.d
ddmd/module.h
gen/module.cpp
the storage of fqnNames was changed to be llvm::cl::location(global.params.fullyQualifiedObjectFiles

@kinke
Copy link
Member

kinke commented Sep 24, 2016

It doesn't have anything to do with -oq apparently.

ldc2 ..\a\bar.d ..\b\bar.d
Error: module bar from file ..\b\bar.d conflicts with another module bar from file ..\a\bar.d

Originates in DDMD's Module.parse(), where the directory containing the source file is apparently not used to form the module name.

@kinke
Copy link
Member

kinke commented Sep 24, 2016

DMD (a 2.072 nightly build) refuses to compile these 2 files at once too. So it looks as if you really can't compile 2 files with the same filename at once. :(

@thewilsonator
Copy link
Contributor Author

Ok, ill raise a dmd issue.

@thewilsonator
Copy link
Contributor Author

@kinke kinke changed the title -oq doesn't work Cannot compile two files with same name (in different dirs) Sep 24, 2016
@dnadlinger
Copy link
Member

Do the files have module declarations?

@kinke
Copy link
Member

kinke commented Sep 24, 2016

Nope (in my example).

@thewilsonator
Copy link
Contributor Author

Yes, original layout
dcompute/std
index.d
package.d
cuda/
index.d

@dnadlinger
Copy link
Member

@thewilsonator: So just to be sure there are no misunderstandings, your files have module dcompute.std.index; and module dcompute.std.cuda.index?

@thewilsonator
Copy link
Contributor Author

yes, well @compute module see https://github.com/libmir/dcompute/tree/master/source/dcompute/std

@thewilsonator
Copy link
Contributor Author

thewilsonator commented Oct 1, 2016

Is this fixed by eb85bc2 ?

@kinke
Copy link
Member

kinke commented Oct 1, 2016

When using module declarations and -op or -oq, this should be fixed now (also tested in https://github.com/ldc-developers/dmd-testsuite/blob/ldc/compilable/ldc_output_filenames.sh).

@kinke
Copy link
Member

kinke commented Oct 4, 2016

@thewilsonator: Confirmed?

@thewilsonator
Copy link
Contributor Author

Sorry for taking so long, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants