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

Fix R #80759

Merged
merged 2 commits into from Feb 23, 2020
Merged

Fix R #80759

merged 2 commits into from Feb 23, 2020

Conversation

Thra11
Copy link
Member

@Thra11 Thra11 commented Feb 21, 2020

Motivation for this change

R was broken on aarch64 because

  • It now seems to expect java to exist
  • A recently added regression test fails on aarch64.

ZHF: #80379

Things done
  • Removed the conditional exclusion of jdk as a dependency on aarch64 (and aarch32), as aarch64 now has openjdk.
  • Patched the sources to remove a test which fails on aarch64 (Reported upstream. Believe test to be incorrect).
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Thra11 Thra11 requested a review from peti as a code owner February 21, 2020 23:50
@Thra11
Copy link
Member Author

Thra11 commented Feb 21, 2020

If preferred, we could only apply the patch on platforms where the test fails.

I believe this test is currently incorrect on aarch64 and expects a
warning about loss of precision with much smaller numbers than the
platform's long doubles can handle.
@KamilaBorowska
Copy link
Member

KamilaBorowska commented Feb 22, 2020

I don't know R, but I think it's a bug that on aarch64 that there are no warnings. Asking for 2^64 %% 3 is nonsensical as at this point it's not possible to represent integers with double floating point numbers (you can only do that up to 2^53 - 1).

The results are "correct" if you check them with an infinite precision integers, but this is misleading as at this point you cannot know whether the value was actually supposed to be 2^64 or say, 2^64+1 - both are identical for double floating points.

@Thra11
Copy link
Member Author

Thra11 commented Feb 22, 2020

The calculation is done with long double on aarch64

@Thra11
Copy link
Member Author

Thra11 commented Feb 22, 2020

Although that's probably not relevant, since the value has already lost precision before the mod is calculated, so there should be a warning.

I do still think that it makes sense to suppress the test until it's fixed upstream. It's arguably no worse than the version before the test was added.

Copy link
Member

@timokau timokau left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this, especially for taking it upstream!

pkgs/applications/science/math/R/default.nix Show resolved Hide resolved
@timokau timokau merged commit f4dbf44 into NixOS:master Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants