-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enable building on linux without project file changes #1930
Conversation
This enables building via cake on linux without requiring adjustments on other platforms, fixes #1745
Hey @Vogel612, this is cool for building locally on a mac/Linux but the only thing is that on travisCI Mac and Linux builds we actually DO build the full framework as the build agent is setup with mono So maybe rather than hardcoding noframework=true in build.sh this should be passed in so we can set false in travis? Also I think the tool install step of the build might still be a problem on Mac/Linux if you don't have mono as it uses nuget (from mono) to pull down gitversion doesn't it ? |
Yes, the tool install step requires nuget. GitVersion is then executed through mono (cf. tools/gitversion_wrapper.sh).
I'm happy to remove the hardcoding there. Currently I'm building locally by sidestepping the GitVersion invocation and returning a hardcoded JSON because neither mono nor dotnet invoke the downloaded binary without error. (mono segfaults and dotnet is missing a library). IIUC the tools are required for determining the version (which could possibly be implemented differently in the build project's |
Sidenote: I'm currently running into issues trying to replace LibGit2Sharp is looking at replacing that native binding, but unfortunately that has not happened yet. As such I am unable to replace the GitVersion related code right now. |
I'm thinking if we had "nofullframework" mode for local use only, it could skip running gitversion as well as not build the net45 targets you've already implemented |
This implies that NoFramework is intended for local use only Accordingly a warning message has been set up in the Lifetime of the Build
@ryangribble were you thinking something along these lines? Happy to make some more adjustments 👍 |
Yep that's what i was thinking - love the warning you added by the way 👍 A couple of other thoughts (apologies im on mobile at the moment so I dont have links to affected source code lines etc)
|
Done
The code formatter only runs on windows in the first place, but since we're not downloading the tools for CoreOnly builds, I added an explicit check to the
travis invokes the buildscript. Changing the buildscript's default would involve creating an explicit switch to turn off the default. My bash is somewhere between bad and gruesome, so I don't want to mess around there
Agreed and done |
I year ya 🤣 how about this though - the cake script could default CoreOnly to be true for Windows and false otherwise. Travis can pass in false which should override the default value. The bash script should already pass through any parameter provided to it (you should see some already being passed in the travis yml) |
The linksources parameter is a good example to follow. Travis passes it in, nothing special for it in the build.sh (it passes all parameters through to cake) and the cake build uses the value provided or uses a default if none specified (here https://github.com/octokit/octokit.net/blob/master/build/Lifetime.cs#L14) We can follow similar approach except default for CoreOnly will be conditional on windows or not My aim here is for a contributor locally on Linux or OSX just runs build.sh and everything just works (without losing anything on the Windows or travis/appveyor side) |
@ryangribble could you kick travis for me? It seems there has been a timeout in the LinkSources check |
There's a section in the build that explicitly logs the value of the parameters, could we add the CoreOnly one to that? This is looking good! I'll do a test on my MacBook today 😁 |
Great stuff! Tested on my macbook tonight, works perfectly 👍 Is this ready for merging, from your perspective @Vogel612 |
Anytime :) |
@ryangribble poke: what's the latest on this? |
Ah sorry @Vogel612 I've been on holidays this week, I'll try to get to it today 😬 |
@ryangribble poke: Do tell me when I start to seriously annoy you with this, otherwise I'll keep more or less regularly poking you here 😉 |
It's all good... I'm doing some serious juggling at the moment so poking is fine/necessary 😀 So I was just doing some final testing and found an issue where on Windows in both VS2017 and If I were to propose the ideal result of this PR, it would be: ✅ Cake builds on CI (appveyor and travis, all OS'es), build both platforms So far we have 4 out of 5. Maybe we need to actually set a default value for |
rough quick-patch: Add Alternatively |
yeah, sounds like the |
'native' msbuild invocations do not automatically set CoreOnly according to the platform they are running on. As such we set CoreOnly to False on Windows, unless CoreOnly has been specified already.
Tested on windows and mac, plus reviewed the travis and appveyor builds and everything is looking great! 5 out of 5! woohoo! Thanks for working on this @Vogel612 |
release_notes: Adjust Cake and native build configurations to allow building on OSX/Linux out of the box |
This enables building via cake on linux without requiring adjustments on
other platforms, fixes #1745