-
Notifications
You must be signed in to change notification settings - Fork 905
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
Build fails on newer Mono versions #1020
Comments
Thanks for adding this. |
Confirmed that the build fails for all Mono versions 4.0 and above, which is when they switched to .NET Framework 4.5 and removed the legacy assemblies. Even though I think I updated |
I think you missed the startup section, allowing Nant to run under newer assemblies <startup>
+ <!-- .NET Framework 4.5.2 -->
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
+ <!-- .NET Framework 4.5 -->
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> |
@ferventcoder That already exists in master: https://github.com/chocolatey/choco/blob/master/lib/NAnt/NAnt.exe.config#L3263-L3266 |
Looks like I upgraded that bit then. Thanks, had not realized it! Hmmm. Other things to consider then. |
Just stumbled onto this issue -- I see it's marked low priority but would love if it could be up'd in priority. My team would like to develop locally, push to a version controlled system and then have a post commit hook update the packages on the actual repository; the problem is that the server is linux so it needs to be able to build the packages from there. |
+1 for this :-) |
+1 for this. My use case is that I want to enable an open source project, bazel, to publish the chocolatey package for their release via their existing release process, which runs on Linux and does not involve Windows. |
See PR-1827 change request
This changes the docker container to use code_drop folder instead of the build_output folder. The zip.sh script uses the code_drop rather then build_output, and the docker container should follow what format the zip has. The wrapper script also changes due to choco.exe being one more folder down.
This environment variable is needed to for docker choco to not output a warning that it cannot find the chocolatey lib directory.
…n linux The [WindowsOnly] was not working, so the platform exclude was added. This removes the windows only altogether.
Add Mono framework for .NET 4.5 as newer versions of Mono do not have .NET 4.0 anymore.
Update Dockerfile and Travis to Mono v5.20.1. Remove mono-gmcs from what is installed for Travis. Remove mono-gmcs as it is obsolete and no longer available with Mono 5.
Change the docker container to use `code_drop` folder instead of the `build_output` folder. The zip.sh script uses the `code_drop` rather than `build_output`, so the docker container should follow the same format the zip does. Account for the path change for choco.exe in the wrapper script.
The ChocolateyInstall environment variable is needed to for docker choco to not output a warning that it cannot find the Chocolatey lib directory and use a different path for packages depending on where the command is run from. Add the environment variable to make it available in the right location.
Previously, Windows only tests were ignored based on a build compilation symbol `__MonoCS__`. This allowed skipping (ignoring) those tests easily. However newer versions of Mono simply don't use that symbol anymore and the testing aspect does not ignore those tests, ultimately causing them to fail when run in a non-Windows environment. Switch over to using platform that only includes Windows. This will exclude Windows only tests from running on Unix, Linux and MacOS.
Unfortunately, it appears like platform exclusions go by the actual name of "Platform" and attempting to inherit the attribute is ignored by NUnit when selecting platforms to exclude for testing. Add those directly for now until a better alternative is available.
* pr1827: (GH-1020) Direct platform only for windows tests (GH-1020) WindowsOnly tests by platform, not ignore (GH-1020) Docker add ChocolateyInstall Env Var (GH-1020) Docker use code_drop instead of build_output (doc) Update mono installation instructions in README (GH-1020) Dockerfile and Travis to Mono 5.20.1 (GH-1020) Add mono-4.5 configuration
* stable: (GH-1020) Direct platform only for windows tests (GH-1020) WindowsOnly tests by platform, not ignore (GH-1020) Docker add ChocolateyInstall Env Var (GH-1020) Docker use code_drop instead of build_output (doc) Update mono installation instructions in README (GH-1020) Dockerfile and Travis to Mono 5.20.1 (GH-1020) Add mono-4.5 configuration
This has just been merged to stable and master. See commits and merges in notes above this comment. Thanks for the patience in getting this over the line |
Missed part of the commit in 22fe302. Ensure those brackets are there so the build is not failing.
Does Chocolately work on .NET Core, or does it require Mono? |
* upstream/master: (21 commits) (doc) Changed cla links from clahub to cla-assistant (chocolateyGH-2055) remove logs/config folder in nupkg (version) 0.10.16-beta (chocolateyGH-2023) Install git in the docker container (chocolateyGH-1859) Fix error message for missing 32-bit URL (chocolateyGH-1859) Fix error message for missing 32-bit URL (chocolateyGH-2051) Fix: workingDirectory always replaced w/cacheLocation (chocolateyGH-1983) exit-on-reboot-detected environment variable (maint) update resharper settings (maint) formatting (chocolateyGH-1843) Fix: search exact all versions returns 1 (chocolateyGH-1020) fix build (chocolateyGH-1020) Direct platform only for windows tests (chocolateyGH-1020) WindowsOnly tests by platform, not ignore (chocolateyGH-1020) Docker add ChocolateyInstall Env Var (chocolateyGH-1020) Docker use code_drop instead of build_output (doc) Update mono installation instructions in README (chocolateyGH-1020) Dockerfile and Travis to Mono 5.20.1 (chocolateyGH-1020) Add mono-4.5 configuration Add missing start of comment block ...
@Daniel15 at the minute, Chocolatey requires mono to run on, it doesn't target .NET Core. |
Chocolately successfully builds on a pretty old version of Mono (as can be seen in the Travis build), but it fails on newer 4.x versions of Mono. I tried fixing this myself but ran into an issue.
The first issue was that Mono no longer has its libraries in
/usr/lib/mono/4.0
, they all moved to4.5
when Mono added support for .NET Framework 4.5 as a drop-in replacement for 4.0 (runtime version is still4.0.30319
but the assemblies are in/usr/lib/mono/4.5
). I fixed that with the following patch:However, now I'm hitting this error, and I can't figure out how to proceed:
I could get past "The type or namespace name
Task
could not be found." error by explicitly referencing the right namespace (NAnt.Core.Task
rather than justTask
), but that just resulted in even more errors:I can't work out why this is happening, as all the correct
using
statements are at the top of the generated file 😕The text was updated successfully, but these errors were encountered: