softprops/serverless-aws-rust-http

Cargo Socket Error

JimLynchCodes opened this issue · 0 comments

After a fresh scaffold of this project with

serverless install \
  --url https://github.com/softprops/serverless-aws-rust-http \
  --name joke-fetcher-crab-lamb

I have docker running and then try to run this locally with sls invoke local -f hello

But then I get this error:

 sls invoke local -f hello
Running "serverless" from node_modules
Serverless: Deprecation Notice: bin/serverless is deprecated, use bin/serverless.js instead
            More Info: https://www.serverless.com/framework/docs/deprecations/#BIN_SERVERLESS
Serverless: Building Rust hello func...
Serverless: Running containerized build
    Updating crates.io index
   Compiling proc-macro2 v1.0.36
   Compiling syn v1.0.86
   Compiling libc v0.2.119
   Compiling once_cell v1.9.0
   Compiling pin-project-lite v0.2.8
   Compiling cfg-if v1.0.0
   Compiling pkg-config v0.3.24
   Compiling cc v1.0.57
   Compiling hashbrown v0.11.2
   Compiling httparse v1.6.0
   Compiling bytes v1.1.0
   Compiling bitflags v1.2.1
   Compiling openssl v0.10.38
   Compiling foreign-types-shared v0.1.1
   Compiling native-tls v0.2.8
   Compiling openssl-probe v0.1.5
   Compiling itoa v1.0.1
   Compiling httpdate v1.0.2
   Compiling encoding_rs v0.8.30
   Compiling ipnet v2.3.1
   Compiling mime v0.3.16
   Compiling base64 v0.13.0
   Compiling indexmap v1.8.0
   Compiling tracing-core v0.1.22
   Compiling futures-task v0.3.5
   Compiling foreign-types v0.3.2
   Compiling form_urlencoded v1.0.1
   Compiling http-body v0.4.4
   Compiling tracing-subscriber v0.2.7
   Compiling openssl-sys v0.9.72
   Compiling quote v1.0.7
   Compiling url v2.2.2
   Compiling net2 v0.2.34
   Compiling iovec v0.1.4
   Compiling socket2 v0.4.4
error[E0658]: `match` is not allowed in a `const fn`
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:165:9
    |
165 | /         match address {
166 | |             SocketAddr::V4(_) => Domain::IPV4,
167 | |             SocketAddr::V6(_) => Domain::IPV6,
168 | |         }
    | |_________^
    |
    = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: could not compile `socket2`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
Serverless: Rust build encountered an error: undefined 1.
 
  Error --------------------------------------------------
 
  Error: 
      at /Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/serverless-rust/index.js:289:15
      at Array.forEach (<anonymous>)
      at RustPlugin.build (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/serverless-rust/index.js:269:22)
      at /Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/serverless/lib/classes/PluginManager.js:476:55
      at tryCatcher (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/util.js:16:23)
      at Object.gotValue (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/reduce.js:168:18)
      at Object.gotAccum (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/reduce.js:155:25)
      at Object.tryCatcher (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromise0 (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/promise.js:649:10)
      at Promise._settlePromises (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/promise.js:729:18)
      at _drainQueueStep (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/async.js:93:12)
      at _drainQueue (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/async.js:86:9)
      at Async._drainQueues (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/async.js:102:5)
      at Immediate.Async.drainQueues [as _onImmediate] (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/async.js:15:14)
      at processImmediate (node:internal/timers:464:21)
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              16.13.2
     Framework Version:         1.74.1
     Plugin Version:            3.6.15
     SDK Version:               2.3.1
     Components Version:        2.31.10

What am I doing wrong here? 🤔