<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Ah, thanks! That was the missing piece of info and I missed that in the script.<div class=""><br class=""></div><div class="">If you truly need to install a full set of headers in a sandboxed location, then the compiler arguments to use to point at that location are the `--sysroot` ones for Clang. I haven't tried this myself, so YMMV, but something like `-Xcc --sysroot -Xcc /app/.delta` *might* work.</div><div class=""><br class=""></div><div class="">&nbsp;- Daniel</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 9, 2016, at 9:09 AM, Brian Croom &lt;<a href="mailto:brian.s.croom@gmail.com" class="">brian.s.croom@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">Note that the&nbsp;IBM buildpack works around the environmental restrictions by configuring apt-get to install packages in subdirectories of the buildpack sandbox, rather than in the standard system directories. This works great, but can still cause issues with components that search for things with absolute paths to the standard directories.&nbsp;<br class=""><br class="">torsdag 9 juni 2016 skrev Daniel Dunbar via swift-build-dev &lt;<a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a>&gt;:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 9, 2016, at 8:35 AM, Shao Miller via swift-build-dev &lt;<a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@swift.org');" target="_blank" class="">swift-build-dev@swift.org</a>&gt; wrote:</div><br class=""><div class="">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000" class="">
    <tt class="">Thanks, but let me try to explain for a third time: The build
      environment provided by CloudFoundry-style providers is
      locked-down.&nbsp; You have no choice where things go.&nbsp; They must all
      go inside a sandbox.&nbsp; That means you cannot put headers underneath
      the /usr/ directory.&nbsp; There is no way out of the sandbox, as there
      are no root-user privileges.<br class=""></tt></div></div></blockquote><div class=""><br class=""></div>You have stated that, but the IBM build pack works, uses CloudFoundry, and it clearly uses apt-get to install things in the system. You haven't explained how your environment is different yet.</div><div class=""><br class=""></div><div class="">&nbsp;- Daniel</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class=""><div bgcolor="#FFFFFF" text="#000000" class=""><tt class="">
      <br class="">
      This is why I'm asking about whether or not it's reasonable for
      Swift to avoid hard-coded paths, or to at least allow a given
      prefix to be specified.<br class="">
    </tt>
    <div class=""><br class="">
      Shao Miller<br class="">
      Synthetel Corporation<br class="">
      T: <a href="tel:+1.9053927729" target="_blank" class="">+1.9053927729</a><br class="">
      E: <a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@synthetel.com');" target="_blank" class="">swift-build-dev@synthetel.com</a><br class="">
      W: <a href="https://www.synthetel.com/" target="_blank" class="">https://www.synthetel.com</a><br class="">
      <br class="">
    </div>
    <div class="">On 6/9/2016 11:31, Daniel Dunbar wrote:<br class="">
    </div>
    <blockquote type="cite" class="">
      <div dir="ltr" class="">The IBM build pack installs a number of system
        dependencies which should include those headers, though. You
        should have the headers rooted at /usr, not try and have them in
        the app sandbox.
        <div class=""><br class="">
        </div>
        <div class="">&nbsp;- Daniel</div>
      </div>
      <div class="gmail_extra"><br class="">
        <div class="gmail_quote">On Thu, Jun 9, 2016 at 5:32 AM, Brian
          Croom via swift-build-dev <span dir="ltr" class="">&lt;<a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@swift.org');" target="_blank" class=""></a><a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@swift.org');" target="_blank" class="">swift-build-dev@swift.org</a>&gt;</span>
          wrote:<br class="">
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What
            underlying OS is your build process running on? And where
            are you getting&nbsp;your Swift toolchain?
            <div class=""><br class="">
            </div>
            <div class="">Within your toolchain is a `glibc.modulemap` which
              contains hard-coded absolute paths to certain system
              headers. The failure you are seeing is presumably due to
              the fact that system headers are not present at those
              paths. You may have to manually modify the modulemap to
              point to the actual location of the headers on the system
              that is performing the build.&nbsp;</div>
            <div class=""><br class="">
            </div>
            <div class="">This old bug contains some tidbits that may also help
              you understand what's going on here:&nbsp;<a href="https://bugs.swift.org/plugins/servlet/mobile#issue/SR-15" target="_blank" class=""></a><a href="https://bugs.swift.org/plugins/servlet/mobile#issue/SR-15" target="_blank" class="">https://bugs.swift.org/plugins/servlet/mobile#issue/SR-15</a></div>
            <div class=""><br class="">
            </div>
            <div class="">Brian
              <div class="">
                <div class=""><br class="">
                  <br class="">
                  torsdag 9 juni 2016 skrev Shao Miller &lt;<a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@synthetel.com');" target="_blank" class=""></a><a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@synthetel.com');" target="_blank" class="">swift-build-dev@synthetel.com</a>&gt;:<br class="">
                  <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank
                    you for your kind response.<br class="">
                    <br class="">
                    The command I execute is: swift build -Xcc
                    -I/app/.delta/ -Xswiftc -I/app/.delta/ -v<br class="">
                    <br class="">
                    The /app/.delta/ directory is where Swift and most
                    dependencies have been dumped.&nbsp; The file
                    /app/.delta/usr/include/complex.h exists. The error
                    is:<br class="">
                    <br class="">
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      /app/.delta/usr/lib/swift/linux/x86_64/glibc.modulemap:33:14:
                      error: header '///usr/include/complex.h' not found<br class="">
                      &nbsp; &nbsp; &nbsp; header "///usr/include/complex.h"<br class="">
                      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^<br class="">
                      &lt;unknown&gt;:0: error: could not build
                      Objective-C module 'SwiftGlibc'<br class="">
                      error: exit(1): /app/.delta/usr/bin/swiftc
                      --driver-mode=swift -I
                      /app/.delta/usr/lib/swift/pm -L
                      /app/.delta/usr/lib/swift/pm -lPackageDescription
                      /app/PerfectTemplate/Package.swift -fileno 3<br class="">
                    </blockquote>
                    <br class="">
                    Thank you for pointing out that these build-packs
                    are using 'swift build'.&nbsp; The two build-packs I'd
                    looked at earlier today did not and I thought I'd
                    recalled them having derived from the others you've
                    mentioned.&nbsp; I was mistaken.&nbsp; My command somewhat
                    resembles the IBM Bluemix build-pack command[1],
                    which is:<br class="">
                    swift build --configuration release -Xcc -fblocks
                    -Xcc -I$BUILD_DIR/.apt/usr/include ...and so on...<br class="">
                    <br class="">
                    I am using this[2] Swift.&nbsp; Running 'strace' on the
                    BASh and all of its subprocesses during the
                    compilation yields only these two instances of
                    "complex":<br class="">
                    <br class="">
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      [pid 28678] stat("///usr/include/complex.h",
                      0x7ffe84061ef0) = -1 ENOENT (No such file or
                      directory)<br class="">
                      [pid 28679] write(2, "header
                      '///usr/include/complex.h' not found", 43) = 43<br class="">
                    </blockquote>
                    <br class="">
                    Am I making an obvious mistake?<br class="">
                    <br class="">
                    [1] <a href="https://github.com/IBM-Swift/swift-buildpack/blob/bluemix-buildpack/bin/compile#L116" target="_blank" class="">https://github.com/IBM-Swift/swift-buildpack/blob/bluemix-buildpack/bin/compile#L116</a><br class="">
                    [2] <a href="https://swift.org/builds/development/ubuntu1510/swift-DEVELOPMENT-SNAPSHOT-2016-05-31-a/swift-DEVELOPMENT-SNAPSHOT-2016-05-31-a-ubuntu15.10.tar.gz" target="_blank" class="">https://swift.org/builds/development/ubuntu1510/swift-DEVELOPMENT-SNAPSHOT-2016-05-31-a/swift-DEVELOPMENT-SNAPSHOT-2016-05-31-a-ubuntu15.10.tar.gz</a><br class="">
                    <br class="">
                    Shao Miller<br class="">
                    Synthetel Corporation<br class="">
                    T: <a href="tel:%2B1.9053927729" value="+19053927729" target="_blank" class="">+1.9053927729</a> &lt;tel:<a href="tel:%2B1.9053927729" value="+19053927729" target="_blank" class="">+1.9053927729</a>&gt;<br class="">
                    E: <a class="">swift-build-dev@synthetel.com</a><br class="">
                    W: <a href="https://www.synthetel.com/" target="_blank" class="">https://www.synthetel.com</a><br class="">
                    <br class="">
                    On 6/9/2016 01:15, Brian Croom wrote:<br class="">
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      IBM's buildpack as well as the ones from which it
                      descends (<a href="https://github.com/cloudfoundry-community/swift-buildpack" target="_blank" class="">https://github.com/cloudfoundry-community/swift-buildpack</a>
                      and <a href="https://github.com/kylef/heroku-buildpack-swift" target="_blank" class="">https://github.com/kylef/heroku-buildpack-swift</a>)
                      are all based around SwiftPM and the `swift build`
                      command. I have not personally experienced the
                      problem you are describing either, although I have
                      not tried pushing any apps using more recent Swift
                      toolchain snapshots.<br class="">
                      <br class="">
                      Can you provide more details about how the error
                      presents itself? Have you tried using any of these
                      other buildpacks with your app code?<br class="">
                      <br class="">
                      Brian<br class="">
                      <br class="">
                      onsdag 8 juni 2016 skrev Shao Miller via
                      swift-build-dev &lt;<a class="">swift-build-dev@swift.org</a>
                      &lt;mailto:<a class="">swift-build-dev@swift.org</a>&gt;&gt;:<br class="">
                      <br class="">
                      &nbsp; &nbsp; Thank you for your kind response.<br class="">
                      <br class="">
                      &nbsp; &nbsp; As mentioned, there is no choice: If the
                      headers aren't present in<br class="">
                      &nbsp; &nbsp; the base image that a particular Cloud
                      provider provides, they can<br class="">
                      &nbsp; &nbsp; only be present in the application sand-box by
                      one's own hand.<br class="">
                      <br class="">
                      &nbsp; &nbsp; All Swift build-packs to date and to my
                      knowledge use Swift 2.2<br class="">
                      &nbsp; &nbsp; and do not use the Swift 3 'swift build'
                      process.&nbsp; I'm trying to<br class="">
                      &nbsp; &nbsp; develop the next generation.<br class="">
                      <br class="">
                      &nbsp; &nbsp; Shao Miller<br class="">
                      &nbsp; &nbsp; Synthetel Corporation<br class="">
                      &nbsp; &nbsp; T: <a href="tel:%2B1.9053927729" value="+19053927729" target="_blank" class="">+1.9053927729</a> &lt;tel:<a href="tel:%2B1.9053927729" value="+19053927729" target="_blank" class="">+1.9053927729</a>&gt;<br class="">
                      &nbsp; &nbsp; E: <a class="">swift-build-dev@synthetel.com</a><br class="">
                      &nbsp; &nbsp; &lt;<a class="">javascript:_e(%7B%7D,'cvml</a>','<a class=""></a><a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@synthetel.com');" target="_blank" class="">swift-build-dev@synthetel.com</a>');&gt;<br class="">
                      &nbsp; &nbsp; W: <a href="https://www.synthetel.com/" target="_blank" class="">https://www.synthetel.com</a><br class="">
                      <br class="">
                      &nbsp; &nbsp; On 6/8/2016 23:08, Daniel Dunbar wrote:<br class="">
                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                        &nbsp; &nbsp; Why do you want the headers inside the app
                        sandbox? Usually they would remain outside.<br class="">
                        <br class="">
                        <br class="">
                        <br class="">
                        &nbsp; &nbsp; Have you looked at IBM's CloudFoundry build
                        pack (<a href="https://github.com/IBM-Swift/swift-buildpack" target="_blank" class="">https://github.com/IBM-Swift/swift-buildpack</a>)?
                        How does it handle the problem you are trying to
                        solve?<br class="">
                        <br class="">
                        <br class="">
                        <br class="">
                        &nbsp; &nbsp; &nbsp; - Daniel<br class="">
                        <br class="">
                        <br class="">
                        <br class="">
                        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                          &nbsp; &nbsp; On Jun 8, 2016, at 8:03 PM, Shao Miller
                          via swift-build-dev&lt;<a class=""></a><a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@swift.org');" target="_blank" class="">swift-build-dev@swift.org</a>&gt;<br class="">
                          &nbsp; &nbsp; &lt;<a class="">javascript:_e(%7B%7D,'cvml</a>','<a class=""></a><a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@swift.org');" target="_blank" class="">swift-build-dev@swift.org</a>');&gt;&nbsp;
                          wrote:<br class="">
                          <br class="">
                          <br class="">
                          <br class="">
                          &nbsp; &nbsp; Good day, Swift package manager
                          development folks.<br class="">
                          <br class="">
                          <br class="">
                          <br class="">
                          &nbsp; &nbsp; (There are at least two separate issues
                          being inquired about, but with the same
                          introductory context.)<br class="">
                          <br class="">
                          <br class="">
                          <br class="">
                          &nbsp; &nbsp; "Cloudy" deployment options derived from
                          or akin to CloudFoundry are agonizingly
                          locked-down environments.&nbsp; Essentially Swift
                          and all of its dependencies and one's
                          project's dependencies must be stuffed into an
                          arbitrary directory (henceforth referred to as
                          "the hole," but usually /app/ ) and build
                          processes performed without any root-user
                          privileges.&nbsp; One consequence is that one
                          cannot use the OS' package-management system
                          to install dependencies, but one must obtain
                          them and wrestle them into "the hole,"
                          instead.&nbsp; The strategy seems rather silly.<br class="">
                          <br class="">
                          <br class="">
                          <br class="">
                          &nbsp; &nbsp; While developing a so-called "buildpack"
                          for Swift 3 projects to be deployed via
                          CloudFoundryish options and utilizing the
                          'swift build' command, I have come across a
                          few issues.<br class="">
                          <br class="">
                          <br class="">
                          <br class="">
                          &nbsp; &nbsp; One issue is that 'swift build' wants to
                          do something with the
                          /usr/lib/swift/linux/x86_64/glibc.modulemap
                          file, but that file contains a hard-coded path
                          to a ///usr/include/complex.h header-file.&nbsp; As
                          is usually the case, this hard-coded path will
                          only work in a narrow set of environments,
                          which excludes "the hole" that CloudFoundry
                          provides.&nbsp; I have attempted to use '-Xcc
                          -I/the/hole' and '-Xswiftc -I/the/hole'
                          command-line arguments, but I do not observe
                          these paths (nor sub-paths) being tried for
                          the complex.h header-file during
                          complication.&nbsp; I used 'strace' to trace the
                          compilation process, including all
                          subprocesses.<br class="">
                          <br class="">
                          <br class="">
                          <br class="">
                          &nbsp; &nbsp; Is there some other mechanism to instruct
                          the Swift 3 package manager that its
                          [unfortunately] hard-coded paths are relative
                          to some particular path?&nbsp; If not, would it be
                          sensible to introduce some logic to specify
                          such a prefix path?<br class="">
                          <br class="">
                          <br class="">
                          <br class="">
                          &nbsp; &nbsp; Thank you for your time and attention.<br class="">
                          <br class="">
                          &nbsp; &nbsp; -- <br class="">
                          <br class="">
                          <br class="">
                          &nbsp; &nbsp; Shao Miller<br class="">
                          <br class="">
                          &nbsp; &nbsp; Synthetel Corporation<br class="">
                          <br class="">
                          &nbsp; &nbsp; T: <a href="tel:%2B1.9053927729" value="+19053927729" target="_blank" class="">+1.9053927729</a>
                          &lt;tel:<a href="tel:%2B1.9053927729" value="+19053927729" target="_blank" class="">+1.9053927729</a>&gt;<br class="">
                          <br class="">
                          &nbsp; &nbsp; <a class="">E:swift-build-dev@synthetel.com</a><br class="">
                          &nbsp; &nbsp; &lt;<a class="">javascript:_e(%7B%7D,'cvml</a>','<a class=""></a><a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@synthetel.com');" target="_blank" class="">swift-build-dev@synthetel.com</a>');&gt;<br class="">
                          <br class="">
                          &nbsp; &nbsp; W:<a href="https://www.synthetel.com/" target="_blank" class="">https://www.synthetel.com</a><br class="">
                          <br class="">
                          <br class="">
                          <br class="">
                          &nbsp; &nbsp;
                          _______________________________________________<br class="">
                          <br class="">
                          &nbsp; &nbsp; swift-build-dev mailing list<br class="">
                          <br class="">
                          &nbsp; &nbsp; <a class="">swift-build-dev@swift.org</a><br class="">
                          &nbsp; &nbsp; &lt;<a class="">javascript:_e(%7B%7D,'cvml</a>','<a class=""></a><a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@swift.org');" target="_blank" class="">swift-build-dev@swift.org</a>');&gt;<br class="">
                          <br class="">
                          &nbsp; &nbsp; <a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br class="">
                          <br class="">
                        </blockquote>
                      </blockquote>
                      <br class="">
                    </blockquote>
                    <br class="">
                  </blockquote>
                </div>
              </div>
            </div>
            <br class="">
            _______________________________________________<br class="">
            swift-build-dev mailing list<br class="">
            <a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@swift.org');" target="_blank" class="">swift-build-dev@swift.org</a><br class="">
            <a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br class="">
            <br class="">
          </blockquote>
        </div>
        <br class="">
      </div>
    </blockquote>
    <br class="">
  </div>

_______________________________________________<br class="">swift-build-dev mailing list<br class=""><a href="javascript:_e(%7B%7D,'cvml','swift-build-dev@swift.org');" target="_blank" class="">swift-build-dev@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br class=""></div></blockquote></div><br class=""></div></blockquote>
</div></blockquote></div><br class=""></div></body></html>