Skip to content
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

rustc: disable fragile tests on darwin #21741

Closed
wants to merge 1 commit into from

Conversation

acowley
Copy link
Contributor

@acowley acowley commented Jan 7, 2017

rustc-1.14.0 builds are failing on hydra due to test failures of tcp
functionality that do not look like significant failures. This patch
causes these functions to be ignored on darwin.

Motivation for this change
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

rustc-1.14.0 builds are failing on hydra due to test failures of tcp
functionality that do not look like significant failures. This patch
causes these functions to be ignored on macos.
@mention-bot
Copy link

@acowley, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vcunat, @the-kenny and @LnL7 to be potential reviewers.

@LnL7 LnL7 added 6.topic: darwin Running or building packages on Darwin 6.topic: rust labels Jan 7, 2017
@LnL7
Copy link
Member

LnL7 commented Jan 7, 2017

I have also seen this issue with a hydra jobset and building it locally worked fine, I assume this is an unstable test.

optionalString stdenv.isDarwin ''
substituteInPlace mk/rt.mk --replace "_osx" "_10.4"
sed -z -e 's/#\[test\]\n[[:space:]]*fn timeouts()/#[cfg_attr(target_os = "macos", ignore)]\n #[test]\n fn timeouts()/' \
Copy link
Contributor

@the-kenny the-kenny Jan 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this sed-approach is too fragile. Can you please generate a .patchfile we can apply via patches?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do this by cloning rustc, making the relevant changes, then committing and running git format-patch @^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree that it's too fragile. It is robust to substantial changes to the file. The only way it stops helping is if the developers' convention for defining tests changes.

Copy link
Contributor

@the-kenny the-kenny Jan 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that it will silently break as soon as the sed doesn't match anymore. At least with a .patch we will get a build error instead of sporadic failures because it doesn't apply cleanly anymore. Also note that there are already other tests we disable via this mechanism.

If you really don't want to create a patchfile, please use substituteInPlace instead of sed as it's more readable (as suggested in https://nixos.org/nixpkgs/manual/#ssec-stdenv-functions) and more commonly used in nixpkgs.

Also, there's no need to use the cfg_attr(target_os)="macos" as sed is only called for darwin anyway. Just disabling the test completely instead of conditionally should simplify the line even more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So contrary to the original comment, you're suggesting we use a more fragile approach because it will fail noisily. That's certainly an advantage, at the expense of regular maintenance for a minor transient failure.

The comment about substituteInPlace being more common in nixpkgs is demonstrably false.

@acowley
Copy link
Contributor Author

acowley commented Jan 7, 2017

I'll leave this for others to resolve. I don't particularly mind how it is done. Any color bike shed will do.

@acowley acowley closed this Jan 7, 2017
@the-kenny
Copy link
Contributor

I've got a patch for this ready for push, just waiting for #21742 to land

@acowley
Copy link
Contributor Author

acowley commented Jan 8, 2017

That's good, but it's a shame that such an important package stays broken on darwin as often as it is. The false premises given for rejecting this patch and delaying any fix are pretty disappointing. That the preferred fix is either more fragile or less commonly used in nixpkgs, or both, is concerning for future maintenance. Here's hoping for smoother updates in the future!

@the-kenny
Copy link
Contributor

I just pushed a fix in 7435fef.

@the-kenny
Copy link
Contributor

Please keep in mind that most people are working on nixpkgs in their free time (I am) and that most people don't get paid for doing so (I'm not). The maintainers provided feedback to your pull request in under two hours, and a (hopefully) complete fix was pushed to master in under 24 hours. I hardly find that slow or un-responsive.

As for the critique for the preferred method of patching the issue: Feel free to open a discussion. I can hardly stand the sed-syntax, especially when it goes over multiple lines. Please consider this as well as the "silent failure" behavior of sed if something, for example the function name, changes.

Personally I find the second issue the most problematic with the approach: Imagine the function names change. This will lead to sed failing to patch out the tests, which then will cause problems on hydra again. Some maintainer investigating this will take a look, see that this issue is supposed to be patched because of the sed line, but will never know that the line is actually a no-op. He'll have to manually run the sed call and compare the outputs to see that.

The patch-approach will cause a build error as soon as the names change, saying exactly which patch doesn't apply where anymore, making it easy to spot the issue.

@acowley
Copy link
Contributor Author

acowley commented Jan 8, 2017

Your first paragraph goes the other direction, too. To be clear, I think your feedback had definitely valid elements and your experience with Nix means that it's worth paying attention to. What I objected to is the attempt to justify opinion with falsehoods. The point about the fragility of patch files, for instance, is useful. I think that for something that doesn't impact correctness, I'd rather have a robust fix whose unlikely failure either results in a build failure or a useless-but-hamless build step (ie the regex no longer matches, but upstream changes fixed the problem).

Likewise, "Is this a place where substituteInPlace makes sense?" is a good question. That helper is good for variable substitution, but for slightly more complex matching it is not. Saying that using the inappropriate choice is justified because it is used more often than sed is just dishonest. I appreciate the distaste for sed syntax, and am definitely sympathetic to that argument! I'm sorry this exchange was so fractious, it took hours before the PR spent on irc getting it sorted. I am glad to hear that a patch is happening.

@the-kenny
Copy link
Contributor

It has been brought to my attention that you're a big contributor in the darwin side of things - sorry, I should've looked at your history of contributions before making the statements in my first paragraph. Please consider them to be withdrawn. I might have overreacted a bit on your earlier comment - sory for that.

I actually haven't seen the benefits of your approach - your points for robustness and useless-harmless-ness are good. I'll try to better see both sides in the future.

Shall we settle this and move on to opening/merging more PRs and fixing bugs? After all we both want to make nixpkgs a better place.

@the-kenny the-kenny reopened this Jan 8, 2017
@the-kenny the-kenny closed this Jan 8, 2017
@acowley acowley deleted the rustc-1.14-darwin branch October 31, 2017 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 6.topic: rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants