-
Notifications
You must be signed in to change notification settings - Fork 525
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
[Ready] Make paket build on a clean windows #2664
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there another way than to add all those binaries to the repository?
what binaries do you mean? ;D |
paket.dependencies
Outdated
@@ -44,3 +44,9 @@ group Build | |||
nuget ILRepack | |||
|
|||
github fsharp/FAKE modules/Octokit/Octokit.fsx | |||
|
|||
nuget 0x53A.ReferenceAssemblies.net45 0.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is for net45 support, correct? because in the future this is no longer required as soon as we are fine with net461 compat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, these are the reference assemblies. When we move to net461 we need to update to the correct reference assemblies for that.
The reference assemblies are the "contract assemblies" that the compiler compiles against. They are metadata only.
I used https://github.com/jaredpar/xcopy-msbuild, this basically just zipped up the content of C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But once we are on net461 all we need is the netstandard build, so we could drop that in theory?
I don't think this is the correct thing to do long term (though I haven't really decided yet).
I thought we will have all the reference assemblies as "official" nuget packages now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found any reference assemblies as nuget packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise I'm pretty sure the roslyn build would use these, instead of packaging this stuff up themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate/link the RoslynTools.ReferenceAssemblies you are referring to above (I cannot find it)?
source https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json
And also why it doesn't work for us (just trying to figure out if we can make it work or if it is viable for other scenarios)?
It does not contain the ref-assemblies for 4.5:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe should just upgrade to net46? I'm not sure about the portable stuff could be a subset..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I did a test, and I am pretty sure we need .NETFramework\v4.5 to compile against net45 AND .NETPortable\v4.5 to consume portable assemblies, for example FsCheck.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created a package that contains only these two. Reason: it is smaller.
The tool The issue is that Fake only allows the installation of a single runtime, I tried installing two after each other but the second deleted the first. |
Hi @enricosada, do you think it would be possible to update dotnet-mergenupkg and provide a netcoreapp2.0 binary? Otherwise usage in the Sdk 2.x is a bit clumsy, because I still need to install the 1.0.x runtime in parallel somehow. I've hacked together a netcoreapp2 version, so I can continue testing this: enricosada/dotnet-mergenupkg@master...0x53A:master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way better :). I like the direction of this - It probably will make contributing easier.
paket.dependencies
Outdated
@@ -44,3 +44,10 @@ group Build | |||
nuget ILRepack | |||
|
|||
github fsharp/FAKE modules/Octokit/Octokit.fsx | |||
|
|||
nuget 0x53A.ReferenceAssemblies.Paket 0.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So every project now bundles their own reference assemblies :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or put differently, if you think this is a good way forward (which I think it is). We might want to have another documented project on how this stuff works (Then others can use it and read about it). Anyway that's just a suggestion (I'd like to maybe add that to FAKE as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I would prefer to use an official package, also.
The one advantage this has is that it only bundles the directories it actually needs, so the size is a bit smaller. I could have given it a specific name like "ReferenceAssemblies.Net45", but this way it is clear that it is used by paket and will change as soon as we update.
Building the package is dead easy, clone https://github.com/jaredpar/xcopy-msbuild, modify which frameworks to include https://github.com/jaredpar/xcopy-msbuild/blob/006e1bb65d031854f38eaac251b5f799ce281e37/build-reference-assemblies.ps1#L23-L30
and run the powershell script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add that as comment then?
build.cmd
Outdated
@@ -5,4 +5,7 @@ if errorlevel 1 ( | |||
exit /b %errorlevel% | |||
) | |||
|
|||
set MSBUILD=packages\build\RoslynTools.MSBuild\tools\msbuild |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could set that in the FAKE script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, that may also fix unix, which currently fails (because it still runs the bundled msbuild).
How would you set it inside Fake? Just set the env vars? or is there some config switch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I think in FAKE 4 the way would be to change the mutable field with the path.
But yeah I don't know how a good FAKE API for this would look like...
Well, i guess I need to set up a linux vm to fix this :\ |
Oh yeah ;) |
well, one issue was that ubuntu 17.x still references some ancient 4.x mono ... |
does paket not use caching on unix? Maybe I'm wrong ,but it seems to download everything every time |
wait - paket now finished successfully??????? I only had to start the build script 20 times! |
Mono? It's short for "Mondays..."
Am 26.08.2017 6:12 nachm. schrieb "Matthias Dittrich" <
[email protected]>:
… Oh yeah ;)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2664 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNF7tVkZB690l4jhPKSqCxaYsd36tks5scEP-gaJpZM4PDIgM>
.
|
Well, if we don't find a global cache we fallback to some local directory. Maybe that is what you are seeing? |
Idk, I was probably confused. Each time I started it, it downloaded some, then failed. But each time it probably got a little bit further... You may want to mute this thread, i will probably rage a bit until I either have this fixed, or given up ;) |
Some of the integration tests also run -f
Am 26.08.2017 6:21 nachm. schrieb "Lukas Rieger" <[email protected]>:
… Idk, I was probably confused. Each time I started it, it downloaded some,
then failed. But each time it probably got a little bit further...
You may want to mute this thread, i will probably rage a bit until I
either have this fixed, or given up ;)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2664 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNMcoe6ZZ52njOZ6airOfqufNwo38ks5scEYIgaJpZM4PDIgM>
.
|
Ready from my side, as soon as AppVeyor and at least one travis leg are green |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to see a bit less "WIP"-Dependencies but overall that's a good step forward.
paket.dependencies
Outdated
@@ -44,3 +44,10 @@ group Build | |||
nuget ILRepack | |||
|
|||
github fsharp/FAKE modules/Octokit/Octokit.fsx | |||
|
|||
nuget 0x53A.ReferenceAssemblies.Paket 0.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add that as comment then?
@@ -1,9 +1,12 @@ | |||
<Project> | |||
<!-- MSBuild only includes the first Directory.Build.props, so we need to manually include the root one --> | |||
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.props" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe /
like above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msbuild does a normalization, the relevant change was the casing. I think I will go back to backslash for everything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add that as comment then?
I had a comment in the actual commit, but yes, will add a source comment
The version numbers are arbitrary. If it makes you feel better I can push a 1.0 right now ;D If you want, we can also change to a "non-branded" package that is owned by you guys or the fsfoundation. "0x53A.ReferenceAssemblies.Paket" was just so that I could get started. Similar, I forked |
Note that it's not a blocker for me :). I trust you to cleanup eventually. That's why approved the changes ;) |
There wasn't any real need for this PR, I mostly wanted to test this out so I can also move my work solution to this model. So it is up to you whether we pull it now and clean up later, or wait a bit. |
Welcome to netcore ecosystem ;-) |
build.fsx
Outdated
@@ -364,7 +364,7 @@ Target "MergeDotnetCoreIntoNuget" (fun _ -> | |||
|
|||
let runTool = runCmdIn "tools" dotnetExePath | |||
|
|||
runTool """mergenupkg --source "%s" --other "%s" --framework netstandard1.6 """ nupkg netcoreNupkg | |||
runTool """0x53A-mergenupkg --source "%s" --other "%s" --framework netstandard1.6 """ nupkg netcoreNupkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this fixes #2645. This is bad. We didn't even realize that we still depend on SDK1.0 to be installed. Thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are welcome ;)
* acquire msbuild via RoslynTools.MSBuild * acquire reference assemblies via a self-built package based on https://github.com/jaredpar/xcopy-msbuild * use a fork of dotnet-mergenupkg which was recompiled against netcoreapp2.0 (original was netcoreapp1.0) to remove dependency on 1.x runtime
Note: I would like to add an actual CI leg for this, but afaik AppVeyor does not provide "clean" windows machines, so I don't know of a way to test this. |
Maybe with travis a minimalistic netcore only build? |
On linux, I still rely on the system-installed msbuild because the one from RoslynTools.MSBuild crashes hard |
"dotnet msbuild" could work. I mean there is a bit of work to do to make this happen but it's not too unrealistic as paket/fake are basically ported. I think the only thing I know is that the netcore version of paket cannot push for some reason |
Officially, the dotnet cli does NOT support building old-sdk projects. I would wait until we have ported paket completely to new-sdk. |
then we need to update sooner or later anyway, because I really want to get rid of mono. We can still have tests and stuff working with mono but the core stuff will probably move soon :) |
yes, it would be great to move paket itself to netcoreapp, maybe even standalone so the dotnet runtime does not need to be installed. Do you know what the status of the linker is? Single-file standalone would be awesome. |
I would be so happy already if stuff would be working, so I didn't think about a linker yet ;) But yeah it would be awesome. |
@0x53A released dotnet-mergenupkg v2.0.0 This support both sdk 1.0 and 2.0 as cli tool |
AWESOME!!!! |
Windows
(Note: IntegrationTests were skipped in this screenshot (because they take so much time), but they were also green!
Linux
We still rely on a global mono and a global MSBuild, because the bundled version is not compatible with linux and crashes hard on startup.
Notes:
ReferenceAssemblies are currently checked-in. I need to either find a nuget package, or create one myself. (I had planned to use 'RoslynTools.ReferenceAssemblies', but that doesn't contain the ones for 4.5)I created a nuget package using https://github.com/jaredpar/xcopy-msbuild. This contains only the two directories it needs (NETFramework\v4.5 to compile against net45 AND .NETPortable\v4.5 to consume portable assemblies, for example FsCheck)MSBuild doesn't seem to support Directory.build.props in combination with old-sdk projects? I had wanted to use that to setOnly the first Directory.Build.props is used, and there was already one in /src/. Also, Directory.build.targets does not yet work: Directory.build.targets not imported when cross-targeting dotnet/msbuild#1721FrameworkPathOverride
, but it didn't work until I manually modified all fsprojsthere is something funky with referencing portable stuff, I had to disable the FsCheck tests, or I would get the following errors:fixed after adding ref-assembly directory.NETPortable\v4.5