Giter VIP home page Giter VIP logo

Comments (9)

ugocottin avatar ugocottin commented on June 23, 2024 1

The main and only notable difference between your steps and mine is that you are using AL2 or Ubuntu as host, and I'm using macOS.

But I finally found out the cause of my issue: my file system is case-insensitive  😠.
On macOS, default APFS volume is case-insensitive. When I did my steps with the mounted folder located in a case-sensitive APFS volume, I succeed in compiling aws-crt-swift.

This is due to this code in SPM:

        let umbrellaHeader = publicHeadersDir.appending(component: moduleName + ".h")
        if fileSystem.isFile(umbrellaHeader) {
            // In this case, 'PublicHeadersDir' is expected to contain no subdirectories.
            if directories.count != 0 {
                diagnosticsEmitter.emit(.umbrellaHeaderHasSiblingDirectories(targetName: targetName, umbrellaHeader: umbrellaHeader, siblingDirs: directories))
                return .none
            }
            return .umbrellaHeader(umbrellaHeader)
        }

https://github.com/apple/swift-package-manager/blob/bfcff5f3fd65dacad08db9c7b065b78d8dc72ee5/Sources/PackageLoading/ModuleMapGenerator.swift#L130-L137

SPM will look for the S2N.h file, which is the same as s2n.h on a case-insensitive file system, but not on a case-sensitive file system like on AL2 or Ubuntu.

from aws-crt-swift.

waahm7 avatar waahm7 commented on June 23, 2024 1

Thank you, that's great debugging! I was able to successfully reproduce the issue, and I'm currently looking into possible solutions.

from aws-crt-swift.

waahm7 avatar waahm7 commented on June 23, 2024 1

Hi, we have fixed this issue in 0.12.0 release. Please feel free to reopen the issue if it still exists.

from aws-crt-swift.

jbelkins avatar jbelkins commented on June 23, 2024 1

FYI I was able to verify that this issue is fixed when I use 0.12.0 in AWS SDK for Swift

from aws-crt-swift.

waahm7 avatar waahm7 commented on June 23, 2024

Hi,

Thank you for creating the issue. I have tried it on both Amazon Linux 2 and Ubuntu 22.04 but could not reproduce the issue. It works fine for both. Could you please try cloning it again and building it? Also, you will need to install OpenSSL, please do the following.

For Ubuntu:

apt-get install openssl
apt-get install libssl-dev

For Amazon Linux 2:

yum install openssl
yum install openssl-devel

from aws-crt-swift.

ugocottin avatar ugocottin commented on June 23, 2024

Hi,
Thank you for your answer.
I tried with the swift:5.7-amazonlinux2 container image, and I succeed to reproduce the bug, but only if the repository was cloned on the host and mounted within a volume inside the container.

git clone --recurse https://github.com/awslabs/aws-crt-swift.git
cd aws-crt-swift
podman run -it --rm --volume "$(pwd)/:/src" --workdir "/src/" swift:5.7-amazonlinux2 swift build

I cannot reproduce if I clone the repository in the container.
I had the same ref for aws-crt-swift (0.6.1), and s2n submodule (v1.3.35)
Any ideas ?

from aws-crt-swift.

waahm7 avatar waahm7 commented on June 23, 2024

Hi,

Thank you for your answer. I have tried using both podman and docker to mount the source code, and I am able to do so without encountering any build issues. Could you please try cloning the repository again on the host to see if that resolves the problem? Thank you.

from aws-crt-swift.

ugocottin avatar ugocottin commented on June 23, 2024

Hi,

I cloned again the repository (now on commit ccec2f7).

I've tried again on my machine (macOS 13.2.1 on Apple Silicon M1 Pro), and on another Mac (macOS 13.0.1, Intel), both with podman version 4.4.1 with vm Fedora CoreOS 37.X, unsuccessfully.

I've also tried with various versions of the container image swift:5.X-amazonlinux2, unsuccessfully.

from aws-crt-swift.

waahm7 avatar waahm7 commented on June 23, 2024

Thank you for the response. Can you please explain a bit more about the steps that you are taking to encounter this issue, or what am I missing below?

  1. Create an AL2 or Ubuntu EC2 instance.
  2. SSH into the instance and clone the aws-crt-swift repository recursively using git clone --recurse https://github.com/awslabs/aws-crt-swift.git.
  3. Install Podman/Docker.
  4. Run a swift:5.X-amazonlinux2 container using Podman/Docker and mount the code directory.
  5. SSH into the container.
  6. do yum install openssl-devel.
  7. do Swift build, and it works.

from aws-crt-swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.