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

WIP: Fix dotnetcore #2252

Closed
wants to merge 18 commits into from
Closed

WIP: Fix dotnetcore #2252

wants to merge 18 commits into from

Conversation

matthid
Copy link
Member

@matthid matthid commented Apr 14, 2017

This should remove various hacks added over the time when I was kind of offline.

TODO:

  • proper runtime support in InstallModel
  • disabled "simplify" code-path for msbuild targets -> this part was reviewed, I think the current behavior is more deterministic and if we simplify conditions for targets we should do the same for references...

Breaks:

  • /Lib/... is lo longer supported (folder in nuget package needs to be /lib/... works again - feels wrong
  • Currently runtime support is removed (see above)

Adds:

  • InstallModel can properly resolve reference and runtime assemblies (required in FAKE vNext for compilation and running of scripts)
  • This enables the complete nuget replacement in dotnetcore world at a later time.
  • Incidentally Improves C++ support

else
let nativePart = getNative path
let libPart = path.Substring(startPos + infix.Length + 1, endPos - startPos - infix.Length - 1)
Some (libPart + nativePart)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this code is really gives one a good feeling :)

let sortedTargets = model.TargetsFileFolders |> List.sortBy (fun lib -> lib.Path)
//sortedTargets
//|> List.partition (fun lib -> allTargetProfiles = set lib.Targets )
([] : LibFolder list), sortedTargets
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be some code-path to "simplify" the generated project file. However it seems like it was never actually used.
After removing runtime this seems to work again (and breaks some tests).

Should we get rid of this simplification (as it was never used) or should I update the tests?

|> Option.map (fun (l,_) -> { Path = l; File = p; Runtime = RuntimeIdentifier.Any })
|> Option.orElseWith (fun _ ->
(trySscanf "build/%A{noSeperator}" p.PathWithinPackage : string option)
|> Option.map (fun (_) -> { Path = Tfm.Empty; File = p; Runtime = RuntimeIdentifier.Any }))
Copy link
Member Author

@matthid matthid Apr 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this part is now quite readable. I'm open for suggestions though.

  • trySscanf is not completely type-safe (therefore the type annotations).
  • The %A{scanner} "extension" was invented by me to solve the problem of scanning for files.

@matthid
Copy link
Member Author

matthid commented Apr 15, 2017

Related/Reverted #1626 and a40e5d5

<Import Project="..\..\packages\MultiTarget\build\MultiTarget.props" Condition="Exists('..\..\packages\MultiTarget\build\MultiTarget.props')" Label="Paket" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite sure about this change.
What is the difference between a "global" and a "frameworkSpecific" msbuild file?
Paket seems to add global ones on top, but these tests seem to test the reverse?
Are those tests broken? What are the criteria for "global" msbuild?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my try to fix #2227.
Nuget always adds props to the top. The distinction of "global" is specific to that, there is no such thing in nuget.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0x53A thanks. so global is everything directly in the build folder, correct?
Is the current output acceptable? I have no Idea what I did that the ordering with the existing item changed... If not can you spot the relevant change (it's ok if not but than I know I have to take a deeper look)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthid I had tried to be smart. Global was everything either directly in the build folder, or for a list of frameworks that exactly matches the framework restriction. I think my use case still works (Fsharp.Compiler.Tools), I don't know if there are other problematic packages that Must be imported at the top.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0x53A perfect, if you can live with this new behavior life is good

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For why it moved: previously it was (incorrectly) tagged as framework-specific, not global:
image

With your simplified Partition(List.partition (fun lib -> "" = lib.Path.Name )), this is now correctly detected as global.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming this!

@matthid
Copy link
Member Author

matthid commented Apr 15, 2017

I think this is ready to be reviewed or get feedback, though not completely finished.

I removed the runtime support as I think it is a cross cutting concern and therefore shouldn't be part of FrameworkIdentifier.

Next step is to make runtime work again (but I think the big changes have been done).

@forki can you make an alpha out of this (leaving this pr open) so I can start testing on fake vnext?

This was referenced Apr 17, 2017
@matthid
Copy link
Member Author

matthid commented Apr 18, 2017

Closing in favor of #2256

@matthid matthid closed this Apr 18, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants