Skip to content

Commit

Permalink
Merge pull request #130 from edytuk/sylabsv2.4.0
Browse files Browse the repository at this point in the history
Merge sylabs/sif through v2.4.0
  • Loading branch information
DrDaveD authored Mar 11, 2022
2 parents 7af6527 + 00ebaa3 commit 4c6ea58
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 35 deletions.
83 changes: 52 additions & 31 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,70 @@
# For website terms of use, trademark policy, privacy policy and other
# project policies see https://lfprojects.org/policies

project_name: siftool

release:
github:
owner: apptainer
name: sif
prerelease: auto

changelog:
use: github-native

gomod:
proxy: true
env:
- GOPROXY=https://proxy.golang.org,direct
- GOSUMDB=sum.golang.org

builds:
- binary: siftool
- id: darwin-builds
binary: siftool
goos:
- darwin
- linux
goarch:
- amd64
- arm
- arm64
main: &build-main ./cmd/siftool
mod_timestamp: &build-timestamp '{{ .CommitTimestamp }}'
env: &build-env
- CGO_ENABLED=0
flags: &build-flags '-trimpath'
ldflags: &build-ldflags |
-s
-w
-X main.version={{ .Version }}
-X main.date={{ .CommitDate }}
-X main.builtBy=goreleaser
-X main.commit={{ .FullCommit }}

- id: linux-builds
binary: siftool
goos:
- linux
goarch:
- '386'
- 'amd64'
- 'arm'
- 'arm64'
- 'mips'
- 'mips64'
- 'mips64le'
- 'mipsle'
- 'ppc64'
- 'ppc64le'
- 'riscv64'
- 's390x'
goarm:
- '6'
- '7'
env:
- CGO_ENABLED=0
flags: '-trimpath'
ldflags: '-s -w -X main.version={{ .Version }} -X main.commit={{ .FullCommit }} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser'
main: ./cmd/siftool
mod_timestamp: '{{ .CommitTimestamp }}'
main: *build-main
mod_timestamp: *build-timestamp
env: *build-env
flags: *build-flags
ldflags: *build-ldflags

archives:
- format: tar.gz
wrap_in_directory: 'true'
name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
files:
- README.md

checksum:
name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt'
- id: darwin-archives
builds:
- darwin-builds

changelog:
sort: asc
filters:
exclude:
- '^dev:'
- '^docs:'
- '^test:'
- '^Merge branch'
- '^Merge pull request'
- id: linux-archives
builds:
- linux-builds
5 changes: 4 additions & 1 deletion pkg/sif/arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Apptainer a Series of LF Projects LLC.
// For website terms of use, trademark policy, privacy policy and other
// project policies see https://lfprojects.org/policies
// Copyright (c) 2021, Sylabs Inc. All rights reserved.
// Copyright (c) 2021-2022, Sylabs Inc. All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consult the
// LICENSE file distributed with the sources of this project regarding your
// rights to use or distribute this software.
Expand All @@ -22,6 +22,7 @@ var (
hdrArchMIPS64 archType = [...]byte{'0', '9', '\x00'}
hdrArchMIPS64le archType = [...]byte{'1', '0', '\x00'}
hdrArchS390x archType = [...]byte{'1', '1', '\x00'}
hdrArchRISCV64 archType = [...]byte{'1', '2', '\x00'}
)

type archType [3]byte
Expand All @@ -40,6 +41,7 @@ func getSIFArch(arch string) archType {
"mips64": hdrArchMIPS64,
"mips64le": hdrArchMIPS64le,
"s390x": hdrArchS390x,
"riscv64": hdrArchRISCV64,
}

t, ok := archMap[arch]
Expand All @@ -63,6 +65,7 @@ func (t archType) GoArch() string {
hdrArchMIPS64: "mips64",
hdrArchMIPS64le: "mips64le",
hdrArchS390x: "s390x",
hdrArchRISCV64: "riscv64",
}

arch, ok := archMap[t]
Expand Down
6 changes: 4 additions & 2 deletions pkg/siftool/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Apptainer a Series of LF Projects LLC.
// For website terms of use, trademark policy, privacy policy and other
// project policies see https://lfprojects.org/policies
// Copyright (c) 2019-2021, Sylabs Inc. All rights reserved.
// Copyright (c) 2019-2022, Sylabs Inc. All rights reserved.
// Copyright (c) 2017, SingularityWare, LLC. All rights reserved.
// Copyright (c) 2017, Yannick Cote <[email protected]> All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consult the
Expand Down Expand Up @@ -70,7 +70,7 @@ func addFlags(fs *pflag.FlagSet) {
1-386, 2-amd64, 3-arm,
4-arm64, 5-ppc64, 6-ppc64le,
7-mips, 8-mipsle, 9-mips64,
10-mips64le, 11-s390x`)
10-mips64le, 11-s390x, 12-riscv64`)
signHash = fs.Int32("signhash", 0, `the signature hash used (with -datatype 5-Signature)
[NEEDED, no default]:
1-SHA256, 2-SHA384, 3-SHA512,
Expand Down Expand Up @@ -134,6 +134,8 @@ func getArch() string {
return "mips64le"
case 11:
return "s390x"
case 12:
return "riscv64"
default:
return "unknown"
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/siftool/testdata/TestAddCommands/Add/out.golden
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Flags:
1-386, 2-amd64, 3-arm,
4-arm64, 5-ppc64, 6-ppc64le,
7-mips, 8-mipsle, 9-mips64,
10-mips64le, 11-s390x
10-mips64le, 11-s390x, 12-riscv64
--partfs int32 the filesystem used (with -datatype 4-Partition)
[NEEDED, no default]:
1-Squash, 2-Ext3, 3-ImmuObj,
Expand Down

0 comments on commit 4c6ea58

Please sign in to comment.