vapor-community / sendgrid-kit

📧 A Swift on Server SDK for the SendGrid API
https://swiftpackageindex.com/vapor-community/sendgrid-kit
MIT License
10 stars 14 forks source link

Docker compilation fails #14

Closed melgu closed 1 year ago

melgu commented 1 year ago

When compiling the package in Xcode, everything works as expected.

When I try to compile the project in a docker container, I get the following error:

/build/.build/checkouts/sendgrid-kit/Sources/SendGridKit/SendGridClient.swift:50:60: error: cannot convert value of type 'ByteBuffer' to expected argument type 'Data'
throw try decoder.decode(SendGridError.self, from: byteBuffer)
                                                   ^

To reproduce the error, you can use the following Dockerfile:

FROM swift:5.7.1-focal as build

# Install OS updates and, if needed, sqlite3
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
    && apt-get -q update \
    && apt-get -q dist-upgrade -y \
    && apt-get install -y libsqlite3-dev \
    && rm -rf /var/lib/apt/lists/*

# Set up a build area
WORKDIR /build

# First just resolve dependencies.
# This creates a cached layer that can be reused
# as long as your Package.swift/Package.resolved
# files do not change.
COPY ./Package.* ./
RUN swift package resolve

# Copy entire repo into container
COPY . .

# Build everything, with optimizations
RUN swift build -c release --static-swift-stdlib

And the following docker-compose.yml:

version: '3.7'

services:
  app:
    image: demo:latest
    build:
      context: .
melgu commented 1 year ago

Looks like this will be fixed in #13

Andrewangeta commented 1 year ago

@melgu 2.0.1 has been tagged :)