Skip to content

Refactor backend for incremental rebuilds #248

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

Merged
merged 11 commits into from
Dec 2, 2020
Merged

Refactor backend for incremental rebuilds #248

merged 11 commits into from
Dec 2, 2020

Conversation

LKedward
Copy link
Member

@LKedward LKedward commented Nov 21, 2020

This PR contains the required changes to implement incremental rebuilds (Resolves #212):

  • Moves enumeration of link objects to occur before the backend is called
  • Adds source file hashing to determine whether targets need rebuilding
  • Separates target scheduling from target compilation which:
    • allows unit-testing of backend sorting and scheduling
    • optionally allows parallel builds when compiled with openmp (bootstrap: fpm build --flag -fopenmp --flag -O3)

Separate build targets into schedule regions for parallel builds.
Move enumeration of link target object dependencies out of backend and into fpm_targets module.
Add string_cat function for concatenating arrays of string_t.
Add comments and procedure descriptions.
@LKedward LKedward marked this pull request as ready for review November 25, 2020 12:15
@LKedward LKedward changed the title WIP: Refactor backend for incremental rebuilds Refactor backend for incremental rebuilds Nov 25, 2020
@awvwgk awvwgk added this to the First beta release milestone Nov 25, 2020
@awvwgk awvwgk mentioned this pull request Nov 28, 2020
9 tasks
Copy link
Member

@awvwgk awvwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works really well so far. I had a few issues when switching branches with git and rebuilding, but those might also result from incompatible module files left in the build directory (I would clean the build directory anyway for those cases). So no real failures so far, which is great.

Just some minor comments below.

Lowercase openmp pragmas
@LKedward
Copy link
Member Author

Thanks for reviewing; suggestions applied.

I had a few issues when switching branches with git and rebuilding, but those might also result from incompatible module files left in the build directory

I've been having this issue with the bootstrap version but can't find the source of the problem. I haven't (yet) encountered this problem with this Fortran implementation — I will look into it for a future PR 👍

@awvwgk
Copy link
Member

awvwgk commented Nov 28, 2020

I've been having this issue with the bootstrap version but can't find the source of the problem. I haven't (yet) encountered this problem with this Fortran implementation

Maybe I encountered this while running fpm run -- build, hard to tell exactly which fpm failed, since it was an issue from gfortran complaining about incompatible module files. I cleaned both build directory afterwards (rm -r build/gfortran_*), but we will certainly get the chance to mess the build process up often enough in the future.

@LKedward
Copy link
Member Author

LKedward commented Dec 2, 2020

Many thanks for reviewing; I'll merge later today if there are no more comments.

@urbanjost
Copy link
Contributor

Apparently there is an issue with an old version of Firefox working with the reviews. I thought I had approved this days ago but I noticed it is not checked. Others comments covered my issues so I have no problem with this going forward. Sorry if that caused a delay. Hopefully this works from this browser.

@LKedward LKedward merged commit af67eae into fortran-lang:master Dec 2, 2020
@LKedward LKedward deleted the incremental2 branch December 2, 2020 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement incremental rebuild
4 participants