Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Commit

Permalink
Merge #470
Browse files Browse the repository at this point in the history
470: fix: compilation error when used as a dependency r=koivunej a=koivunej

Fixes the issue reported in [comment of #458](#458 (comment)) that whenever dependent on, even without any code calling `ipfs`, there is a build failure. This PR:

- removes top-level Cargo.lock now that I've learned why it's not good to keep around
- adds weekly scheduled build
- moves the `FsBlockStore::list` method body over to `FsBlockStore::list0` outside the `#[async_trait] impl BlockStore for FsBlockStore { ... }` where it does get the correct lifetimes inferred for the returned boxed future

The original compilation failure was caused by `async-trait` 0.1.42 => 0.1.43 upgrade deduced by bisecting Cargo.lock changes. It's still unknown why does the moved version work, but there are probably a lot of subleties to the code generated by `async-trait`. I don't yet know if this warrants any upstream bug reports; most likely not, we were stuck on a quite old version and many crates now work with it.

Co-authored-by: Joonas Koivunen <[email protected]>
  • Loading branch information
bors[bot] and koivunej authored Aug 4, 2021
2 parents b63eb14 + 2ee1463 commit 81b277e
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 3,549 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- staging
pull_request:
branches: '*'
schedule:
# added while removing the Cargo.lock to help combat dependency drift caused by too lenient Cargo.toml ranges
- cron: '0 3 * * 1' # every monday at 03:00

name: Rust IPFS

Expand Down Expand Up @@ -122,7 +125,7 @@ jobs:

- name: Build (others)
if: matrix.platform.cross == false
run: cargo build --locked --workspace --all-targets
run: cargo build --workspace --all-targets

- name: Run interop DHT tests with go-ipfs
if: matrix.platform.host == 'ubuntu-latest' && matrix.platform.cross == false
Expand All @@ -136,12 +139,12 @@ jobs:

- name: Build (android)
if: contains(matrix.platform.target, 'android')
run: cargo ndk --android-platform 29 --target ${{ matrix.platform.target }} build --locked --workspace --exclude ipfs-http
run: cargo ndk --android-platform 29 --target ${{ matrix.platform.target }} build --workspace --exclude ipfs-http
# exclude http on android because openssl

- name: Build other cross compilations
if: contains(matrix.platform.target, 'android') == false && matrix.platform.cross == true
run: cargo build --locked --workspace --exclude ipfs-http --target ${{ matrix.platform.target }}
run: cargo build --workspace --exclude ipfs-http --target ${{ matrix.platform.target }}
# exclude http on other cross compilation targets because openssl

- name: Rust tests (macos)
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target
**/*.rs.bk
Cargo.lock
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* chore: update a lot of dependencies including libp2p, tokio, warp [#446]
* fix: rename spans (part of [#453])
* fix: connect using DialPeer instead of DialAddress [#454]
* fix: compilation error when used as a dependency [#470]

[#429]: https://github.com/rs-ipfs/rust-ipfs/pull/429
[#428]: https://github.com/rs-ipfs/rust-ipfs/pull/428
Expand All @@ -19,6 +20,7 @@
[#446]: https://github.com/rs-ipfs/rust-ipfs/pull/446
[#453]: https://github.com/rs-ipfs/rust-ipfs/pull/453
[#454]: https://github.com/rs-ipfs/rust-ipfs/pull/454
[#470]: https://github.com/rs-ipfs/rust-ipfs/pull/470

# 0.2.1

Expand Down
Loading

0 comments on commit 81b277e

Please sign in to comment.