build: document why we check for `std::system` #32491

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:document_std_system changing 1 files +2 −0
  1. fanquake commented at 8:53 AM on May 14, 2025: member

    It's probably debatable if we support targets like iOS, but for now, document why we are checking for this standard library feature.

    Trying to use std::system for a aarch64-darwin-ios target results in:

    test.cpp:7:10: error: 'system' is unavailable: not available on iOS
        7 |     std::system("some_command");
          |          ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdlib.h:203:6: note: 'system' has been explicitly marked unavailable here
      203 | int      system(const char *) __DARWIN_ALIAS_C(system);
          |          ^
    1 error generated.
    
  2. build: document why we check for std::system
    It's probably debatable if we support targets like iOS, but for now,
    document why we are checking for this standard library feature.
    
    Trying to use `std::system` for a `aarch64-darwin-ios` target results in
    ```bash
    test.cpp:7:10: error: 'system' is unavailable: not available on iOS
        7 |     std::system("some_command");
          |          ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdlib.h:203:6: note: 'system' has been explicitly marked unavailable here
      203 | int      system(const char *) __DARWIN_ALIAS_C(system);
          |          ^
    1 error generated.
    ```
    8f4ba90b8f
  3. DrahtBot commented at 8:53 AM on May 14, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32491.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK Sjors

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. DrahtBot added the label Build system on May 14, 2025
  5. Sjors commented at 6:57 AM on May 15, 2025: member

    ACK 8f4ba90b8ff47c7f90fe65d3ed37f486f9fe3a74

    My understanding is that QML based QT will run fine on iOs, though I haven't tried myself.

    Back when this was introduced #15457 (comment) it was observered that there's also more obscure platforms out there that don't have and/or sandbox std::system. Though nowadays we would probably direct them towards the kernel project.

  6. fanquake commented at 9:33 AM on May 15, 2025: member

    it was observered that there's also more obscure platforms out there that don't have and/or sandbox std::system. @laanwj you might remember / know of such systems?

  7. laanwj commented at 10:22 AM on May 15, 2025: member

    @laanwj you might remember / know of such systems?

    Yes. At the time there was cloudabi, which was a sandboxed version of POSIX that removed all contextual access and ambient authority, so processes only get capability handles passed in to what they need. So there was no shell and hence no std::system. But that project was abandoned years ago.

    i'm not sure any other such platforms exist right now, i'm fine with removing the check. But adding a comment makes sense nevertheless.

    Aside: i would like to eventually convert usage of std::system to subprocess, especially now (after #32343) that it doesn't leak file descriptors anymore.

  8. hebasto commented at 10:27 AM on May 15, 2025: member

    Aside: i would like to eventually convert usage of std::system to subprocess, especially now (after #32343) that it doesn't leak file descriptors anymore.

    :+1:

  9. fanquake commented at 10:46 AM on May 16, 2025: member

    i'm not sure any other such platforms exist right now, i'm fine with removing the check. But adding a comment makes sense nevertheless.

    Yea. Wanting to remove the check is what led me to end up documenting it, given it's unclear wether we support these builds or not.

  10. fanquake merged this on May 16, 2025
  11. fanquake closed this on May 16, 2025

  12. fanquake deleted the branch on May 16, 2025
  13. stickies-v referenced this in commit 772a33e052 on May 23, 2025
  14. sedited referenced this in commit cb3cd9b8b9 on May 29, 2025
  15. yuvicc referenced this in commit 069643f094 on Jul 6, 2025
  16. bug-castercv502 referenced this in commit 2858098810 on Sep 28, 2025
  17. Kino1994 referenced this in commit c5161a971e on Jun 28, 2026
  18. BigcoinBGC referenced this in commit 6353f41abd on Jun 30, 2026
  19. bitcoin locked this on Jul 30, 2026

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-08-05 07:51 UTC

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