Skip to content
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

Merged
merged 1 commit into from
Mar 5, 2018
Merged

Minimal set of patches to get restic working on Solaris #1649

merged 1 commit into from
Mar 5, 2018

Conversation

jasperla
Copy link
Contributor

@jasperla jasperla commented Mar 4, 2018

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 read the Contribution Guidelines
  • I have added tests for all changes in this PR (not needed?)
  • I have added documentation for the changes (in the manual)
  • There's a new file in a subdir of changelog/x.y.z that describe the changes for our users (template here)
  • I have run gofmt on the code in all commits
  • All commit messages are formatted in the same style as the other commits in the repo
  • I'm done, this Pull Request is ready for review

@codecov-io
Copy link

codecov-io commented Mar 4, 2018

Codecov Report

Merging #1649 into master will decrease coverage by 5.21%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
internal/fuse/meta_dir.go 0% <ø> (ø) ⬆️
cmd/restic/cmd_mount.go 57.14% <ø> (ø) ⬆️
internal/fuse/link.go 0% <ø> (ø) ⬆️
internal/fuse/root.go 0% <ø> (ø) ⬆️
internal/fuse/other.go 0% <ø> (ø) ⬆️
internal/restic/node_xattr.go 20% <ø> (ø) ⬆️
internal/restic/progress_unix.go 57.14% <ø> (ø) ⬆️
internal/fuse/dir.go 0% <ø> (ø) ⬆️
internal/fuse/blob_size_cache.go 81.81% <ø> (ø) ⬆️
internal/fuse/snapshots_dir.go 0% <ø> (ø) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da77f4a...96311d1. Read the comment docs.

@@ -0,0 +1,15 @@
// +build !windows
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@fd0 fd0 left a 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:

"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")
Copy link
Member

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.
@fd0 fd0 merged commit 96311d1 into restic:master Mar 5, 2018
fd0 added a commit that referenced this pull request Mar 5, 2018
Minimal set of patches to get restic working on Solaris
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants