Skip to content

🐞 Host go tests not working on Docker for Mac #3433

Closed

Description

@grouville

What is the issue?

When running the test suite locally (Mac M1), part of the tests fail with

host.directory.write path "/private/var/folders/qh/fcm1jq4j3p9d2js8_k_cbsyh0000gn/T/TestHostLocalDirWrite374047198/001" is outside workdir

This is unexpected behavior, as /private should be mountable (pointed out by @helderco):
image

Log output

go test -count=1 -race -v -run TestHostLocalDirWrite  ./core/integration
=== RUN   TestHostLocalDirWrite
=== PAUSE TestHostLocalDirWrite
=== CONT  TestHostLocalDirWrite
No buildkitd container found, creating one...
    host_test.go:190: 
                Error Trace:    /Users/helder/Projects/dagger/core/integration/host_test.go:190
                Error:          Received unexpected error:
                                input:4: host.directory.write path "/private/var/folders/qh/fcm1jq4j3p9d2js8_k_cbsyh0000gn/T/TestHostLocalDirWrite374047198/001" is outside workdir
                Test:           TestHostLocalDirWrite
--- FAIL: TestHostLocalDirWrite (15.26s)
FAIL
FAIL    go.dagger.io/dagger/core/integration    15.836s
FAIL

Steps to reproduce

Clean up your dagger cache:

docker stop dagger-buildkitd ; docker rm dagger-buildkitd ; docker rmi dagger-buildkitd ; docker volume rm dagger-buildkitd

And run one of the host tests:

go test -count=1 -race -v -run TestHostLocalDirWrite  ./core/integration

Dagger version

dagger devel (6971657) darwin/arm64

OS version

macOS 12.5.1

cc @aluzzardi @vito

Activity

  1. added
    kind/bug
    on Oct 19, 2022
  2. grouville commented on Oct 19, 2022

    @grouville
    MemberAuthor

    Related: https://github.com/grouville/dagger/actions/runs/3282159658/jobs/5405174854
    When running this test on a native MacOS runner with Docker Desktop installed, same issue.

  3. jpadams commented on Oct 19, 2022

    @jpadams
    Contributor

    This PR fixes my issue!
    #3437 (comment)


    another easy repro on Mac laptop:
    ls -l /tmp
    # notice /tmp is a symlink: /tmp -> private/tmp
    cd /tmp
    git clone https://github.com/dagger/examples test_bug_3433
    cd test_bug_3433/templates/go/multiarch
    go run main.go
    
    #19 go build -o build/1.19/darwin/arm64/
    #19 CANCELED
    
    #20 go build -o build/1.19/linux/amd64/
    #20 CANCELED
    
    #21 go build -o build/1.18/darwin/arm64/
    #21 CANCELED
    
    #22 go build -o build/1.18/darwin/amd64/
    #22 CANCELED
    
    #23 go build -o build/1.18/linux/amd64/
    #23 CANCELED
    
    #24 go build -o build/1.19/darwin/amd64/
    #24 CANCELED
    input:1: host.workdir.write path "/private/tmp/examples/templates/go/multiarch/build/1.19/linux/arm64" is outside workdir
    

    This PR fixes my issue! https://github.com//pull/3437#issuecomment-1284324727
  4. grouville commented on Oct 20, 2022

    @grouville
    MemberAuthor

    Related #3012

  5. grouville commented on Dec 21, 2022

    @grouville
    MemberAuthor

    Works now, closing, as context is present on #3012

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

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions