-
Notifications
You must be signed in to change notification settings - Fork 903
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
(GH-1020) Build with newer Mono #1827
Conversation
Change instances of mono using .Net 4.0 to use .Net 4.5. This is because newer versions of Mono do not have .Net 4.0 anymore.
Excludes Windows only tests from running on Unix, Linux and MacOS. These tests previously tried to run on Linux and failed.
Update Dockerfile and Travis to Mono V5.20.1.19
Remove mono-gmcs as it is obsolete and no longer available with mono 5.
When I run this on openSUSE, I get one error [exec] Errors and Failures:
[exec] 1) Test Error : chocolatey.tests.infrastructure.filesystem.DotNetFileSystemSpecs+when_finding_paths_to_executables_with_dotNetFileSystem_with_empty_path_extensions.GetExecutablePath_should_find_existing_executable
[exec] Should.Core.Exceptions.EqualException : Assert.Equal() Failure
[exec] Position: First difference is at position 1
[exec] Expected: /bin/ls
[exec] Actual: /usr/bin/ls
[exec] at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
[exec] at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <38fbd3d4e2894475b64d58b53bf42d47>:0 I thought it might be caused by a symlink My build is fixed with the following, but it likely needs to accept a list of possible values. diff --git a/src/chocolatey.tests/infrastructure/filesystem/DotNetFileSystemSpecs.cs b/src/chocolatey.tests/infrastructure/filesystem/DotNetFileSystemSpecs.cs
index c4f067d9..03266d52 100644
--- a/src/chocolatey.tests/infrastructure/filesystem/DotNetFileSystemSpecs.cs
+++ b/src/chocolatey.tests/infrastructure/filesystem/DotNetFileSystemSpecs.cs
@@ -216,7 +216,7 @@ namespace chocolatey.tests.infrastructure.filesystem
{
FileSystem.get_executable_path("ls").ShouldEqual(
Platform.get_platform() != PlatformType.Windows
- ? "/bin/ls"
+ ? "/usr/bin/ls"
: "ls");
}
|
It seems that Debian has |
No worries; it is a separate problem, and only a test failure which doesnt effect the software. |
@@ -47,6 +48,7 @@ protected void reset() | |||
} | |||
|
|||
[WindowsOnly] | |||
[Platform(Exclude="Unix,Linux,MacOsX")] |
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.
Formatting here looks a bit off.
And why add this when it already has the attribute of [WindowsOnly]
?
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.
Perhaps the attribute needs adjusted?
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.
The [WindowsOnly]
attribute did not work for preventing the test from running on non-windows systems. I looked at the NUnit docs for the correct way to not run the test on non-windows, and it ended up being what I added, see link below.
https://github.com/nunit/docs/wiki/Platform-Attribute
Linux builds still work just fine without the [WindowsOnly]
attribute, so I could remove it and leave only the [Platform(Exclude="")]
if you think that would be best.
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 went ahead and removed the [WindowsOnly] attribute.
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.
Sorry, what I was looking for was to fix the WindowsOnly attribute to ensure that it does prevent running on non-Windows systems. I don't want NUnit references required in here.
Reference using NUnit.Framework;
at the top of this file.
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.
https://nunit.org/docs/2.6/platform.html This also highlights some things. I wonder if we could do an Include versus an exclude?
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.
Note it is specifically missing MacOSX, but that shouldn't affect Travis.
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 maybe we can flip to do an include on "Win" and see if that works?
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.
public WindowsOnlyAttribute() : base("This is a Windows only test")
I tried adding this, it is still running the tests
If you want a go at it on windows, try changing the exclude to windows and build on windows then see if it skips the test.
So maybe we can flip to do an include on "Win" and see if that works?
Again, still running the tests on Linux.
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.
public WindowsOnlyAttribute() : base("This is a Windows only test")
I tried adding this, it is still running the tests
Yeah, that was for when it was ignore, we switched it to Platform attribute. Apologies.
So maybe we can flip to do an include on "Win" and see if that works?
Again, still running the tests on Linux.
Darn.
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.
Howdy @TheCakeIsNaOH - this is good - have a few minor thoughts and hoping to work through them with you. Any chance you are able to review them?
…ettings See PR-1827 change request.
See PR-1827 change request
Hi, @ferventcoder. I replied/fixed the change requests. Also, would you like me to update the how to install mono documentation in the readme in this PR, or should I open a new one? |
Update the readme on the mono docs |
Requested in PR-1827 comments
@ferventcoder is here anything more needed for this PR to be merged? :) |
Would love for this to be merged so I can build some Linux docker containers from the official repo/current version. There's still a request change but it seems like @TheCakeIsNaOH is waiting for a response from @ferventcoder, hopefully this can be merged soon; thanks Cake for this PR! |
We've been waiting for this fix for a while as well! @ferventcoder : Any updates, or ETA? |
Hey @ferventcoder, have you had a chance to check this PR again? We have a task which depends on this one and it's blocked for a while now. :) |
Any updates here? This is a blocker for my build pipeline. |
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.
Any update on this? It's been quite a while now...? |
@ferventcoder is everything all good now with these changes? Would like to start using most recent updates my Docker containers. Thanks! |
@Cossey Right now the build on Linux is failing because tests are running when they are not supposed to. They were previously bypassed by a preprocessor if block, but mono no longer defines The correct way to run tests on specific platforms is via the |
Still breaks for original reason when cloned on ubuntu 18.04.2 LTS. It appears that even if you clone this modified repository instead of the main one, you don't get the changes.
Mono 4.0 Profile (mono-4.0) is not installed, or not correctly configured.
For more information regarding the cause of the build failure, run the build again in debug mode. Try 'nant -help' for more information |
@whitis You need to switch to the
|
i'd love to see this merged. thank you! |
What's keeping this from being merged? |
Hi @ferventcoder, have you had a chance to check this yet? This has been blocking us for a while now. What is the current state? Are there any changes necessary? Could this be merged? |
Possibly mentioned upthread, but this is keeping at least one Docker image of Chocolatey on the Mono 3 image, which in turn is built on an old version of Debian (which is end-of-lifed IIRC, and lacks current certificates which breaks package pushing) Having an "official" Linux-based Chocolatey container image would be a huge boon for CI pipelines and (mostly) reproducible building and packaging :) Is the platform setup/ |
any progress, please? |
I'm looking at merging this into stable, then bumping to master. Then we can look more closely into why the abstraction is not getting honored (I have a bad feeling something is doing something it shouldn't). |
this PR has been submitted on 15 May 2019 and is still not merged. |
I agree! @ferventcoder : What is the reason for this to take so long to be merged? |
+1 on this, would love to see it merged! |
@ferventcoder : Any updates? |
@ferventcoder , @vexx32, @gep13 ping - is there any update on this PR? It has been here for almost a year and it's really making our tests for choco very painful (actually near impossible) in Jenkins. Would it be possible to have a release with this anytime within the next 6 months? :) |
...or even sooner? :) |
Fantastic news! :) |
That's awesome!! Thanks so much for merging! Are you planning to make a |
WOOHOO! |
@steve-todorov we won't need an actual release of Choco for you to take advantage of this. You can build it now. |
This fixes #1020