Skip to content

Consider adding Humanizer to source-build #1767

Closed

Description

@crummel

Roslyn uses Humanizer to pluralize and convert to/from CamelCase for human-friendly automatic variable names and debug output. This was removed in #1766 to remove the prebuilt. We should either work with Roslyn to eliminate this dependency or add the Humanizer repo to source-build.

Activity

  1. added
    area-product-experience
    area-additional-repos
    on Sep 24, 2020
  2. added
    area-patch-removal
    on Oct 8, 2020
  3. added a commit that references this issue on Oct 23, 2020
  4. dagood commented on Oct 30, 2020

    @dagood
    Member

    For 5.0 GA, #1845 removes the patch that had removed the Humanizer prebuilt. Humanizer got a lot more usage in GA and it wasn't reasonable to try to reapply it all while trying to get GA through. We'll either need to recreate the patch or add the repo. /cc @dseefeld

    The repo looks like a normal-enough csproj... I think we should try that. I'm wondering if some of the new usages might be more impactful than the old ones, and would make more of a feature gap if we tried to patch them out manually.

  5. dagood commented on Oct 30, 2020

    @dagood
    Member

    @omajid @tmds I think adding this repo might be a reasonable thing for one of you to pick up if you can. (Shouldn't involve as much delving into binlogs and such.)

  6. added a commit that references this issue on Oct 30, 2020
  7. omajid commented on Nov 2, 2020

    @omajid
    Member

    Humanizer is also used by roslyn-analyzers

  8. self-assigned this
    on Nov 2, 2020
  9. omajid commented on Nov 2, 2020

    @omajid
    Member

    The Microsoft SDK doesn't include Humanzier, does it?

    $ tar tf dotnet-sdk-5.0.100-rc.2.20479.15-linux-x64.tar.gz | grep -i human
    <empty>
    

    Is this shipped with the SDK?

  10. dagood commented on Nov 2, 2020

    @dagood
    Member

    Huh... maybe none of the projects (as in csproj) that build using Humanizer actually ship in the .NET SDK? Considering we had to actually patch .cs files that contain using Humanizer; that's the only thing that makes sense to me right now.

    If we can disable unused projects, that'd be ideal. If for some reason that doesn't work yet we do know the projects aren't used, we could put Humanizer in SBRP.

    @crummel, do you know more about this, since you implemented the first patch?
    @dseefeld, any insight on how this has potentially changed in GA?

    The last possibility I can think of is Humanizer being used at build-time but not in the SDK, somehow. I don't have any evidence pointing to it. If we disable the projects or put Humanizer as a ref package, it seems more likely that we'll see a build break rather than something subtle (a string breaking somewhere in the SDK), so I don't think this is a big concern.

  11. crummel commented on Nov 2, 2020

    @crummel
    ContributorAuthor

    I'm pretty sure Microsoft.CodeAnalysis.CSharp.Workspaces should at least be shipping, the other code style projects maybe not. I'm taking a look now.

  12. omajid commented on Nov 2, 2020

    @omajid
    Member

    I tried building roslyn after removing the using Humanizer references and get:

    /home/omajid/devel/dotnet/roslyn/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SemanticModelExtensions.cs(236,80): error CS1061: 'string' does not contain a definition for 'Pluralize' and no accessible extension method 'Pluralize' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) [/home/omajid/devel/dotnet/roslyn/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj]
    /home/omajid/devel/dotnet/roslyn/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SemanticModelExtensions.cs(262,46): error CS1061: 'string' does not contain a definition for 'Pluralize' and no accessible extension method 'Pluralize' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) [/home/omajid/devel/dotnet/roslyn/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj]
    /home/omajid/devel/dotnet/roslyn/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SemanticModelExtensions.cs(236,80): error CS1061: 'string' does not contain a definition for 'Pluralize' and no accessible extension method 'Pluralize' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) [/home/omajid/devel/dotnet/roslyn/src/CodeStyle/CSharp/Analyzers/Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj]
    /home/omajid/devel/dotnet/roslyn/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SemanticModelExtensions.cs(262,46): error CS1061: 'string' does not contain a definition for 'Pluralize' and no accessible extension method 'Pluralize' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) [/home/omajid/devel/dotnet/roslyn/src/CodeStyle/CSharp/Analyzers/Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj]
    /home/omajid/devel/dotnet/roslyn/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SemanticModelExtensions.cs(236,80): error CS1061: 'string' does not contain a definition for 'Pluralize' and no accessible extension method 'Pluralize' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) [/home/omajid/devel/dotnet/roslyn/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj]
    /home/omajid/devel/dotnet/roslyn/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SemanticModelExtensions.cs(262,46): error CS1061: 'string' does not contain a definition for 'Pluralize' and no accessible extension method 'Pluralize' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) [/home/omajid/devel/dotnet/roslyn/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj]
    0 Warning(s)

    The RC2 SDK includes Microsoft.CodeAnalysis.CSharp.CodeStyle.dll, one of the projects that are erroring out:

    $ tar tf dotnet-sdk-5.0.100-rc.2.20479.15-linux-x64.tar.gz | grep -i Microsoft.CodeAnalysis.CSharp.CodeStyle.dll
    ./sdk/5.0.100-rc.2.20479.15/Sdks/Microsoft.NET.Sdk/codestyle/cs/Microsoft.CodeAnalysis.CSharp.CodeStyle.dll
    
  13. dagood commented on Nov 2, 2020

    @dagood
    Member

    It looks like Roslyn removed the references from a lot of projects except Microsoft.CodeAnalysis.CSharp.Workspaces: dotnet/roslyn#47297, and there are some (unfulfilled?) plans to add a Humanizer reference to dotnet/sdk. Our dotnet/roslyn commit seems to be in a weird spot: after Humanizer refs were added, but in the wrong places.

    Microsoft.CodeAnalysis.CSharp.Workspaces should at least be shipping, the other code style projects maybe not.

    I'm seeing kind of the opposite in terms of the DLLs being in the SDK. Nothing for find . -iname '*workspaces*' in the SDK, but Microsoft.CodeAnalysis.CSharp.CodeStyle.dll is where @omajid found it.

    Which would be a good thing for us. Maybe Microsoft.CodeAnalysis.CSharp.Workspaces is VS-specific and we don't care about all this?

  14. 14 remaining items

  15. dagood commented on Nov 16, 2020

    @dagood
    Member

    We still need it for Roslyn though, right? @omajid are you still planning to work on this?

  16. omajid commented on Nov 16, 2020

    @omajid
    Member

    We still need it for Roslyn though, right?

    I am still a little confused as to why it's not shipped as part of the Microsoft SDK ...

    @omajid are you still planning to work on this?

    If we (still) need it in source-build, sure, I can look into this.

  17. dagood commented on Nov 17, 2020

    @dagood
    Member

    When/where do you expect Humanizer.dll to show up in the .NET SDK?

    Well, I'm surprised Workspaces isn't showing up in the SDK. And I'm therefore surprised that the dependencies of Workspaces aren't showing up in the SDK.

    @333fred have you looked into this?

    I am still a little confused as to why it's not shipped as part of the Microsoft SDK ...

    We could throw it in SBRP if it's only compiled against and never executed, I guess. Since it's not shipping in the SDK that seems possible.

    We weren't able to patch out usages in the 5.0.0 GA PR (#1767 (comment)) so it doesn't seem worthwhile to try that approach again.

  18. added 8 commits that reference this issue on Nov 17, 2020
    e7312b3
    9038fcb
    00006d2
    f9faf63
    e83b81c
    0de1500
    2f27b3a
    6691b42
  19. added a commit that references this issue on Nov 19, 2020
    3be0c72
  20. omajid commented on Nov 20, 2020

    @omajid
    Member

    Fixed with #1895

  21. added a commit that references this issue on Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-additional-reposarea-patch-removalarea-product-experience

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions