Skip to content
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

How to easily update a chain of internal projects? #1484

Closed
orloffm opened this issue Feb 21, 2016 · 23 comments
Closed

How to easily update a chain of internal projects? #1484

orloffm opened this issue Feb 21, 2016 · 23 comments

Comments

@orloffm
Copy link

orloffm commented Feb 21, 2016

I have a tree of internal projects that use each other via .nupkg files. I increase the version number of some Tools library. How do I then update the .locked version of this package in all other solutions? There is no way to do it other than calling paket update manually on each solution, right?

@sergey-tihon
Copy link
Member

If you would like to update all solution simultaneously you probably want to have simple .dependency and .lock file for all solutions. Why do you separate them?

@orloffm
Copy link
Author

orloffm commented Feb 23, 2016

Because a solution is a self-contained unit. It would be ridiculous to have the Tools library in a shared .dependencies used by Tools.sln.

@orloffm
Copy link
Author

orloffm commented Feb 23, 2016

To approach this problem from another point of view.

I have the projects (and dependencies):
A
B (A)
C (A, B)

Say, currently they are all 1.0.0 and reference each other via some feed/folder with .nupkg and have that versions in their .dependencies and .lock files.

Now, I introduce a CI strategy. I change AssemblyInformationalVersion in TeamCity on each build, so A builds as version 2.0.0-pre001. What should I do with B and C?

I can think of two approaches.

  1. Do not submit the .lock file to the source control. Do paket install each time instead of paket restore.
  2. Submit the .lock file, call paket update <groupname>. This requires .lock file to be checked out (from Perforce), which is ugly.

I can't understand how to make it all work together, would be grateful for any comments.

@cdrnet
Copy link
Member

cdrnet commented Feb 24, 2016

Do B and C always have to automatically use the newest version of A, meaning you do not actually want to control the versions at all (thus no need for repeatable builds)? Or is this just one specific CI build e.g. to detect potential conflicts early on?

@cdrnet
Copy link
Member

cdrnet commented Feb 24, 2016

On 1) wouldn't you then have to check out the project files, since paket install may affect them?

@orloffm
Copy link
Author

orloffm commented Feb 24, 2016

since paket install may affect them?

Yes, I also just realized the project files are always affected, even if no changes are made.

Do B and C always have to automatically use the newest version of A

Well, I think they can reference A as ~> 2.0, for example. So if I also have a local folder into which I build a local 2.0.0 version, that way paket install/update will grab that local version instead of anything prerelease in the global feed.

It comes down to what to do with paket.lock or project.csproj files. Maybe if the project files are not changed, they should not be overwritten at all?

@cdrnet
Copy link
Member

cdrnet commented Feb 24, 2016

Just to understand your scenario: If you do two builds form exactly the same source code revision of B you would expect two different results/outputs if a new version of A has been built in between (without touching A at all)?

@orloffm
Copy link
Author

orloffm commented Feb 24, 2016

@cdrnet So basically, after #1471 and c6bfd75 project files are always touched when doing paket install in abscence of paket.lock, even if nothing was changed.

Can it be covered with some optional flag? Maybe reuse the same --touch-affected-refs?

To reiterate, what i want is to get the latest available versions on each build without touching/updating/checking out anything.

@forki forki closed this as completed Mar 1, 2016
@orloffm
Copy link
Author

orloffm commented Mar 1, 2016

@forki Can you please explain? Now, after #1493, without "forceTouch" paket install works as before, does not update the .csproj files?

@orloffm
Copy link
Author

orloffm commented Mar 18, 2016

:(

@forki
Copy link
Member

forki commented Mar 19, 2016

Yes that's what @cdrnet did right?

@orloffm
Copy link
Author

orloffm commented Mar 22, 2016

@forki, no.

https://github.com/fsprojects/Paket/releases/tag/2.50.9 (before #1471 / #1485) did not update .csproj files on clean install if they were not changed. So in abscence of packages and paket.lock it was possible to restore all packages by doing paket install.

https://github.com/fsprojects/Paket/releases/tag/2.50.10 (with #1471 / #1485) always updates project files. This causes issues when working with Perforce because all files are read-only by default.

The latest https://github.com/fsprojects/Paket/releases/tag/2.54.0 (with #1493) claims "with forceTouch to only modify the last write time without content if unchanged". But it doesn't matter, it fails on read-only files anyway.

I suggest to make it not change anything in the .csproj file if there are no changes and forceTouch is not specified. The way it was before #1471 / #1485.

@forki forki reopened this Mar 22, 2016
@forki
Copy link
Member

forki commented Mar 22, 2016

I suggest to make it not change anything in the .csproj file if there are no changes and forceTouch is not specified

yes that's the goal

@cdrnet
Copy link
Member

cdrnet commented Mar 22, 2016

Currently on restore, "forceTouch" is disabled by default and can be enabled with --touch-affected-refs. For install it is always enabled. Maybe we could add an argument to optionally disable it on install (but keep it enabled by default)?

@forki
Copy link
Member

forki commented Mar 22, 2016

tbh I think it should not touch if nothing changes.

@cdrnet
Copy link
Member

cdrnet commented Mar 22, 2016

So what about doing it the same way as for restore, i.e. disabling forceTouch by default on install, add etc but enable it optionally with --touch-affected-refs?

(For the case where "nothing changes" means the project file itself does not change, but some of its dependencies have been changed)

@forki
Copy link
Member

forki commented Mar 22, 2016

yes that's what I meant --touch-affected-refs should work for paket and install. Default should be: don't touch if you don't need

@cdrnet
Copy link
Member

cdrnet commented Mar 22, 2016

That would work for me. The change should be straight forward, I can provide a PR.

@forki
Copy link
Member

forki commented Mar 22, 2016

thanks that would awesome!

2016-03-22 16:02 GMT+01:00 Christoph Ruegg [email protected]:

That would work for me. The change should be straight forward, I can
provide a PR.


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#1484 (comment)

@orloffm
Copy link
Author

orloffm commented Apr 4, 2016

@cdrnet Christoph, I don't want to be bragging, but is there any chance this can be implemented?

@cdrnet
Copy link
Member

cdrnet commented Apr 4, 2016

@orloffm Ah right; I've scheduled some time later today to put the PR together

@cdrnet
Copy link
Member

cdrnet commented Apr 7, 2016

@orloffm does v2.58.2 resolve your issues?

@orloffm
Copy link
Author

orloffm commented Apr 11, 2016

@cdrnet Yes. Amazing, thank you very much!

@orloffm orloffm closed this as completed Apr 11, 2016
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

No branches or pull requests

4 participants