Skip to content

Commit

Permalink
fix(ci): Fix Windows build (#1397)
Browse files Browse the repository at this point in the history
* fix(ci): Fix Windows build

* fix?

* fix?
  • Loading branch information
amaury1093 authored Dec 10, 2023
1 parent 83d70d8 commit ab2bb41
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions ci/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ $cross = $args[0]
$target_triple = $args[1]
$release_build = $args[2]

# reacher_worker doesn't compile on windows because of this bug:
# https://github.com/amqp-rs/reactor-trait/issues/1
# So we only build the check_if_email_exists binary for Windows.
if ( $release_build -ne "RELEASE" ) {
Invoke-Expression "$cross build --target $target_triple"
Invoke-Expression "$cross build --target $target_triple --all-features"
Invoke-Expression "$cross build --bin check_if_email_exists --target $target_triple"
Invoke-Expression "$cross build --bin check_if_email_exists --target $target_triple --all-features"
} else {
Invoke-Expression "$cross build --target $target_triple --all-features --release"
Invoke-Expression "$cross build --bin check_if_email_exists --target $target_triple --all-features --release"
}
7 changes: 5 additions & 2 deletions ci/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ TARGET_TRIPLE=$2
required_arg $CROSS 'CROSS'
required_arg $TARGET_TRIPLE '<Target Triple>'

$CROSS test --target $TARGET_TRIPLE
$CROSS test --target $TARGET_TRIPLE --all-features
# reacher_worker doesn't compile on windows because of this bug:
# https://github.com/amqp-rs/reactor-trait/issues/1
# So we only build the check_if_email_exists binary for Windows.
$CROSS test --bin check_if_email_exists --target $TARGET_TRIPLE
$CROSS test --bin check_if_email_exists --target $TARGET_TRIPLE --all-features
2 changes: 1 addition & 1 deletion worker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {

let options = ConnectionProperties::default()
// Use tokio executor and reactor.
// At the moment the reactor is only available for unix.
// At the moment the reactor is only available for unix (ref: https://github.com/amqp-rs/reactor-trait/issues/1)
.with_executor(tokio_executor_trait::Tokio::current())
.with_reactor(tokio_reactor_trait::Tokio)
.with_connection_name(backend_name.clone().into());
Expand Down

0 comments on commit ab2bb41

Please sign in to comment.