-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Test for how di files are handled with variant dir. #4372
base: master
Are you sure you want to change the base?
Conversation
The new test passes, but only by setting |
To save a bit of time, can you describe "doesn't work" in words? Currently wrestling with something in |
It doesn't prepend the path that was passed in the |
That does sound like one of the problems I've been chasing - and not completely solving yet. SCons makes the correct handling of these "extras" (that's not the right word I know) a lot harder than you think it should be. I'll try to take a look later. Meanwhile, usually the dynamic construction of a flag uses env['_DI_FLAGS'] = "$( ${_concat(DI_FILE_DIR_PREFIX, DI_FILE_DIR, DI_FILE_DIR_SUFFFIX, __env__, lambda x: x, TARGET, SOURCE)} $) The usual stanza here seems to be to use |
Mmm, perhaps not the lamba, it doesn't expand env['_DI_FLAGS'] = "$( ${_concat(DI_FILE_DIR_PREFIX, DI_FILE_DIR, DI_FILE_DIR_SUFFFIX, __env__, Dirs, TARGET, SOURCE)} $) |
Using _concat with Dirs does prepends the variant directory, but it also prepends the path elements of the source file between file name and source dir. In the test case this results in build/parts/include instead of build/include |
It would be reasonable to copy the source directory structure and have With SCons you can build a target using Either way, I can't figure out how to do either at the moment. |
And that's not correct, I presume. The model is that a reference to a file or directory name is interpreted as a relative path. A lot of the doc wording says "relative to the directory of the sconscript" which is imprecise (in a non-duplicating variantdir those aren't the same thing). It will work differently if your |
If you did have source files in multiple locations the build wouldn't make sense.
would generate di files like :
Which would not be useful |
You would either want to be able to copy them all to a single directory (which would also allow individual control of where di went), so you can include them with
or copy the structure under the include path so you can include them with
|
Trying to get back to this with one of a couple of patchsets I have... these tests don't seem to fail on unmodified SCons head, which I expected. What am I missing? |
Just an update here, sorry it's been so long... I'm fiddling with Fortran module stuff which is a similar problem, though not identical... scanners are not properly accounting for the (optional) directory for these special files ( |
OK, I'm wrong... looks like the scanner does deduce the correct path:
and so the deps are correct:
and the problem is just that that path doesn't make it into |
Hi,
The new
di
file work recently merged doesn't work with variant dirs. The original code I started this branch with worked, although I did have to include thedi
files with../include
.In this pull request there is an additional test which uses a variant dir which fails.
I am hoping maintainers can have a look at it, and point me in the right direction how to fix it.
Alex