-
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
Allow Pack to pin only project references #1648
Comments
Related to #1360. If I believe it still makes sense even if |
/cc @inosik |
I decided to change this option's name to |
I would just advocate KISS here and simply use One other reason I think |
I don't believe users should have to call out every dependency in |
Then I think the real issue isn't actually about pinning, but about having better control of project dependencies. But how would that look like? |
Correct, that is the issue I am trying to tackle. The way I implemented it is as simple as possible in that it only allows you to specify either = (with the I suppose you could support more options, but I was trying to keep it simple and support what I have encountered as the two most likely paths people wish to take. |
Which you can with The reason I made But as I already wrote, it wasn't a good idea in the first place 😄 |
Yes, packages are packages. But there is already a way to control the versioning scheme of an external dependency, even when those external dependencies are generated by My whole point is that it should not be necessary (and is error prone) to maintain all references in |
Not sure about this, though. I have a small toolkit with 3 projects, only A referencing B (no C here), and no external dependencies. I had the idea of defining the version constraint in the project file, like this: <ProjectReference Include="..\Foo.Core\Foo.Core.csproj">
<Project>The guid ...</Project>
<Name>Foo.Core</Name>
<!--
M, m and p are tokens which get replaced with Major, Minor and Patch, respectively. Then
the content of this element gets parsed with Paket's constraint parser.
-->
<PaketVersionConstraint>~> M.m.p</PaketVersionConstraint>
</ProjectReference> I actually started implementing it, but realized that it isn't any better than manually maintaining I agree that it's too easy to forget to update |
The solutions I wish to apply this to all have over 10 projects.
Automatically generated dependencies from project references by definition MUST use a single algorithm. Currently, the only choice is (>=), which I think is a bad default. (I know it's the default in Anything more complex than these versioning schemes, and yes, you're pretty much forced to manage the dependencies manually in So I guess if we don't want to add another option to |
Might be okay for projects where all packages have the same version and get released together. Then a The other approach is to version and release them independently, which is what I try to do. Because otherwise I'm forced to release a new version of A, even if only B changed. I hope this clarifies why I consider pinning a rather bad idea.
Or some kind of option (command line or config setting), which lets you override the default behavior with whatever you like? |
That sounds like a good idea. I think a command line option would make the most sense. Do you have any thoughts on what versioning schemes it should support and syntax (should it allow placeholders, etc)? Something like --project-reference-versioning="= {version}" or something? Should it allow access to major/minor/etc? I was trying to keep it simple, but if you think flexible and complex would be better, I'm OK with that. I only need it to support (=), so I'm OK with anything from removing the option and making (=) the default to implementing substitutions so more complex versioning could be put in place. Let me know what you have in mind. Thanks. |
Not sure if it fits the bill, but there is already a pack flag "minimum-from-lock-file" that doesn't pin the version number of the dependencies at exact versions. |
So, what about this issue?) This would be very useful. |
It would be very usefull to controll project references default behavior , any one can add this ? @forki ? |
Revisiting the discussion above, I do not believe a more complex setting for controlling project dependencies should be pursued. In the interest of keeping things simple, I believe this setting alone (on or off) allows for the two most common scenarios to be handled automatically when using automatic dependencies inferred from project references. If projects within a solution are guaranteed to maintain backwards compatibility, then the default setting ( However, if backwards compatibility between the projects within a solution is not guaranteed, then a user upgrading a package for one of the projects should be forced to upgrade to the corresponding version for any other packages built from the same solution to ensure they all stay in sync. The (=) specification is the only way to enforce this, and would be able to be specified using this new |
The |
Closing |
Description
Currently, the pack command allows for specifying
lock-dependencies
to force all generated dependencies to be specific (picked up from thepaket.lock
file) rather than use the version specification from thepaket.dependencies
file.However, the version specification of generated project reference dependencies is also controlled by this setting. If
lock-dependencies
is specified, the project reference versions are pinned (=), but if it is not specified, they are minimums (>=). A new setting could be introduced (pinned-project-references
) to allow for the project references to be pinned while still using the version specification frompaket.dependencies
for any external dependencies.Repro steps
This is a feature request.
Expected behavior
The two settings
lock-dependencies
andpinned-project-references
would work together as follows:Neither
pinned-project-references
norlock-dependencies
specified:External dependencies: Version specification picked up from
paket.dependencies
.Project references: Version specification is minimum (>=).
pinned-project-references
is specified, butlock-dependencies
is not specified:External dependencies: Version specification picked up from
paket.dependencies
.Project references: Version specification is pinned (=).
lock-dependencies
is specified (pinned-project-references
does not matter):External dependencies: Version specification picked up from
paket.lock
(pinned).Project references: Version specification is pinned (=).
Actual behavior
Either external dependencies and project references must both be pinned, or neither be pinned.
Known workarounds
There is no known workaround.
Related information
N/A
The text was updated successfully, but these errors were encountered: