-
Notifications
You must be signed in to change notification settings - Fork 26
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
Change finding of EDM4hep, ROOT and podio to use generator expressions #122
Conversation
These are probably there to avoid issue in root dictionary loading during the tests, because just using It is not necessarily more readable, but it is possible to use generator expressions here (even to guard against non-existant targets). $<$<TARGET_EXISTS:podio>:$<TARGET_FILE_DIR:podio>> Also I think in this case, all of the targets that would be removed are dependencies of k4FWCore, so I don't see how they would not be available. |
But even if And I meant not that they don't exist but that they location can't be retrieved if they haven't been installed, which is what happens now. Alternatively the generator expressions work for me (but I think not modifying the environment and letting tests fail as it would happen at runtime is a better design):
|
I personally always consider (most of) the tests as part of the build, rather than the installation. After all for most of the development I want to see whether my current changes work without having to reinstall things inbetween.
Whenever a header of something that goes into a root dictionary changes it can be hard to make sure that the current dictionary is read first. This will make tests fail at runtime. This is probably more of an issue with podio and EDM4hep than it is for k4FWCore, as k4FWCore doesn't build a new dictionary for either of those.
But if they haven't been installed how would you be able to run the tests in the first place (even if
I am not sure I agree with that (fully). During development (and also CI) I basically want to know whether things work if I have a consistent environment. The problem of building such an environment for use at runtime is a somewhat orthogonal concern for me and the individual packages shouldn't really have to care. |
de39f16
to
b6b2938
Compare
I get it now, I think?
? But then just replace things with the generator expression (TARGET_FILE_DIR), and problem solved, because that moves things from the configuration step to the build step?? |
Yes it's about the error. The point is also, do we need that? If yes then it should be in every repository that depends on podio or edm4hep but k4FWCore is the only one therefore we don't need it and it can be removed. Otherwise we should add it to every repository if we think this is needed. This is why I went for deleting instead of using generator expressions; I couldn't find something similar in any of the other repos. |
This is needed when testing newer versions of podio, edm4hep, etc. on top of stacks that have existing podio, edm4hep etc. |
But in that situation typically you add the newer versions to your environment variables so in that case with the environment variables are enough. And if you don't then it won't find the newer versions of course and in that case this PR makes no difference. And then we could conclude finding podio, edm4hep is not necessary, or am I missing something? |
But this package depends on podio, so of course it has to find podio? To find podio you only need CMAKE_PREFIX_PATH, nothing else in the environment, this code makes sure you get the rest of the environment correct for your test. |
b6b2938
to
0938113
Compare
But how often does anyone have |
Co-authored-by: Andre Sailer <[email protected]>
Co-authored-by: Andre Sailer <[email protected]>
Any more comments? If not I merge this today |
Co-authored-by: Andre Sailer <[email protected]>
BEGINRELEASENOTES
ENDRELEASENOTES
Old text before the edits:
There are a couple of reasons for this change: in some builds, some targets may not exist so this will cause an error. Also in my opinion paths for EDM4hep, ROOT and podio should be provided by the environment and failure to do so should be a test failure. When modifications are done to the test environment the run environment will be different so that reduces how useful the tests are as the same thing may fail at runtime because of the environment settings.