Skip to content

os.TempDir() features fail with docker, causing tests to fail on MacOS #134

Closed

Description

@rfay

What happened (or feature request):

In #116 @beeradb introduced very standard usage of os.TempDir()

On MacOS, though, the resultant directories don't seem to be mount-able by docker. The out-of-the-box TMPDIR on a Mac is generally something like /var/folders/db/741gx8tj20d5z1f3zjpvw2vh0000gp/T/ - but /var happens to be a link to /private/var. So the test appears to be untarring a repo into a directory that docker fails to mount. Our best theory so far is that Docker, which by default includes /private in its shared directories, doesn't properly process (or golang on mac?) doesn't process into a real directory. export TMPDIR=/private/var/folders/db/741gx8tj20d5z1f3zjpvw2vh0000gp/T/ (exposing the same directory without any symlink involvement) solves the problem, as does export TMPDIR=/Users/rfay/tmp (/Users is in the standard mount path for docker).

The resultant error message when running make test on MacOS for ddev is

ERROR: for local-drupal8-db  Cannot start service local-drupal8-db: Mounts denied: ocker-for-mac/osxfs/#namespaces for more info.
.
jpvw2vh0000gp/T/drupal8276132647/.ddev/data

What you expected to happen:

Working tests should run successfully on all platforms; there really shouldn't be any issues with this type of thing.

How to reproduce it (as minimally and precisely as possible):

'make test on IOS, with default $TMPDIR

Related source links or issues:

Pull #116 added the use of TMPDIR for mounted source trees.

It's certainly possible that we should chase this down/report it as a docker or golang bug. It's a nasty one.

We can probably solve it for ourselves by

  • controlling $TMPDIR to something we know is good, which might be hard to predict, or
  • by processing the result of ioutil.TempDir() explicitly into a path which does not contain a symlink, assuming that can be proven to be the problem.

Activity

  1. rfay commented on Apr 14, 2017

    @rfay
    MemberAuthor

    Fixed in #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions