{"action":"created","issue":{"url":"https://api.github.com/repos/restic/restic/issues/85","labels_url":"https://api.github.com/repos/restic/restic/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/restic/restic/issues/85/comments","events_url":"https://api.github.com/repos/restic/restic/issues/85/events","html_url":"https://github.com/restic/restic/issues/85","id":56239461,"number":85,"title":"Darwin support","user":{"login":"rubenv","id":42904,"avatar_url":"https://avatars.githubusercontent.com/u/42904?v=3","gravatar_id":"","url":"https://api.github.com/users/rubenv","html_url":"https://github.com/rubenv","followers_url":"https://api.github.com/users/rubenv/followers","following_url":"https://api.github.com/users/rubenv/following{/other_user}","gists_url":"https://api.github.com/users/rubenv/gists{/gist_id}","starred_url":"https://api.github.com/users/rubenv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubenv/subscriptions","organizations_url":"https://api.github.com/users/rubenv/orgs","repos_url":"https://api.github.com/users/rubenv/repos","events_url":"https://api.github.com/users/rubenv/events{/privacy}","received_events_url":"https://api.github.com/users/rubenv/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/restic/restic/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/restic/restic/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-02T13:56:55Z","updated_at":"2015-02-03T20:19:36Z","closed_at":null,"body":"Currently restic relies on the Linux stat structure, which means that OSX (Darwin) isn't supported (nor is Windows):\r\n\r\n```\r\n# github.com/restic/restic\r\n./tree.go:318: stat.Ctim undefined (type *syscall.Stat_t has no field or method Ctim)\r\n./tree.go:318: not enough arguments in call to time.Unix\r\n./tree.go:319: stat.Atim undefined (type *syscall.Stat_t has no field or method Atim)\r\n./tree.go:319: not enough arguments in call to time.Unix\r\n./tree.go:338: cannot use stat.Nlink (type uint16) as type uint64 in assignment\r\n./tree.go:344: cannot use stat.Rdev (type int32) as type uint64 in assignment\r\n./tree.go:346: cannot use stat.Rdev (type int32) as type uint64 in assignment\r\n./tree.go:458: undefined: O_PATH\r\n```\r\n\r\nI'll happily help with porting (we'll need to move some things into platform specific pieces), but it's probably best to talk about the further implications first.\r\n\r\nSome things that come to mind:\r\n* Are there any caveats I should be aware of in the backup format with regards to cross-platform support?\r\n* Have you considered what should be the desired behavior when doing cross-platform restores? (e.g. backup a Linux server, restore some of it on a Mac)\r\n\r\nBiggest use case for me are Linux servers and Mac laptops, but if we can tackle Windows as well while we're at it, all the better.\r\n\r\nIt's probably a good idea to add cross-compile tests to the CI setup (tests would be even better, but that's hard, so let's ignore that for now).\r\n\r\nHere's the full output of cross-compiles to windows/mac:\r\n\r\n```\r\nNumber of parallel builds: 8\r\n\r\n-->   windows/amd64: github.com/restic/restic/cmd/restic\r\n-->    darwin/amd64: github.com/restic/restic/cmd/restic\r\n-->     linux/amd64: github.com/restic/restic/cmd/restic\r\n\r\n2 errors occurred:\r\n--> darwin/amd64 error: exit status 2\r\nStderr: # github.com/restic/restic\r\n./tree.go:318: stat.Ctim undefined (type *syscall.Stat_t has no field or method Ctim)\r\n./tree.go:318: not enough arguments in call to time.Unix\r\n./tree.go:319: stat.Atim undefined (type *syscall.Stat_t has no field or method Atim)\r\n./tree.go:319: not enough arguments in call to time.Unix\r\n./tree.go:338: cannot use stat.Nlink (type uint16) as type uint64 in assignment\r\n./tree.go:344: cannot use stat.Rdev (type int32) as type uint64 in assignment\r\n./tree.go:346: cannot use stat.Rdev (type int32) as type uint64 in assignment\r\n./tree.go:458: undefined: O_PATH\r\n\r\n--> windows/amd64 error: exit status 2\r\nStderr: # github.com/restic/restic\r\n./tree.go:313: undefined: syscall.Stat_t\r\n./tree.go:318: not enough arguments in call to time.Unix\r\n./tree.go:319: not enough arguments in call to time.Unix\r\n./tree.go:458: undefined: O_PATH\r\n./tree.go:458: undefined: syscall.O_NOFOLLOW\r\n./tree.go:476: undefined: syscall.Mknod\r\n./tree.go:481: undefined: syscall.Mknod\r\n./tree.go:486: undefined: syscall.Mkfifo\r\n```\r\n\r\nAs you can see, some things are easy (missing fields), others are hard (type differences)."},"comment":{"url":"https://api.github.com/repos/restic/restic/issues/comments/72726170","html_url":"https://github.com/restic/restic/issues/85#issuecomment-72726170","issue_url":"https://api.github.com/repos/restic/restic/issues/85","id":72726170,"user":{"login":"fd0","id":123276,"avatar_url":"https://avatars.githubusercontent.com/u/123276?v=3","gravatar_id":"","url":"https://api.github.com/users/fd0","html_url":"https://github.com/fd0","followers_url":"https://api.github.com/users/fd0/followers","following_url":"https://api.github.com/users/fd0/following{/other_user}","gists_url":"https://api.github.com/users/fd0/gists{/gist_id}","starred_url":"https://api.github.com/users/fd0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fd0/subscriptions","organizations_url":"https://api.github.com/users/fd0/orgs","repos_url":"https://api.github.com/users/fd0/repos","events_url":"https://api.github.com/users/fd0/events{/privacy}","received_events_url":"https://api.github.com/users/fd0/received_events","type":"User","site_admin":false},"created_at":"2015-02-03T20:19:35Z","updated_at":"2015-02-03T20:19:35Z","body":"I just pushed b7b9c7750df11f9174d0c18f460b0f3ec3aeec4f which splits out the platform specific code to different files. Could one of you test restic under darwin? What extra attributes should be saved on darwin?"}}