Code Monkey home page Code Monkey logo

Comments (37)

eulerfx avatar eulerfx commented on July 19, 2024 1

from fsharp.control.asyncseq.

dsyme avatar dsyme commented on July 19, 2024

@eulerfx I think we can just make this a .NET Standard 1.6 library? Just one edition, no extra Profile DLL?

The existing Profile7 lib may also be already usable as a .NET Standard 1.6 library, I'm not sure

// cc @enricosada

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

@dsyme: Ok, I'll take a look at that. To be honest, I'm quite unfamiliar with .NET Standard/.NET Core stuff, so will ask for some help.

from fsharp.control.asyncseq.

sergey-tihon avatar sergey-tihon commented on July 19, 2024

@eulerfx If you need reference - I compile FsUnit for nestandard16 and then package using netcore and merge packages (build script).
I guess that we still need to maintain lib/net40 folder in package with dlls because old IDEs/VS does not understand net standard.

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

@sergey-tihon: thanks for the tip! I started making these changes on my branch.

  • What other steps are required to publish a .NET standard targeted package in addition to the existing one?
  • "because old IDEs/VS does not understand net standard" - does this mean that the only way I can build the new .fsproj file is via command line? Or can I used VS2017?

Thanks!

from fsharp.control.asyncseq.

sergey-tihon avatar sergey-tihon commented on July 19, 2024

What other steps are required to publish a .NET standard targeted package in addition to the existing one?

No, just put assemblies for netstandard into lib/netstandard1.6/ folder (in the same package).

"because old IDEs/VS does not understand net standard" - does this mean that ...

This means that you still need to put assemblies compiler for full framework into lib/net45/* folder.

I can build the new .fsproj file is via command line? Or can I used VS2017?

I did it manually using VS Code, VS2017 does not support it new proj format.

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

No, just put assemblies for netstandard into lib/netstandard1.6/ folder (in the same package).

  • Do I do this manually, or via fake/paket?
  • Do I need to modify paket.template to account for this?

from fsharp.control.asyncseq.

sergey-tihon avatar sergey-tihon commented on July 19, 2024

It may be already possible (with latest beta of paket and new paket.template file, one per fsproj) but I did

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

Any updates on this?

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

hey @Alxandr no updates. I gave this a shot earlier, but got stuck and gave up. I will have another go at his however as we've an interest to start porting things to .NET Core as soon as possible.

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

I just "ported" this to .NET Standard 2.0 in less than 10 minutes (it compiles, no tests or similar). It should not be hard to do :)

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

Nice! Can you share how you did it?

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

Created new folder, ran dotnet new classlib --language F#, pasted the 2 source files, ran dotnet build.

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

How can I target both .NET core and the existing .NET framework?

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

With netstandard. Or multitarget.

This is the entire msbuild file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="AsyncSeq.fsi" />
    <Compile Include="AsyncSeq.fs" />
  </ItemGroup>

</Project>

If you change <TargetFramework>netstandard2.0</TargetFramework> to <TargetFrameworks>netstandard2.0;net461</TargetFrameworks> you should get both in one nuget package just like that (in theory at least).

Note: TargetFramework for 1, and TargetFrameworks (with an s) for multiple

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

Also, netstandard != netcore. netstandard runs on netcore, full net framework, and xamarin.

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

I tried running the tests, but I got a System.NullReferenceException. That's unfortunately as far as I can go on my mac.

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

This is actually somewhat suspicious, cause all of the stactrace seems to be framework/compilergenerated code:

The active test run was aborted. Reason: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at [email protected](AsyncParams`1 args)
   at <StartupCode$FSharp-Core>.$Control.loop@425-51(Trampoline this, FSharpFunc`2 action)
   at Microsoft.FSharp.Control.Trampoline.ExecuteAction(FSharpFunc`2 firstAction)
   at <StartupCode$FSharp-Core>[email protected](Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

Hmm any idea which test this was? All of them?

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

My guess it it's outside of tests. Probably some static constructor or similar. Full output:

Running all tests in /Users/alxandr/hub/xando/test/FSharp.Control.AsyncSeq.Test/bin/Debug/netcoreapp2.0/FSharp.Control.AsyncSeq.Test.dll
NUnit3TestExecutor converted 109 of 109 NUnit test cases
The active test run was aborted. Reason: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at [email protected](AsyncParams`1 args)
   at <StartupCode$FSharp-Core>.$Control.loop@425-51(Trampoline this, FSharpFunc`2 action)
   at Microsoft.FSharp.Control.Trampoline.ExecuteAction(FSharpFunc`2 firstAction)
   at <StartupCode$FSharp-Core>[email protected](Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()


Total tests: 9. Passed: 9. Failed: 0. Skipped: 0.
Test Run Failed.
Test execution time: 5.1395 Seconds

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

Are you able to run the code directly, outside of a test, but perhaps with a script file?

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

I don't know how to run scripts files using netcore :P

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

I can make a main though?

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

Ah I guess we don't have an fsi in netcore? Main would work I suppose.

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

What should I run though? One by one test?

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

I was thinking any of them, just to see if it works.

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

Well, it does say that 9 tests passed, so I would guess so? I'll do some quick testing.

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

Hmm. Weird. All tests passing when I don't run using NUnit.

[<EntryPoint>]
let main argv =
  let tests = [
    ``AsyncSeq.never should equal itself``
    ``AsyncSeq.toArray``
    ``AsyncSeq.toList``
    ``AsyncSeq.concatSeq works``
    ``AsyncSeq.sum works``
    ``AsyncSeq.length works``
    ``AsyncSeq.contains works``
    ``AsyncSeq.tryPick works``
    ``AsyncSeq.pick works``
    ``AsyncSeq.tryFind works``
    ``AsyncSeq.exists works``
    ``AsyncSeq.forall works``
    ``AsyncSeq.cache should work``
    ``AsyncSeq.unfoldAsync``
    ``AsyncSeq.unfold``
    ``AsyncSeq.unfold choose``
    ``AsyncSeq.interleaveChoice``
    ``AsyncSeq.interleaveChoice second smaller``
    ``AsyncSeq.interleaveChoice second empty``
    ``AsyncSeq.interleaveChoice both empty``
    ``AsyncSeq.interleaveChoice first smaller``
    ``AsyncSeq.interleaveChoice first empty``
    ``AsyncSeq.interleave``
    ``AsyncSeq.interleave second smaller``
    ``AsyncSeq.interleave second empty``
    ``AsyncSeq.interleave both empty``
    ``AsyncSeq.interleave first smaller``
    ``AsyncSeq.interleave first empty``
    ``AsyncSeq.bufferByCount``
    ``AsyncSeq.bufferByCount various sizes``
    ``AsyncSeq.bufferByCount empty``
    ``AsyncSeq.bufferByTimeAndCount``
    ``AsyncSeq.bufferByCountAndTime various sizes``
    ``AsyncSeq.bufferByTimeAndCount empty``
    ``try finally works no exception``
    ``try finally works exception``
    ``try with works exception``
    ``try with works no exception``
    ``AsyncSeq.zip``
    ``AsyncSeq.zipWithAsync``
    ``AsyncSeq.zipWithAsyncParallel``
    ``AsyncSeq.append works``
    ``AsyncSeq.skipWhileAsync``
    ``AsyncSeq.takeWhileAsync``
    ``AsyncSeq.take 3 of 5``
    ``AsyncSeq.take 0 of 5``
    ``AsyncSeq.take 5 of 5``
    ``AsyncSeq.skip 3 of 5``
    ``AsyncSeq.skip 0 of 5``
    ``AsyncSeq.skip 5 of 5``
    ``AsyncSeq.skip 1 of 5``
    ``AsyncSeq.threadStateAsync``
    ``AsyncSeq.scanAsync``
    ``AsyncSeq.scan``
    ``AsyncSeq.foldAsync``
    ``AsyncSeq.filterAsync``
    ``AsyncSeq.filter``
    ``AsyncSeq.merge``
    ``AsyncSeq.mergeChoice``
    ``AsyncSeq.merge should be fair``
    ``AsyncSeq.merge should be fair 2``
    ``AsyncSeq.replicate``
    ``AsyncSeq.replicateInfinite``
    ``AsyncSeq.init``
    ``AsyncSeq.initInfinite``
    ``AsyncSeq.collect works``
    ``AsyncSeq.initInfinite scales``
    ``AsyncSeq.initAsync``
    ``AsyncSeq.initInfiniteAsync``
    ``AsyncSeq.traverseOptionAsync``
    ``AsyncSeq.traverseChoiceAsync``
    ``AsyncSeq.toBlockingSeq does not hung forever and rethrows exception``
    ``AsyncSeq.distinctUntilChangedWithAsync``
    ``AsyncSeq.takeUntil should complete immediately with completed signal``
    ``AsyncSeq.takeUntil should take entire sequence with never signal``
    ``AsyncSeq.singleton works``
    ``AsyncSeq.skipUntil should not skip with completed signal``
    ``AsyncSeq.skipUntil should skip everything with never signal``
    ``AsyncSeq.toBlockingSeq should work length 1``
    ``AsyncSeq.toBlockingSeq should work length 0``
    ``AsyncSeq.toBlockingSeq should work length 2 with sleep``
    ``AsyncSeq.toBlockingSeq should work length 1 with fail``
    ``AsyncSeq.toBlockingSeq should work length 0 with fail``
    ``AsyncSeq.toBlockingSeq should be cancellable``
    ``AsyncSeq.while should allow do at end``
    ``AsyncSeq.ofObservableBuffered should work (empty)``
    ``AsyncSeq.ofObservableBuffered should work (singleton)``
    ``AsyncSeq.ofObservableBuffered should work (ten)``
    ``AsyncSeq.ofObservableBuffered should work (empty, fail)``
    ``AsyncSeq.ofObservableBuffered should work (one, fail)``
    ``AsyncSeq.ofObservableBuffered should work (one, take)``
    ``AsyncSeq.getIterator should work``
    ``asyncSeq.For should delay``
    ``Async.mergeAll should work``
    ``Async.mergeAll should perform well``
    ``AsyncSeq.mergeAll should fail with AggregateException if a task fails``
    ``AsyncSeq.merge should fail with AggregateException if a task fails``
    ``AsyncSeq.mergeChoice should fail with AggregateException if a task fails``
    ``AsyncSeq.interleave should fail with Exception if a task fails``
    ``AsyncSeq.unfoldAsync should be iterable in finite resources``
    ``AsyncSeq.take should work``
    ``AsyncSeq.mapParallelAsync should maintain order``
    ``AsyncSeq.mapParallelAsync should be parallel``
    ``AsyncSeqSrc.should work``
    ``AsyncSeqSrc.put should yield when tapped after put``
    ``AsyncSeqSrc.fail should throw``
    ``AsyncSeq.groupBy should work``
    ``AsyncSeq.groupBy should propagate exception and terminate all groups``
    ``AsyncSeq.combineLatest should behave like merge after initial``
    ``AsyncSeq.combineLatest should be never when either argument is never``
  ]

  let (success, failure) = runAll 0 0 tests
  printfn "Success: %d, Failures: %d" success failure
  0

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

Hmm, must be an NUnit thing? Thx for doing this btw!

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

I don't know. The stack trace didn't seem very NUnit-y. It seemed more F#-y. If we're really unlucky, it's F# IL emit bug where NUnit triggers it using some reflection.

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

@dsyme have you seen anything similar before? Also note that NUnit only discovered 109 of the 110 tests.

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

@eulerfx how do you feel about xunit? I might take a stab at porting the entire thing again. I need this for another project. Else I'll just use the source and have my own internal types...

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

Regarding xunit vs nunit, I don't care - whatever works. I've switched between the two a few times before just go get this working in VS. It seems every time I come back to it, they flip between working and not working.

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

I converted to xunit, only to get the exact same error... I'm really starting to think there might be some F# compiler/reflection bogusness here...

from fsharp.control.asyncseq.

Alxandr avatar Alxandr commented on July 19, 2024

Ah. I have all tests passing! All I needed was an entrypoint -.-

That being said, I have all of the tests passing against netstandard2.0 library 🎉
And if we ignore the snafu with testing, it took less than 15 minutes to do. So getting this out for netstandard should be easy to do :)

from fsharp.control.asyncseq.

ovatsus avatar ovatsus commented on July 19, 2024

The 2.0.21 version already has .net core support, right?

from fsharp.control.asyncseq.

eulerfx avatar eulerfx commented on July 19, 2024

@ovatsus that's correct! closing.

from fsharp.control.asyncseq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.