-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use a two step Fortran and C++ dependency scanner #12539
base: master
Are you sure you want to change the base?
Commits on Oct 1, 2024
-
environment: build_dir is allowed to be None in the initializer
But we really expect it to be a string once the initializer is done. Therefore, let's set it to `''` just like we do with the scratchdir in the case that it's set to None in the initializer.
Configuration menu - View commit details
-
Copy full SHA for 072d637 - Browse repository at this point
Copy the full SHA 072d637View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0eba09d - Browse repository at this point
Copy the full SHA 0eba09dView commit details -
tests: our fortran order deps are wrong if a new module is introduced
Because we don't set the appropriate dependencies
Configuration menu - View commit details
-
Copy full SHA for 1a791a3 - Browse repository at this point
Copy the full SHA 1a791a3View commit details -
backend/ninja: fortran must fully depend on all linked targets
Because we use this dependency to ensure that any binary module files are generated, we must have a full dependency. Otherwise, if a new module is added to a dependent target, and used in our target, we race the generation of the binary module definition.
Configuration menu - View commit details
-
Copy full SHA for 810ae00 - Browse repository at this point
Copy the full SHA 810ae00View commit details -
build: annotate all
get_all_link_deps
the sameAnd fix some internal annotations
Configuration menu - View commit details
-
Copy full SHA for aa5f8bf - Browse repository at this point
Copy the full SHA aa5f8bfView commit details -
build: include each target in get_transitive_link_deps
Otherwise only shared libraries get installed, which isn't correct.
Configuration menu - View commit details
-
Copy full SHA for cd7acdc - Browse repository at this point
Copy the full SHA cd7acdcView commit details -
build: add link_whole_targets to get_transitive_link_deps
Otherwise we again miss out on half of the targets we need
Configuration menu - View commit details
-
Copy full SHA for 3db1209 - Browse repository at this point
Copy the full SHA 3db1209View commit details -
backend/ninja: Fortran targets need to -I transitive deps private dirs
Otherwise they won't be able to find their module outputs.
Configuration menu - View commit details
-
Copy full SHA for de2b237 - Browse repository at this point
Copy the full SHA de2b237View commit details -
backend/ninja: depfile generation needs a full dependency on all scan…
…ned sources It is not sufficient to have an order dependency on generated sources. If any of those sources change we need to rescan, otherwise we may not notice changes to modules.
Configuration menu - View commit details
-
Copy full SHA for 346b252 - Browse repository at this point
Copy the full SHA 346b252View commit details -
backend/ninja: fix cross module dependencies
This requires that every Fortran target that uses modules have a full dependency on the scan target of it's dependencies. This means that for a three step target `A -> B -> C`, we cannot start compiling any of B until all of A is linked, and cannot start compiling any of C until all of A and B is linked. This fixes various kinds of races, but it serializes the build and makes it slow. This is the best we can do though, since we don't have any sort of portable format for telling C what is in A and B, so C can't know what sources to wait on for it's modules to be fulfilled.
Configuration menu - View commit details
-
Copy full SHA for 8d9bb1e - Browse repository at this point
Copy the full SHA 8d9bb1eView commit details -
backend/ninja: use a two step process for dependency scanning
This splits the scanner into two discrete steps, one that scans the source files, and one that that reads in the dependency information and produces a dyndep. The scanner uses the JSON format from https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html, which is the same format the MSVC and Clang use for C++ modules scanning. This will allow us to more easily move to using MSVC and clang-scan-deps when possible. As an added bonus, this correctly tracks dependencies across TU and Target boundaries, unlike the previous implementation, which assumed that if it couldn't find a provider that everything was good, but could run into issues. Because of that limitation Fortran code had to fully depend on all of it's dependencies, transitive or not. Now, when using the dep scanner, we can remove that restriction, allowing more parallelism.
Configuration menu - View commit details
-
Copy full SHA for 86bfada - Browse repository at this point
Copy the full SHA 86bfadaView commit details -
tests/fortran: also test using a generator()
We already test for custom_targets and configure_file, but we should test a generator too
Configuration menu - View commit details
-
Copy full SHA for 680c117 - Browse repository at this point
Copy the full SHA 680c117View commit details -
tests/fortran: use fs.copyfile
Since the comment saying we need a generic way to do this is a little outdated.
Configuration menu - View commit details
-
Copy full SHA for 0ce68be - Browse repository at this point
Copy the full SHA 0ce68beView commit details