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

feat: support {Free|Net|Open}BSD #2311

Merged
merged 35 commits into from
May 24, 2024
Merged

feat: support {Free|Net|Open}BSD #2311

merged 35 commits into from
May 24, 2024

Conversation

dignifiedquire
Copy link
Contributor

@dignifiedquire dignifiedquire commented May 19, 2024

Adds support for iroh on NetBSD, FreeBSD and OpenBSD.

Status

Caveats

  • Build only in CI for now

Related Issues

References

Closes #2306

Copy link

@jbeich jbeich left a comment

Choose a reason for hiding this comment

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

Builds fine on FreeBSD 13.2 i386 and 15.0 amd64. All tests pass but don't seem to cover routing support which may be incorrect e.g., alignment and wire formats in probe_routing_stack.

cargo test output
$ cargo test
[...]
running 21 tests
test docs_engine::live::tests::test_sync_remove ... ok
test client::blobs::tests::test_blob_share ... ok
test client::blobs::tests::test_blob_read_at ... ok
test client::blobs::tests::test_blob_create_collection ... ok
test client::authors::tests::test_authors ... ok
test client::docs::tests::test_drop_doc_client_sync ... ok
test client::blobs::tests::test_blob_get_collection ... ok
test client::docs::tests::test_doc_import_export ... ok
test util::fs::tests::test_canonicalized_path_to_string ... ok
test node::tests::test_node_add_blob_stream ... ok
test util::fs::tests::test_path_to_key_roundtrip ... ok
test util::path::tests::test_iroh_paths_parse_roundtrip ... ok
test util::progress::tests::test_async_reader ... ok
test util::progress::tests::test_inc ... ok
test node::tests::test_ticket_multiple_addrs ... ok
test node::tests::test_node_add_tagged_blob_event ... ok
test node::tests::test_download_via_relay ... ok
test node::tests::test_download_via_relay_with_discovery ... ok
test node::tests::test_shutdown ... ok
test util::fs::tests::test_get_path_content ... ok
test node::rpc_status::tests::test_rpc_lock_file ... ok

test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 19.79s

     Running tests/gc.rs (target/debug/deps/gc-0199b6bf409f3bcb)

running 6 tests
test file::redb_doc_import_stress ... ok
ERROR iroh::node::builder: Error getting doc hashes: sending to iroh_docs actor failed
ERROR iroh::node::builder: Error getting doc hashes: sending to iroh_docs actor failed
test file::gc_file_basics ... ok
test file::gc_file_partial ... ok
test file::gc_file_stress ... ok
test gc_basics ... ok
test gc_hashseq_impl ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.63s

     Running tests/provide.rs (target/debug/deps/provide-0eb0ae199cf4d69d)

running 14 tests
test basics ... ignored, flaky
test empty_files ... ignored, flaky
test many_files ... ignored, flaky
test multi_file ... ignored, flaky
test sizes ... ignored, flaky
test test_chunk_not_found_1 ... ignored, flaky
test test_collection_stat ... ignored, flaky
test test_ipv6 ... ignored, flaky
test test_not_found ... ignored, flaky
test test_run_fsm ... ignored, flaky
test test_run_ticket ... ok
test test_server_close ... ok
test multiple_clients ... ok
test test_size_request_blob ... ok

test result: ok. 4 passed; 0 failed; 10 ignored; 0 measured; 0 filtered out; finished in 1.98s

     Running tests/sync.rs (target/debug/deps/sync-0cdb1baea6684d15)

running 12 tests
test sync_big ... ignored, flaky
test sync_drop_doc ... ok
test sync_open_close ... ok
test sync_subscribe_no_sync ... ok
test sync_subscribe_stop_close ... ok
ERROR iroh::node::builder: Error getting doc hashes: sending to iroh_docs actor failed
test doc_delete ... ok
test test_download_policies ... ok
test test_sync_via_relay ... ok
test sync_simple ... ok
test sync_restart_node ... ok
test sync_full_basic ... ok
test sync_gossip_bulk ... ok

test result: ok. 11 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 9.57s

     Running unittests src/lib.rs (target/debug/deps/iroh_base-3cf2c29e33d1eb77)

running 30 tests
test hash::tests::hash_redb ... ok
test hash::tests::test_empty_hash ... ok
test hash::tests::hash_and_format_redb ... ok
test hash::tests::test_hash_and_format_parse ... ok
test hash::tests::test_hash_and_format_json ... ok
test hash::tests::hash_wire_format ... ok
test hash::tests::test_hash ... ok
test hash::tests::test_hash_and_format_postcard ... ok
test hash::tests::test_hash_postcard ... ok
test hash::tests::test_hash_json ... ok
test hash::tests::test_hash_serde ... ok
test key::tests::public_key_json ... ok
test key::tests::public_key_postcard ... ok
test key::encryption::tests::test_same_public_key_low_level ... ok
test key::encryption::tests::test_same_public_key_api ... ok
test key::encryption::tests::test_roundtrip_public_key ... ok
test key::tests::test_display_from_str ... ok
test node_addr::tests::test_relay_url_absolute ... ok
test node_addr::tests::test_relay_url_debug_display ... ok
test key::tests::test_public_key_postcard ... ok
test ticket::node::tests::test_ticket_base32 ... ok
test ticket::blob::tests::test_ticket_base32 ... ok
test hash::tests::test_display_parse_roundtrip ... ok
test ticket::blob::tests::test_ticket_json ... ok
test ticket::blob::tests::test_ticket_postcard ... ok
test key::tests::test_secret_key_openssh_roundtrip ... ok
test ticket::node::tests::test_ticket_json ... ok
test ticket::node::tests::test_ticket_postcard ... ok
test key::tests::test_key_creation_cache ... ok
test key::encryption::tests::test_seal_open_roundtrip ... ok

test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

     Running unittests src/lib.rs (target/debug/deps/iroh_blobs-b0eeb74953c0e99d)

running 37 tests
test downloader::test::concurrent_progress ... ok
test downloader::test::fail_while_running ... ok
test downloader::test::retry_nodes_fail ... ok
test downloader::test::smoke_test ... ok
test format::collection::tests::roundtrip_blob ... ok
test format::collection::tests::roundtrip_collection_meta ... ok
test protocol::range_spec::tests::range_spec_roundtrip ... ok
test protocol::range_spec::tests::range_spec_seq_bytes_roundtrip ... ok
test protocol::range_spec::tests::range_spec_seq_canonical ... ok
test protocol::range_spec::tests::range_spec_seq_roundtrip ... ok
test protocol::range_spec::tests::range_spec_seq_roundtrip_cases ... ok
test protocol::range_spec::tests::range_spec_seq_wire_format ... ok
test protocol::range_spec::tests::range_spec_wire_format ... ok
test protocol::tests::request_wire_format ... ok
test store::bao_file::tests::concurrent_downloads ... ok
test downloader::test::cancellation ... ok
test store::bao_file::tests::stay_in_mem ... ok
test downloader::test::retry_nodes_jump_queue ... ok
test downloader::test::retry_nodes_simple ... ok
test store::bao_file::tests::partial_downloads ... ok
test downloader::test::deduplication ... ok
test store::fs::tests::actor_store_smoke ... ok
test store::fs::tests::get_or_create_cases ... ok
test downloader::test::long_queue ... ok
test store::fs::tests::import_file_error_cases ... ok
test store::fs::tests::import_file_datadir_is_file ... ok
test downloader::test::max_concurrent_requests_total ... ok
test store::fs::tests::import_file_overwrite ... ok
test store::fs::tests::import_file_reference_cases ... ok
test store::fs::tests::import_file_tempdir_is_file ... ok
test downloader::test::max_concurrent_requests_per_peer ... ok
test store::fs::tests::export_copy_cases ... ok
test store::fs::tests::export_reference_cases ... ok
test store::fs::tests::get_cases ... ok
test store::fs::tests::import_file_cases ... ok
test store::fs::tests::import_stream_cases ... ok
test store::fs::tests::import_mem_cases ... ok

test result: ok. 37 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.17s

     Running unittests src/main.rs (target/debug/deps/iroh-f9eaca9e7d73dc2f)

running 6 tests
test commands::blob::tests::test_output_target ... ok
test commands::blob::tests::test_blob_source ... ok
test config::tests::test_default_settings ... ok
test logging::tests::test_default_file_rust_log ... ok
test commands::start::tests::test_run_rpc_lock_file ... ok
test commands::doc::tests::test_doc_import ... FAILED

failures:

---- commands::doc::tests::test_doc_import stdout ----
Error: rpc connect

Caused by:
    iroh is not running, please start it


failures:
    commands::doc::tests::test_doc_import

test result: FAILED. 5 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.80s

error: test failed, to rerun pass `-p iroh-cli --bin iroh`

Closes #2306

NetBSD and OpenBSD are likely still broken due to missing probe_routing_stack but should be easier to adapt as go/zsys bindings are less crazy. However, I can't test build and not familar with cross.

DragonFly may be out-of-scope: not supported by iroh yet; routing API is mostly the same as FreeBSD except go/zsys bindings are less bloated.

iroh-net/src/net/interfaces/bsd.rs Outdated Show resolved Hide resolved
iroh-net/src/net/interfaces/bsd.rs Outdated Show resolved Hide resolved
iroh-net/src/net/interfaces/bsd.rs Outdated Show resolved Hide resolved
iroh-net/src/net/interfaces/bsd.rs Outdated Show resolved Hide resolved
iroh-net/src/net/interfaces/bsd.rs Outdated Show resolved Hide resolved
iroh-net/src/net/interfaces/bsd.rs Outdated Show resolved Hide resolved
iroh-net/src/net/interfaces/bsd.rs Outdated Show resolved Hide resolved
iroh-net/src/net/interfaces/bsd.rs Outdated Show resolved Hide resolved
iroh-net/src/net/interfaces/bsd.rs Outdated Show resolved Hide resolved
iroh-net/src/net/interfaces/bsd.rs Outdated Show resolved Hide resolved
@dignifiedquire dignifiedquire changed the title fix: free bsd compat fix: better BSD compatability May 21, 2024
@dignifiedquire dignifiedquire self-assigned this May 21, 2024
@dignifiedquire dignifiedquire added this to the v0.17.0 milestone May 21, 2024
@dignifiedquire dignifiedquire changed the title fix: better BSD compatability feat: support {Free|Net|Open}BSD May 21, 2024
@dignifiedquire
Copy link
Contributor Author

@jbeich this is now in a much better state, if you have some time, would appreciate another look from you

@dignifiedquire dignifiedquire marked this pull request as ready for review May 24, 2024 11:54
run: cross build --all --target ${{ matrix.target }}
env:
RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG'}}

cross_test:
Copy link
Contributor

Choose a reason for hiding this comment

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

does splitting this off speed up things? Because this way the compiling is done twice in two different jobs that don't share build caches, so intuitively I'd expect it to be slower as we don't have enough runners to parallelise enough to make this worth it.

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 split it up because one is just building, and the other is testing

Copy link
Contributor

Choose a reason for hiding this comment

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

but once they both work maybe it should be merged back into one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, but that won't happen soon I think

Currently upstream quinn 0.10.x does not work on bsd yet.  Simply
disable that test for now.
@dignifiedquire dignifiedquire added this pull request to the merge queue May 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 24, 2024
@dignifiedquire dignifiedquire added this pull request to the merge queue May 24, 2024
Merged via the queue into main with commit cd65470 May 24, 2024
26 checks passed
@dignifiedquire dignifiedquire deleted the fix-free-bsd branch May 24, 2024 20:23
matheus23 pushed a commit that referenced this pull request Nov 14, 2024
Adds support for `iroh`  on `NetBSD`, `FreeBSD` and `OpenBSD`.

## Status

- NetBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- FreeBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- OpenBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted


## Caveats

- Build only in CI for now

## Related Issues

- shellrow/netdev#69
- n0-computer/quinn#9

## References

-
https://github.com/freebsd/freebsd-ports/blob/78ad38f04f51/games/jumpy/files/patch-iroh
- rust-lang/libc#3711

Closes #2306

---------

Co-authored-by: Floris Bruynooghe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Fails to build on BSDs (except macOS)
3 participants