Skip to content

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

Description

@pmiossec

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...

Activity

  1. smoothdeveloper commented on Nov 8, 2016

    @smoothdeveloper
    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

  2. pmiossec commented on Nov 8, 2016

    @pmiossec
    Author

    @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 :(

  3. pmiossec commented on Nov 24, 2016

    @pmiossec
    Author

    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.

  4. forki commented on Nov 24, 2016

    @forki
    Member
  5. pmiossec commented on Nov 24, 2016

    @pmiossec
    Author

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

  6. pmiossec commented on Nov 24, 2016

    @pmiossec
    Author

    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.

  7. pmiossec commented on Nov 26, 2016

    @pmiossec
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions