1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-09 13:36:56 +02:00

fix: fpm fails randomly

FPM would randomly fail to build deb and rpm packages. It apparently
happens because fpm (or some tool it uses) shares state between runs
(possibly by overriding files that are going inside the archive).

The error `file changed as we read it` was happening, which is a `tar`
error.

I don't know how to fix this, but, in order to make goreleaser more
stable, I'll disable the concurrency here for now.

closes #333
This commit is contained in:
Carlos Alexandro Becker 2017-10-19 21:21:22 -02:00 committed by Carlos Alexandro Becker
parent 6277ab9ae3
commit ff42024602

View File

@ -12,7 +12,6 @@ import (
"github.com/goreleaser/goreleaser/context"
"github.com/goreleaser/goreleaser/internal/linux"
"github.com/goreleaser/goreleaser/pipeline"
"golang.org/x/sync/errgroup"
)
// ErrNoFPM is shown when fpm cannot be found in $PATH
@ -39,23 +38,21 @@ func (Pipe) Run(ctx *context.Context) error {
}
func doRun(ctx *context.Context) error {
var g errgroup.Group
for _, format := range ctx.Config.FPM.Formats {
for platform, groups := range ctx.Binaries {
if !strings.Contains(platform, "linux") {
log.WithField("platform", platform).Debug("skipped non-linux builds for fpm")
continue
}
format := format
arch := linux.Arch(platform)
for folder, binaries := range groups {
g.Go(func() error {
return create(ctx, format, folder, arch, binaries)
})
if err := create(ctx, format, folder, arch, binaries); err != nil {
return err
}
}
}
}
return g.Wait()
return nil
}
func create(ctx *context.Context, format, folder, arch string, binaries []context.Binary) error {