random: remove getentropy() fallback for macOS < 10.12 #18364

pull fanquake wants to merge 2 commits into bitcoin:master from fanquake:macos_remove_1012_fallback changing 1 files +5 −8
  1. fanquake commented at 7:44 AM on March 17, 2020: member

    We no longer support macOS < 10.12 (our binaries will not run), so remove the fallback for when getentropy() wasn't available. From the manpage:

    HISTORY
         The getentropy() function appeared in OSX 10.12
    

    Note that compiling on macOS you'll see a new unused function warning:

    random.cpp:256:13: warning: unused function 'GetDevURandom' [-Wunused-function]
    static void GetDevURandom(unsigned char *ent32)
                ^
    1 warning generated.
    

    This will likely be addressed as part of #17563.

  2. rand: remove getentropy() fallback for macOS < 10.12 a889711562
  3. doc: fix GetTimeMicros() comment in random.cpp f9f210d8de
  4. fanquake added the label macOS on Mar 17, 2020
  5. fanquake added the label Utils/log/libs on Mar 17, 2020
  6. vasild commented at 8:13 AM on March 17, 2020: member

    ACK f9f210d8 (code review, not tested)

  7. DrahtBot commented at 10:04 AM on March 17, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #17563 (lib: fix a compiler warning: unused GetDevURandom() by vasild)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  8. elichai commented at 10:05 AM on March 17, 2020: contributor

    Looks good. utACK f9f210d8de43b4559fe7c80bb286aeb60de52b54

  9. practicalswift commented at 12:01 PM on March 17, 2020: contributor

    ACK f9f210d8de43b4559fe7c80bb286aeb60de52b54 -- patch looks correct

  10. MarcoFalke deleted a comment on Mar 17, 2020
  11. hebasto commented at 1:52 PM on March 17, 2020: member

    Concept ACK.

  12. MarcoFalke added the label Needs gitian build on Mar 17, 2020
  13. in src/random.cpp:319 in f9f210d8de
     321 | -            RandFailure();
     322 | -        }
     323 | -    } else {
     324 | -        GetDevURandom(ent32);
     325 | +    /* getentropy() is available on macOS 10.12 and later.
     326 | +     */
    


    hebasto commented at 2:10 PM on March 17, 2020:

    nit: This comment seems redundant, no?

  14. hebasto approved
  15. hebasto commented at 2:21 PM on March 17, 2020: member

    ACK f9f210d8de43b4559fe7c80bb286aeb60de52b54, tested on macOS 10.13.6: compiled

    $ make > /dev/null
    random.cpp:256:13: warning: unused function 'GetDevURandom' [-Wunused-function]
    static void GetDevURandom(unsigned char *ent32)
                ^
    1 warning generated.
    ...
    
  16. laanwj commented at 3:34 PM on March 17, 2020: member

    Nice, by removing a fallback-to-/dev/urandom case this would simplify PRs like #17563.

    ACK f9f210d8de43b4559fe7c80bb286aeb60de52b54

    I'd like to keep the comment for now so that people who see the compilation fail on older MacOS have a refernce point.

  17. laanwj merged this on Mar 17, 2020
  18. laanwj closed this on Mar 17, 2020

  19. fanquake deleted the branch on Mar 18, 2020
  20. DrahtBot commented at 1:28 AM on March 18, 2020: member

    <!--a722867cd34abeea1fadc8d60700f111-->

    Gitian builds

    File commit 7060d2d97a289097f41fcc79698312c0117a75c8<br>(master) commit 3af7cf4ec074c4df0fc869446b28f489425d3726<br>(master and this pull)
    bitcoin-0.19.99-aarch64-linux-gnu-debug.tar.gz 5b9186070107220b... 0214e076643255f3...
    bitcoin-0.19.99-aarch64-linux-gnu.tar.gz 46ebc9a3709ee36e... 8f2e42e567695c86...
    bitcoin-0.19.99-arm-linux-gnueabihf-debug.tar.gz 504c74bd26f07540... 7883b7b4999248f4...
    bitcoin-0.19.99-arm-linux-gnueabihf.tar.gz 3919216a5bf8f3dd... d99d64a720b6db00...
    bitcoin-0.19.99-osx-unsigned.dmg d1f66a95f5f5f232... d1f7d0b6d49a049f...
    bitcoin-0.19.99-osx64.tar.gz b50eccfb91530cd2... 184a6f2a1272a990...
    bitcoin-0.19.99-riscv64-linux-gnu-debug.tar.gz 058eab28b1ecb654... 3e34a693ed085c01...
    bitcoin-0.19.99-riscv64-linux-gnu.tar.gz a2f43a20ba1daa43... 58d777dd70dc9188...
    bitcoin-0.19.99-win64-debug.zip fcd929b8db071268... 10d221df4f70907a...
    bitcoin-0.19.99-win64-setup-unsigned.exe a2f82605ec48ba21... 9d64067d6f487c42...
    bitcoin-0.19.99-win64.zip 4d1973ac4aceb162... d1ba2d22fe3e8768...
    bitcoin-0.19.99-x86_64-linux-gnu-debug.tar.gz ab203e4d096d364a... 2b38ec4f4d775fdc...
    bitcoin-0.19.99-x86_64-linux-gnu.tar.gz c750572356e2cbf2... a49669f8fe9ee29f...
    bitcoin-0.19.99.tar.gz d3ffdc3066c90f20... 21463cf3b9e690c0...
    bitcoin-core-linux-0.20-res.yml 45c1139e40fb65f0... ec63f9928bc5264d...
    bitcoin-core-osx-0.20-res.yml d4c974cdabd43648... 89087f266038ea3a...
    bitcoin-core-win-0.20-res.yml bc0b5685df3e3a0a... 4eb6db229e92f8fc...
    linux-build.log cbc5a54bd3bcd79f... 63f08114d520997d...
    osx-build.log 7a752a3d6ad2cae8... dec7b18deb430209...
    win-build.log 4d6918ca84bcc227... 69141565232dba2e...
    bitcoin-core-linux-0.20-res.yml.diff 1e537f3bb1e0d1e9...
    bitcoin-core-osx-0.20-res.yml.diff dd2bdf04ef45858e...
    bitcoin-core-win-0.20-res.yml.diff 4006e5ac8e1823bf...
    linux-build.log.diff bc56650ac4fd157f...
    osx-build.log.diff 6f530251cf67eb36...
    win-build.log.diff 332acbc4b54b73d6...
  21. DrahtBot removed the label Needs gitian build on Mar 18, 2020
  22. sidhujag referenced this in commit db7e54243a on Mar 18, 2020
  23. Sjors commented at 7:28 PM on March 24, 2020: member

    I can confirm I see this warning :-)

    random.cpp:256:13: warning: unused function 'GetDevURandom'
    
  24. sidhujag referenced this in commit 7f195d3241 on Nov 10, 2020
  25. Fabcien referenced this in commit f556e32bbc on Jan 8, 2021
  26. kittywhiskers referenced this in commit 21eff56884 on Jul 15, 2021
  27. kittywhiskers referenced this in commit 5ff2288078 on Jul 15, 2021
  28. kittywhiskers referenced this in commit ac4a9f8f9a on Jul 20, 2021
  29. kittywhiskers referenced this in commit 9c071d7320 on Jul 20, 2021
  30. kittywhiskers referenced this in commit 5c738de9a7 on Jul 20, 2021
  31. kittywhiskers referenced this in commit 1521d93efe on Jul 20, 2021
  32. kittywhiskers referenced this in commit 9413f75bfa on Aug 1, 2021
  33. kittywhiskers referenced this in commit 3bdd05003c on Aug 24, 2021
  34. kittywhiskers referenced this in commit 5954218d94 on Aug 24, 2021
  35. kittywhiskers referenced this in commit d358ac2ddc on Aug 25, 2021
  36. kittywhiskers referenced this in commit d2b469a83b on Aug 25, 2021
  37. kittywhiskers referenced this in commit 7e047f6152 on Aug 26, 2021
  38. kittywhiskers referenced this in commit 92e57d51a9 on Aug 26, 2021
  39. kittywhiskers referenced this in commit 22e78a2408 on Aug 26, 2021
  40. kittywhiskers referenced this in commit 58c069a6bf on Aug 27, 2021
  41. kittywhiskers referenced this in commit 575e48f674 on Aug 30, 2021
  42. kittywhiskers referenced this in commit ea1ab3d84c on Sep 1, 2021
  43. kittywhiskers referenced this in commit 32579b60b3 on Sep 1, 2021
  44. kittywhiskers referenced this in commit 0d82bd992b on Sep 1, 2021
  45. kittywhiskers referenced this in commit 64667b7a5c on Sep 1, 2021
  46. kittywhiskers referenced this in commit 7abb5cf564 on Sep 2, 2021
  47. kittywhiskers referenced this in commit 35e34a57b6 on Sep 3, 2021
  48. kittywhiskers referenced this in commit 50f34e0ed4 on Sep 3, 2021
  49. kittywhiskers referenced this in commit 7f2e7d7ba7 on Sep 3, 2021
  50. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me