go build -o packer-builder-bug
PACKER_LOG=1 ./packer build test.json
Last active
July 17, 2019 03:59
-
-
Save paulmey/d634c61d7b5fb698b08b5cdb2f9cf713 to your computer and use it in GitHub Desktop.
This program demonstrates that Packer hangs when long lines need to be logged.
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
package main | |
import ( | |
"context" | |
"log" | |
"strings" | |
"time" | |
"github.com/hashicorp/packer/packer" | |
"github.com/hashicorp/packer/packer/plugin" | |
) | |
func main() { | |
server, err := plugin.Server() | |
if err != nil { | |
panic(err) | |
} | |
server.RegisterBuilder(new(testBuilder)) | |
server.Serve() | |
} | |
type testBuilder struct{} | |
func (*testBuilder) Prepare(...interface{}) ([]string, error) { return nil, nil } | |
func (*testBuilder) Run(context.Context, packer.Ui, packer.Hook) (packer.Artifact, error) { | |
time.Sleep(time.Second) | |
log.Print(strings.Repeat("Logging test - ", 10000)) | |
time.Sleep(time.Second) | |
return nil, 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
{ | |
"builders":[ | |
{"type": "bug"} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment