From dffea2387b7f941eb798548b7eca819738f3e95e Mon Sep 17 00:00:00 2001 From: Stan Bondi Date: Thu, 8 Sep 2022 12:09:21 +0400 Subject: [PATCH] fix: exclude libtor from windows build (#4631) --- .github/workflows/base_node_binaries.json | 3 ++- .github/workflows/base_node_binaries.yml | 2 +- infrastructure/libtor/Cargo.toml | 5 +---- infrastructure/libtor/src/lib.rs | 6 +++++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/base_node_binaries.json b/.github/workflows/base_node_binaries.json index 68641b7952..f3a72d7ae5 100644 --- a/.github/workflows/base_node_binaries.json +++ b/.github/workflows/base_node_binaries.json @@ -43,7 +43,8 @@ "target": "x86_64-pc-windows-msvc", "cross": false, "target_cpu": "x86-64", - "features": "safe" + "features": "safe", + "flags": "--workspace --exclude tari_libtor" }, { "name": "windows-arm64", diff --git a/.github/workflows/base_node_binaries.yml b/.github/workflows/base_node_binaries.yml index 7904f73ae4..01ce9f7101 100644 --- a/.github/workflows/base_node_binaries.yml +++ b/.github/workflows/base_node_binaries.yml @@ -187,7 +187,7 @@ jobs: with: use-cross: ${{ matrix.builds.cross }} command: build - args: --release --target ${{ matrix.builds.target }} --features ${{ matrix.builds.features }} ${{ matrix.builds.target_bins }} --locked + args: --release --target ${{ matrix.builds.target }} --features ${{ matrix.builds.features }} ${{ matrix.builds.target_bins }} ${{ matrix.builds.flags }} --locked - name: Copy binaries to folder for zipping shell: bash diff --git a/infrastructure/libtor/Cargo.toml b/infrastructure/libtor/Cargo.toml index f03dad5b62..eb625febe2 100644 --- a/infrastructure/libtor/Cargo.toml +++ b/infrastructure/libtor/Cargo.toml @@ -16,7 +16,4 @@ multiaddr = { version = "0.14.0" } rand = "0.8" tempfile = "3.1.0" tor-hash-passwd = "1.0.1" - -[target.'cfg(unix)'.dependencies] -tari_shutdown = { version = "^0.38", path = "../shutdown"} -libtor = { version = "46.9.0", optional = true } +libtor = "46.9.0" diff --git a/infrastructure/libtor/src/lib.rs b/infrastructure/libtor/src/lib.rs index ee78b8179c..1327bac9ed 100644 --- a/infrastructure/libtor/src/lib.rs +++ b/infrastructure/libtor/src/lib.rs @@ -20,5 +20,9 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#[cfg(unix)] +// For some inexplicable reason if we don't include extern crate then we get libtor not defined errors in this crate on +// matrix builds +#[allow(unused_extern_crates)] +extern crate libtor; + pub mod tor;