-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added separate implementations of certain parts of regolith that are …
…Windows specific. (#125) - Updated Go to 1.17 - Everything related to ACL is implemented only for Windows - python filters try to run python with "python" and "python3" command - Regolith uses `venv/Scripts/python` on Windows and `venv/bin/python` on other OSs
- Loading branch information
Showing
6 changed files
with
125 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,51 @@ | ||
module bedrock-oss.github.com/regolith | ||
|
||
go 1.16 | ||
go 1.17 | ||
|
||
require ( | ||
cloud.google.com/go/storage v1.18.2 // indirect | ||
github.com/aws/aws-sdk-go v1.41.11 // indirect | ||
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect | ||
github.com/denisbrodbeck/machineid v1.0.1 | ||
github.com/fatih/color v1.13.0 | ||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||
github.com/google/go-github/v39 v39.2.0 | ||
github.com/hashicorp/go-getter v1.5.9 | ||
github.com/otiai10/copy v1.6.0 | ||
github.com/urfave/cli/v2 v2.3.0 | ||
go.uber.org/zap v1.19.1 | ||
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359 | ||
) | ||
|
||
require ( | ||
cloud.google.com/go v0.97.0 // indirect | ||
cloud.google.com/go/storage v1.18.2 // indirect | ||
github.com/aws/aws-sdk-go v1.41.11 // indirect | ||
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect | ||
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect | ||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/google/go-cmp v0.5.6 // indirect | ||
github.com/google/go-querystring v1.1.0 // indirect | ||
github.com/googleapis/gax-go/v2 v2.1.1 // indirect | ||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect | ||
github.com/hashicorp/go-safetemp v1.0.0 // indirect | ||
github.com/hashicorp/go-version v1.3.0 // indirect | ||
github.com/jmespath/go-jmespath v0.4.0 // indirect | ||
github.com/klauspost/compress v1.13.6 // indirect | ||
github.com/mattn/go-colorable v0.1.11 // indirect | ||
github.com/mattn/go-isatty v0.0.14 // indirect | ||
github.com/mitchellh/go-homedir v1.1.0 // indirect | ||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect | ||
github.com/otiai10/copy v1.6.0 | ||
github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||
github.com/ulikunitz/xz v0.5.10 // indirect | ||
github.com/urfave/cli/v2 v2.3.0 | ||
go.opencensus.io v0.23.0 // indirect | ||
go.uber.org/atomic v1.9.0 // indirect | ||
go.uber.org/multierr v1.7.0 // indirect | ||
go.uber.org/zap v1.19.1 | ||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect | ||
golang.org/x/net v0.0.0-20211020060615-d418f374d309 // indirect | ||
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359 | ||
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect | ||
google.golang.org/api v0.59.0 // indirect | ||
google.golang.org/appengine v1.6.7 // indirect | ||
google.golang.org/genproto v0.0.0-20211026145609-4688e4c4e024 // indirect | ||
google.golang.org/grpc v1.41.0 // indirect | ||
google.golang.org/protobuf v1.27.1 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//go:build !windows | ||
// +build !windows | ||
|
||
package regolith | ||
|
||
// venvScriptsPath is a folder name between "venv" and "python" that leads to | ||
// the python executable. | ||
const venvScriptsPath = "bin" | ||
|
||
// exeSuffix is a suffix for executable files. | ||
const exeSuffix = "" | ||
|
||
// copyFileSecurityInfo placeholder for a function which is necessary only | ||
// on Windows. | ||
func copyFileSecurityInfo(source string, target string) error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//go:build windows | ||
// +build windows | ||
|
||
package regolith | ||
|
||
import ( | ||
"fmt" | ||
|
||
"golang.org/x/sys/windows" | ||
) | ||
|
||
// venvScriptsPath is a folder name between "venv" and "python" that leads to | ||
// the python executable. | ||
const venvScriptsPath = "Scripts" | ||
|
||
// exeSuffix is a suffix for executable files. | ||
const exeSuffix = ".exe" | ||
|
||
// copyFileSecurityInfo copies the DACL info from source path to DACL of | ||
// the target path | ||
func copyFileSecurityInfo(source string, target string) error { | ||
securityInfo, err := windows.GetNamedSecurityInfo( | ||
source, | ||
windows.SE_FILE_OBJECT, | ||
windows.DACL_SECURITY_INFORMATION) | ||
if err != nil { | ||
return wrapError( | ||
fmt.Sprintf("Unable to get security info of %q.", source), err) | ||
} | ||
dacl, _, err := securityInfo.DACL() | ||
if err != nil { | ||
return wrapError( | ||
fmt.Sprintf("Unable to get DACL of %q.", source), err) | ||
} | ||
err = windows.SetNamedSecurityInfo( | ||
target, | ||
windows.SE_FILE_OBJECT, | ||
windows.DACL_SECURITY_INFORMATION, nil, nil, dacl, nil, | ||
) | ||
if err != nil { | ||
return wrapError( | ||
fmt.Sprintf("Unable to set DACL of %q.", target), err) | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//go:build windows | ||
// +build windows | ||
|
||
package test | ||
|
||
import ( | ||
|