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

Group "Main" and framework "auto-detect" fails when `paket install` #2011

Closed
pmiossec opened this Issue Nov 8, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@pmiossec

pmiossec commented Nov 8, 2016

On our work projects, we used to have 2 groups in our paket.dependencies file.
A 'group Main' and a 'group build'. It was working well and if I understand well, 'Main' is the default group...

We used to specify the frameworks to use but we now want to use the 'framework: auto-detect' feature because we found it more convenient ( https://github.com/fsprojects/Paket/blob/master/docs/content/dependencies-file.md#automatic-framework-detection ).

I used it with success in one of my opensource project but failed to use it on most of our work projects with the error "The framework restriction could not be determined" during a paket install.

After a lot of time, I think I've found where it comes from.
In fact, specifying the 'group Main' is not 100% equivalent to not specifying it (contrary to what I thought... should it be equivalent?)

When you don't use the 'group Main', the install work with 'framework: auto-detect'.
When you add the 'group Main', the install fail.

Is that normal?
If yes, perhaps, something should be added to the documentation that the 2 options are incompatible.
If no, it seems that there is a bug...

@smoothdeveloper

This comment has been minimized.

Show comment
Hide comment
@smoothdeveloper

smoothdeveloper Nov 8, 2016

Contributor

I think options that are defined at top level don't appear in groups, if you define top level options while having group Main explicitly defined I'd expect the behaviour to still be that way.

Maybe a warning can be given if top level options are defined as well as an explicit Main group, I think this is better than a special rule for group Main

Contributor

smoothdeveloper commented Nov 8, 2016

I think options that are defined at top level don't appear in groups, if you define top level options while having group Main explicitly defined I'd expect the behaviour to still be that way.

Maybe a warning can be given if top level options are defined as well as an explicit Main group, I think this is better than a special rule for group Main

@pmiossec

This comment has been minimized.

Show comment
Hide comment
@pmiossec

pmiossec Nov 8, 2016

@smoothdeveloper That's what I imagined but specifying the options in the 'Main' group don't work either :(

If I have for example a paket.dependency file :

    framework: auto-detect
    source https://nuget.org/api/v2

    //group Main

    nuget xunit

    group Build
        framework: 4.5
        redirects: off
        source https://nuget.org/api/v2

    nuget GitVersion.CommandLine

It works. But since I uncomment the group line, that fail. And repeating the 'framework' or 'source' option in the 'main' group do not solve the problem :(

pmiossec commented Nov 8, 2016

@smoothdeveloper That's what I imagined but specifying the options in the 'Main' group don't work either :(

If I have for example a paket.dependency file :

    framework: auto-detect
    source https://nuget.org/api/v2

    //group Main

    nuget xunit

    group Build
        framework: 4.5
        redirects: off
        source https://nuget.org/api/v2

    nuget GitVersion.CommandLine

It works. But since I uncomment the group line, that fail. And repeating the 'framework' or 'source' option in the 'main' group do not solve the problem :(

@pmiossec

This comment has been minimized.

Show comment
Hide comment
@pmiossec

pmiossec Nov 24, 2016

To narrow the problem, that's just that we can't use the framework: auto-detect inside a group :(
It begins to be very annoying...
I hope it could be fixed soon.

To narrow the problem, that's just that we can't use the framework: auto-detect inside a group :(
It begins to be very annoying...
I hope it could be fixed soon.

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Nov 24, 2016

Member
Member

forki commented Nov 24, 2016

@pmiossec

This comment has been minimized.

Show comment
Hide comment
@pmiossec

pmiossec Nov 24, 2016

Sure. With pleasure. I will do that...

Sure. With pleasure. I will do that...

@pmiossec

This comment has been minimized.

Show comment
Hide comment
@pmiossec

pmiossec Nov 24, 2016

Here is a repo with the problem: https://github.com/pmiossec/ReproPaketFwkAutodetectAndGroup

After some other test, my previous message was not perfectly right (I should have missed something at work this afternoon...).

The exact failing case is when you explicitly define the group Main with framework: auto-detect.
If you remove group Main, it works. You could get it when following the git history of the repository...

I will retry at work for my case tomorrow but it seems not blocking (even if somewhat quite not beautiful!!).
I will just have to remove all the group Main that colleagues used to put on every of our repositories :(
A fix is welcomed but perhaps not so urgent... I let you know.

Here is a repo with the problem: https://github.com/pmiossec/ReproPaketFwkAutodetectAndGroup

After some other test, my previous message was not perfectly right (I should have missed something at work this afternoon...).

The exact failing case is when you explicitly define the group Main with framework: auto-detect.
If you remove group Main, it works. You could get it when following the git history of the repository...

I will retry at work for my case tomorrow but it seems not blocking (even if somewhat quite not beautiful!!).
I will just have to remove all the group Main that colleagues used to put on every of our repositories :(
A fix is welcomed but perhaps not so urgent... I let you know.

@forki forki added the bug label Nov 25, 2016

@forki forki closed this in f82f396 Nov 25, 2016

@pmiossec

This comment has been minimized.

Show comment
Hide comment
@pmiossec

pmiossec Nov 26, 2016

Thanks for the fix (and for all your work!)

Even if, funnily, the fix arrived 20 min too late ;) I was presenting this feature to my team and was obliged to say that there was a limitation...to see it fix when leaving the meeting :D

Anyway, great stuff!! Thanks again.

Thanks for the fix (and for all your work!)

Even if, funnily, the fix arrived 20 min too late ;) I was presenting this feature to my team and was obliged to say that there was a limitation...to see it fix when leaving the meeting :D

Anyway, great stuff!! Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment