Consume SolverOptions in compiler

This commit is contained in:
Ettore Di Giacinto 2020-02-12 11:21:55 +01:00
parent 6aa353edb2
commit 07a154474b
No known key found for this signature in database
GPG Key ID: 1ADA699B145A2D1C
2 changed files with 6 additions and 1 deletions

View File

@ -42,6 +42,7 @@ type LuetCompiler struct {
PullFirst, KeepImg, Clean bool PullFirst, KeepImg, Clean bool
Concurrency int Concurrency int
CompressionType CompressionImplementation CompressionType CompressionImplementation
Options CompilerOptions
} }
func NewLuetCompiler(backend CompilerBackend, db pkg.PackageDatabase, opt *CompilerOptions) Compiler { func NewLuetCompiler(backend CompilerBackend, db pkg.PackageDatabase, opt *CompilerOptions) Compiler {
@ -58,6 +59,7 @@ func NewLuetCompiler(backend CompilerBackend, db pkg.PackageDatabase, opt *Compi
KeepImg: opt.KeepImg, KeepImg: opt.KeepImg,
Concurrency: opt.Concurrency, Concurrency: opt.Concurrency,
Clean: opt.Clean, Clean: opt.Clean,
Options: *opt,
} }
} }
@ -459,7 +461,7 @@ func (cs *LuetCompiler) packageFromImage(p CompilationSpec, tag string, keepPerm
func (cs *LuetCompiler) ComputeDepTree(p CompilationSpec) (solver.PackagesAssertions, error) { func (cs *LuetCompiler) ComputeDepTree(p CompilationSpec) (solver.PackagesAssertions, error) {
s := solver.NewSolver(pkg.NewInMemoryDatabase(false), cs.Database, pkg.NewInMemoryDatabase(false)) s := solver.NewResolver(pkg.NewInMemoryDatabase(false), cs.Database, pkg.NewInMemoryDatabase(false), cs.Options.SolverOptions.Resolver())
solution, err := s.Install([]pkg.Package{p.GetPackage()}) solution, err := s.Install([]pkg.Package{p.GetPackage()})
if err != nil { if err != nil {

View File

@ -18,6 +18,7 @@ package compiler
import ( import (
"runtime" "runtime"
"github.com/mudler/luet/pkg/config"
pkg "github.com/mudler/luet/pkg/package" pkg "github.com/mudler/luet/pkg/package"
"github.com/mudler/luet/pkg/solver" "github.com/mudler/luet/pkg/solver"
) )
@ -48,6 +49,8 @@ type CompilerOptions struct {
Concurrency int Concurrency int
CompressionType CompressionImplementation CompressionType CompressionImplementation
Clean bool Clean bool
SolverOptions config.LuetSolverOptions
} }
func NewDefaultCompilerOptions() *CompilerOptions { func NewDefaultCompilerOptions() *CompilerOptions {