Skip to content

Commit

Permalink
feat[closes #40]: Dont use random directories for tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
axtloss committed Apr 21, 2024
1 parent 90403e3 commit bd884c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/meson.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (

"github.com/mitchellh/mapstructure"
"github.com/vanilla-os/vib/api"

"github.com/google/uuid"
)

type MesonModule struct {
Expand All @@ -17,7 +15,6 @@ type MesonModule struct {

// BuildMesonModule builds a module that builds a Meson project
func BuildMesonModule(moduleInterface interface{}, recipe *api.Recipe) (string, error) {
tmpDir := "/tmp/" + uuid.New().String()
var module MesonModule
err := mapstructure.Decode(moduleInterface, &module)
if err != nil {
Expand All @@ -32,6 +29,9 @@ func BuildMesonModule(moduleInterface interface{}, recipe *api.Recipe) (string,
return "", err
}

// Since the downloaded source goes through checksum verification already
// it is safe to simply use the specified checksum from the module definition
tmpDir := fmt.Sprintf("/tmp/%s-%s", module.Source.Checksum, module.Name)
cmd := fmt.Sprintf(
"cd /sources/%s && meson %s && ninja -C %s && ninja -C %s install",
module.Name,
Expand Down

0 comments on commit bd884c5

Please sign in to comment.