Skip to content

Commit

Permalink
fix: disable omnitrail attestor on windows (in-toto#278)
Browse files Browse the repository at this point in the history
Currently omnitrail expects a POSIX filesystem, which windows does not
supply. This causes windows builds to break when compiled with the
omnitrail attestor. This PR adds a build flag to skip the omnitrail
attestor when building for windows.

Signed-off-by: Mikhail Swift <mikhail@testifysec.com>
  • Loading branch information
mikhailswift authored Jun 13, 2024
1 parent 9f32585 commit 4f3e5c4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions attestation/omnitrail/omnitrail.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !windows

package omnitrail

import (
Expand Down
1 change: 0 additions & 1 deletion imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
_ "github.com/in-toto/go-witness/attestation/material"
_ "github.com/in-toto/go-witness/attestation/maven"
_ "github.com/in-toto/go-witness/attestation/oci"
_ "github.com/in-toto/go-witness/attestation/omnitrail"
_ "github.com/in-toto/go-witness/attestation/policyverify"
_ "github.com/in-toto/go-witness/attestation/product"
_ "github.com/in-toto/go-witness/attestation/sarif"
Expand Down
23 changes: 23 additions & 0 deletions imports_nonwindows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2024 Witness Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !windows

package witness

// These imports will only be run when go-witness is built on a non-windows target OS
import (
// all of the following imports are here so that each of the package's init functions run appropriately
_ "github.com/in-toto/go-witness/attestation/omnitrail"
)

0 comments on commit 4f3e5c4

Please sign in to comment.