Skip to content

CBL-Mariner: the fips compiler does not support CGO_ENABLED=0 #492

Closed
@mfrw

Description

@mfrw

What did we do ?

  • Used the fips compliant go compiler on CBL-Mariner as a drop in replacement for the upstream compiler.
  • Used the defaults that Mariner has been using CGO_ENABLED=0

How did we build the fips compiler ?

  • Bootstrapped using upstream go1.4
  • Once the bootstrap was built we did a normal build as : [e.g. for go1.18.0]
echo 'go1.18.0-1-fips' > VERSION
pushd src
./make.bash --no-clean
popd

What Happened ?

  • The compiler threw an error [e.g. the first few lines for building moby-buildx]
export CGO_ENABLED=0"                                                                                                                                                                                                                                                          
CGO_ENABLED=0"                                                                                                                                                                                                                                                                 
go build -mod=vendor -ldflags '-X version.Version=0.7.1 -X version.Revision=05846896d149da05f3d6fd1e7770da187b52a247 -X version.Package=github.com/docker/buildx' -o buildx ./cmd/buildx"                                                                                      
package github.com/docker/buildx/cmd/buildx"                                                                                                                                                                                                                                   
imports github.com/docker/buildx/commands"                                                                                                                                                                                                                                     
imports github.com/docker/buildx/bake"                                                                                                                                                                                                                                         
imports github.com/compose-spec/compose-go/loader"                                                                                                                                                                                                                             
imports github.com/compose-spec/compose-go/schema"                                                                                                                                                                                                                             
imports github.com/xeipuuv/gojsonschema"                                                                                                                                                                                                                                       
imports net/http"                                                                                                                                                                                                                                                              
imports crypto/rand"                                                                                                                                                                                                                                                           
imports crypto/aes"                                                                                                                                                                                                                                                            
imports crypto/internal/backend"                                                                                                                                                                                                                                               
imports github.com/microsoft/go-crypto-openssl/openssl: build constraints exclude all Go files in /usr/lib/golang/src/vendor/github.com/microsoft/go-crypto-openssl/openssl"

What did we expect ?

  • The compiler works as a drop in replacement for the upstream compiler.
  • Are we missing anything ?

Related Issues/PRs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions