Code Monkey home page Code Monkey logo

Comments (10)

drewcrawford avatar drewcrawford commented on May 8, 2024

cc: @ddunbar

from swift-llbuild.

ddunbar avatar ddunbar commented on May 8, 2024

I haven't tried the docker test, but I tried this locally with your launch.swift and it works.

I suspect the problem you are hitting is related to the opening of the database. Will swift-build-tool have permissions to open .atllbuild/build.db?

from swift-llbuild.

ddunbar avatar ddunbar commented on May 8, 2024

Oh, actually that wouldn't explain why the same swift-build-tool invocation works inside the container. I verified I can repro w/ your docker container, investigating...

from swift-llbuild.

ddunbar avatar ddunbar commented on May 8, 2024

The problem is in your launch.swift, it has the wrong path to swift-build-tool, which is at /usr/local/bin, not /usr/bin.

If you fix that then you will get further (link still fails, probably because container doesn't have /usr/bin/clang++ I would guess?)

from swift-llbuild.

drewcrawford avatar drewcrawford commented on May 8, 2024

Updating path in reproduction case to /usr/local/bin.

clang++ is installed; and can link programs, otherwise this would never work. In reality this always works, except when NSTask spawned the process.

I don't know why the linker fails in this situation; that is the bug.

I have also tested if we can do NSTask->shell->sbt->linker, and the answer appears to be that any use of NSTask will break the linker. I have no theories for why that is so; the obvious candidates like environment variables (even if NSTask tries to break them) would be restored by the shell.

I am currently working around successfully with the POSIX "system(3)" call which is not affected by this issue.

from swift-llbuild.

ddunbar avatar ddunbar commented on May 8, 2024

In this case the problem is simply that NSTask isn't preserving the environment, so PATH isn't propagated to subprocess by NSTask.

Going NSTask -> shell works for me, but you have to remember to use "sh -l" to cause the environment to be reinitialized.

/cc @parkera

from swift-llbuild.

parkera avatar parkera commented on May 8, 2024

Thanks for tracking that down. Philippe, maybe you can take a look at this one?

from swift-llbuild.

phausler avatar phausler commented on May 8, 2024

Hmm looks like we don't do anything with the env but pass nil. Seems like an easy fix.

from swift-llbuild.

phausler avatar phausler commented on May 8, 2024

I pushed a change that should resolve this: apple/swift-corelibs-foundation@b3637a7

It would be good if this could be verified that the environment passing is correct. I did not get a chance yet to try it out with docker.

from swift-llbuild.

phausler avatar phausler commented on May 8, 2024

Needs verification

from swift-llbuild.

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.