Skip to content

Conversation

@kp-thomas-yau
Copy link
Contributor

@kp-thomas-yau kp-thomas-yau commented Mar 27, 2025

Description

This PR fixes building/compilation issue when we are building it in tvOS.

We are manually setting these crates to use a specific commits/PRs as we are waiting for a new official release from them:

  1. fs-mistrust:
    Gitlab can only make reference to commits on the main branch only, so we are using the commit hash for the merge request on main
    https://gitlab.torproject.org/tpo/core/arti/-/commit/0f13b7a0e19b3fae163e76c8ade6499244abf834
  2. ctrlc
    Add support for tvOS, visionOS and watchOS Detegr/rust-ctrlc#128 to support building or compiling on tvOS.

Bumped wolfssl and tun to a new version that supports building on tvOS as well.

Motivation and Context

Support tvOS

How Has This Been Tested?

By building the internal client on all 3 tvOS platforms

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • The correct base branch is being used, if not main

@github-actions
Copy link

github-actions bot commented Mar 27, 2025

Code coverage summary for 96ba542:

Filename                                                     Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lightway-app-utils/src/args/cipher.rs                              4                 4     0.00%           1                 1     0.00%           5                 5     0.00%           0                 0         -
lightway-app-utils/src/args/connection_type.rs                     4                 4     0.00%           1                 1     0.00%           5                 5     0.00%           0                 0         -
lightway-app-utils/src/args/duration.rs                            7                 7     0.00%           5                 5     0.00%          13                13     0.00%           0                 0         -
lightway-app-utils/src/args/ip_map.rs                             11                11     0.00%           3                 3     0.00%          15                15     0.00%           0                 0         -
lightway-app-utils/src/args/logging.rs                            14                14     0.00%           2                 2     0.00%          16                16     0.00%           0                 0         -
lightway-app-utils/src/connection_ticker.rs                       71                11    84.51%          28                 4    85.71%         279                11    96.06%           0                 0         -
lightway-app-utils/src/dplpmtud_timer.rs                          63                 7    88.89%          22                 4    81.82%         282                11    96.10%           0                 0         -
lightway-app-utils/src/event_stream.rs                             5                 0   100.00%           3                 0   100.00%          13                 0   100.00%           0                 0         -
lightway-app-utils/src/iouring.rs                                157               142     9.55%          23                17    26.09%         304               281     7.57%           0                 0         -
lightway-app-utils/src/metrics.rs                                  2                 2     0.00%           2                 2     0.00%           4                 4     0.00%           0                 0         -
lightway-app-utils/src/sockopt/ip_mtu_discover.rs                 23                23     0.00%           4                 4     0.00%          93                93     0.00%           0                 0         -
lightway-app-utils/src/sockopt/ip_pktinfo.rs                       4                 4     0.00%           1                 1     0.00%          16                16     0.00%           0                 0         -
lightway-app-utils/src/tun.rs                                     76                76     0.00%          22                22     0.00%          94                94     0.00%           0                 0         -
lightway-app-utils/src/utils.rs                                   13                13     0.00%           1                 1     0.00%          11                11     0.00%           0                 0         -
lightway-client/src/args.rs                                       35                35     0.00%          31                31     0.00%          38                38     0.00%           0                 0         -
lightway-client/src/io/inside/tun.rs                              39                39     0.00%           7                 7     0.00%          48                48     0.00%           0                 0         -
lightway-client/src/io/outside/tcp.rs                             48                48     0.00%          10                10     0.00%          45                45     0.00%           0                 0         -
lightway-client/src/io/outside/udp.rs                             62                62     0.00%          12                12     0.00%          62                62     0.00%           0                 0         -
lightway-client/src/keepalive.rs                                 245                33    86.53%          56                 8    85.71%         372                26    93.01%           0                 0         -
lightway-client/src/lib.rs                                       257               257     0.00%          27                27     0.00%         383               383     0.00%           0                 0         -
lightway-client/src/main.rs                                       48                48     0.00%           7                 7     0.00%         169               169     0.00%           0                 0         -
lightway-core/src/borrowed_bytesmut.rs                            86                 1    98.84%          24                 0   100.00%         196                 1    99.49%           0                 0         -
lightway-core/src/builder_predicates.rs                           20                10    50.00%           4                 2    50.00%          28                14    50.00%           0                 0         -
lightway-core/src/cipher.rs                                        8                 0   100.00%           3                 0   100.00%          13                 0   100.00%           0                 0         -
lightway-core/src/connection.rs                                  670               403    39.85%          58                27    53.45%         875               463    47.09%           0                 0         -
lightway-core/src/connection/builders.rs                          67                25    62.69%          22                11    50.00%         260                56    78.46%           0                 0         -
lightway-core/src/connection/dplpmtud.rs                         761                90    88.17%          66                 1    98.48%         947                11    98.84%           0                 0         -
lightway-core/src/connection/fragment_map.rs                     132                11    91.67%          27                 0   100.00%         290                 7    97.59%           0                 0         -
lightway-core/src/connection/io_adapter.rs                       137                17    87.59%          36                 5    86.11%         313                23    92.65%           0                 0         -
lightway-core/src/connection/key_update.rs                        23                 7    69.57%           5                 0   100.00%          38                19    50.00%           0                 0         -
lightway-core/src/context.rs                                      91                27    70.33%          26                 9    65.38%         213                52    75.59%           0                 0         -
lightway-core/src/context/ip_pool.rs                               7                 3    57.14%           1                 0   100.00%           6                 0   100.00%           0                 0         -
lightway-core/src/context/server_auth.rs                          14                11    21.43%           4                 3    25.00%          24                20    16.67%           0                 0         -
lightway-core/src/io.rs                                            3                 3     0.00%           3                 3     0.00%          10                10     0.00%           0                 0         -
lightway-core/src/lib.rs                                           9                 6    33.33%           4                 1    75.00%          18                 9    50.00%           0                 0         -
lightway-core/src/metrics.rs                                      17                17     0.00%          15                15     0.00%          33                33     0.00%           0                 0         -
lightway-core/src/packet.rs                                       27                 7    74.07%           4                 1    75.00%          30                 6    80.00%           0                 0         -
lightway-core/src/plugin.rs                                       66                 8    87.88%          23                 5    78.26%         160                 9    94.38%           0                 0         -
lightway-core/src/utils.rs                                       101                21    79.21%          22                 2    90.91%         184                17    90.76%           0                 0         -
lightway-core/src/version.rs                                      37                 0   100.00%          19                 0   100.00%          89                 0   100.00%           0                 0         -
lightway-core/src/wire.rs                                        156                27    82.69%          32                 0   100.00%         267                 6    97.75%           0                 0         -
lightway-core/src/wire/auth_failure.rs                             9                 1    88.89%           3                 0   100.00%          19                 0   100.00%           0                 0         -
lightway-core/src/wire/auth_request.rs                           147                12    91.84%          34                 0   100.00%         287                 0   100.00%           0                 0         -
lightway-core/src/wire/auth_success_with_config_ipv4.rs           69                 4    94.20%          13                 0   100.00%         145                 0   100.00%           0                 0         -
lightway-core/src/wire/data.rs                                    20                 1    95.00%           7                 0   100.00%          43                 0   100.00%           0                 0         -
lightway-core/src/wire/data_frag.rs                               41                 1    97.56%          17                 0   100.00%          92                 0   100.00%           0                 0         -
lightway-core/src/wire/encoding_request.rs                        22                 2    90.91%           6                 0   100.00%          44                 1    97.73%           0                 0         -
lightway-core/src/wire/encoding_response.rs                       22                 2    90.91%           6                 0   100.00%          44                 1    97.73%           0                 0         -
lightway-core/src/wire/ping.rs                                    22                 3    86.36%           7                 0   100.00%          68                 0   100.00%           0                 0         -
lightway-core/src/wire/pong.rs                                    15                 2    86.67%           5                 0   100.00%          34                 0   100.00%           0                 0         -
lightway-core/src/wire/server_config.rs                           20                 2    90.00%           5                 0   100.00%          44                 0   100.00%           0                 0         -
lightway-server/src/args.rs                                       30                30     0.00%          30                30     0.00%          30                30     0.00%           0                 0         -
lightway-server/src/auth.rs                                      104                36    65.38%          19                 5    73.68%         148                28    81.08%           0                 0         -
lightway-server/src/connection.rs                                 57                57     0.00%          26                26     0.00%         123               123     0.00%           0                 0         -
lightway-server/src/connection_manager.rs                         87                87     0.00%          25                25     0.00%         209               209     0.00%           0                 0         -
lightway-server/src/connection_manager/connection_map.rs          87                 9    89.66%          26                 2    92.31%         273                 9    96.70%           0                 0         -
lightway-server/src/io/inside/tun.rs                              25                25     0.00%           8                 8     0.00%          34                34     0.00%           0                 0         -
lightway-server/src/io/outside/tcp.rs                             80                80     0.00%           8                 8     0.00%          99                99     0.00%           0                 0         -
lightway-server/src/io/outside/udp.rs                            144               144     0.00%          18                18     0.00%         263               263     0.00%           0                 0         -
lightway-server/src/io/outside/udp/cmsg.rs                        47                16    65.96%          14                 5    64.29%         237                56    76.37%           0                 0         -
lightway-server/src/ip_manager.rs                                 82                25    69.51%          19                 4    78.95%         254                28    88.98%           0                 0         -
lightway-server/src/ip_manager/ip_pool.rs                        101                 1    99.01%          32                 0   100.00%         305                 0   100.00%           0                 0         -
lightway-server/src/lib.rs                                       122               122     0.00%          14                14     0.00%         198               198     0.00%           0                 0         -
lightway-server/src/main.rs                                       81                81     0.00%          10                10     0.00%         217               217     0.00%           0                 0         -
lightway-server/src/metrics.rs                                    91                89     2.20%          80                78     2.50%         216               212     1.85%           0                 0         -
lightway-server/src/statistics.rs                                 53                23    56.60%           8                 4    50.00%         103                42    59.22%           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                           5198              2389    54.04%        1106               491    55.61%        9790              3652    62.70%           0                 0         -

✅ Region coverage 54% passes
✅ Line coverage 62% passes

@kp-thomas-yau kp-thomas-yau force-pushed the fs-mistrust-fork branch 2 times, most recently from 1accf3a to 982bdc5 Compare March 27, 2025 07:59
@kp-thomas-yau kp-thomas-yau changed the title Use patched fs-mistrust to support tvOS Support building on tvOS Mar 31, 2025
@kp-thomas-yau kp-thomas-yau marked this pull request as ready for review March 31, 2025 09:11
@kp-thomas-yau kp-thomas-yau requested a review from a team as a code owner March 31, 2025 09:11
@kp-thomas-yau kp-thomas-yau self-assigned this Mar 31, 2025
@kp-thomas-yau kp-thomas-yau changed the title Support building on tvOS CVPN-1893 Support building on tvOS Mar 31, 2025
clap = { version = "4.4.7", features = ["derive"] }
ctrlc = { version = "3.4.2", features = ["termination"] }
# ctrlc = { version = "3.4.2", features = ["termination"] }
ctrlc = { git = "https://github.com/Detegr/rust-ctrlc.git", rev = "refs/pull/128/head"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we pinning at a specific merged branch but not master?

Copy link
Contributor Author

@kp-thomas-yau kp-thomas-yau Mar 31, 2025

Choose a reason for hiding this comment

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

I am pinning on a specific pull request Detegr/rust-ctrlc#128 's head commit, not the merged branch. Since this PR has already been merged, there's no way for someone else to modify the head commit of this PR, whereas pinning it at the master might be a security issue as someone could push a new commits to the master and do something weird/funky on it

FYI: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#choice-of-commit

@kp-thomas-yau kp-thomas-yau merged commit 7abacd8 into main Mar 31, 2025
11 checks passed
@kp-thomas-yau kp-thomas-yau deleted the fs-mistrust-fork branch March 31, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants