-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal set of patches to get restic working on Solaris #1649
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1649 +/- ##
==========================================
- Coverage 51.71% 46.49% -5.22%
==========================================
Files 143 143
Lines 11392 11392
==========================================
- Hits 5891 5297 -594
- Misses 4591 5241 +650
+ Partials 910 854 -56
Continue to review full report at Codecov.
|
@@ -0,0 +1,15 @@ | |||
// +build !windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node_solaris.go
below doesn't have this constraint, why is it needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point; it's not needed. I've pushed a fixed file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for taking a stab at this!
We need to fix the sftp backend before this can be merged (including the comments in the docs).
What's still missing (apart from sftp) is adding solaris
to the integration tests, so we see when it breaks:
restic/run_integration_tests.go
Line 125 in 6edf28d
"linux/arm", "freebsd/arm", |
// golang on Solaris lacks SYS_IOCTL. It should be possible to workaround | ||
// that, however for turn these functions into no-ops. | ||
func startForeground(cmd *exec.Cmd) (bg func() error, err error) { | ||
return nil, errors.New("sftp disabled on Solaris") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to use the sftp backend on solaris just fine, just without the magic that on Linux allows us to query for a password interactively and being able to tear down nicely at the same time.
Something like this should work:
// run the command in its own process group
// so that SIGINT is not sent to it
cmd.SysProcAttr = &syscall.SysProcAttr{
Setpgid: true,
}
// start the process
err = cmd.Start()
if err != nil {
return nil, errors.Wrap(err, "cmd.Start")
}
bg = func() error { return nil }
return bg, nil
This does come without xattr/fuse support at this point. NB: not hooking up the integration tests as restic won't compile without cgo with Go < 1.10.
Minimal set of patches to get restic working on Solaris
This effectively disables the xattr/fuse support. Also the sftp backend is disabled due to lack of
syscall.SYS_IOCTL
support in Go for Solaris.What is the purpose of this change? What does it change?
Allow restic to be built on the golang 'solaris' target. It was built and tested on SmartOS with
go version go1.9.3 solaris/amd64
Was the change discussed in an issue or in the forum before?
Closes #1576
Checklist
I have added tests for all changes in this PR(not needed?)changelog/x.y.z
that describe the changes for our users (template here)gofmt
on the code in all commits