-
Notifications
You must be signed in to change notification settings - Fork 525
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
Incremental build with MsBuild #1471
Comments
That's an interesting point, but I'm not sure what we can do here. The goal was always to keep the csproj as stable as possible. |
An approach that might help here could work along the lines of
|
I see 2 options to solve this issue:
To me, this is a MsBuild bug, as Visual Studio is smart enough to rebuild. |
question is if we can do something in paket!? |
As cdrnet proposed, paket could touch on the file system projects impacted by a new package dependency update. That would force MsBuild to rebuild all those csproj. |
I guess an easy solution would be to touch all projects when update changed at least one dependency. Of course that is touching more files than needed, but would probably work. |
please try latest |
It seems to me there are two different situations where MsBuild fails to detect changed dependencies: A) Active: I make the change to paket.lock myself (paket.exe install, or via add, remove, update) With the latest version, in case A) incremental builds do indeed detect that a rebuild is required, so the fix does work. Thanks! Case B) is a bit more involved and I don't think touching project files on restore should be the default behavior, but it might be optional (e.g. something along the lines of |
👍 cdrnet |
Hi guys, This change causes a bit of an issue with our team. Our default usage for our SCM is to check out files as read-only files. This works great with paket since most of the time, the project files do not need to change. We only check out the files when we have a real change (paket or otherwise). We do run "paket update" fairly frequently but most of the packages that we use are fixed at a version. Would it be possible to implement a change such that project files are only touched when a project that they referenced has been updated? (I understand that this could be a quite a bit of work to do.) Probably better for us would be to have the default behavior not do this but be possible with a flag (like cdrnet suggested). We do use MSBuild on our project and have started using incremental build too. I think this would be a good feature to have for our team. Short version: +1 to cdrnet's Case B suggestion (optional flag - default behavior does not touch project files) |
FYI I have opened another issue in MsBuild: @jschroed cdrnet and I are working in the same team. We are interested in implementing cdrnet's proposal that would touch csproj files for projects impacted by an updated library. This behavior would be activated by an optional parameter. Would that work for your case? @forki let us know if you are OK with this plan. |
@Vilmir, yes that would be perfect for us. |
Yes every help would be appreciated. But I'm not near a pc for 2 weeks.
|
Happy holiday Forki! |
We have recently updated our product codebase to use Paket instead of Nuget for managing our package dependencies.
Our developers are quite pleased by this move, but we discovered a cumbersome behavior of MsBuild in incremental builds.
Our build script builds all our csproj in a single MsBuild task. It is used as an incremental build, meaning that for most of the situation we do not clean anything before building. This was working well with NuGet. But with Paket, csproj may not be rebuilt while they shall.
It happens when someone updates an existing library package to a new version, without modifying anything in a given project using this lib. Paket updates the paket.lock file and does not modify the csproj using the library, because the unzipped path does not change.
Visual Studio handles this case well, it understands that the referenced assembly did get an update and rebuilds the csproj.
MsBuild does not handle this case, and does not rebuild the csproj. It seems that MsBuild does not consider referenced assemblies as inputs to decide whether or not to rebuild.
The assembly produced by the csproj still uses the old, now depreciated library assembly. If this assembly is called, it fails with a dependency not found error.
I have created a small project here to repro the problem with the library Autofac:
https://github.com/Vilmir/IncrementalBuildCheckWithPaket
Repro steps:
The text was updated successfully, but these errors were encountered: