From 07a154474b6c5d63f68890ff63c63aa435efcfa4 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 12 Feb 2020 11:21:55 +0100 Subject: [PATCH] Consume SolverOptions in compiler --- pkg/compiler/compiler.go | 4 +++- pkg/compiler/interface.go | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index dc494b45..da255b34 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -42,6 +42,7 @@ type LuetCompiler struct { PullFirst, KeepImg, Clean bool Concurrency int CompressionType CompressionImplementation + Options CompilerOptions } 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, Concurrency: opt.Concurrency, 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) { - 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()}) if err != nil { diff --git a/pkg/compiler/interface.go b/pkg/compiler/interface.go index 2672e6c0..42ebb4ea 100644 --- a/pkg/compiler/interface.go +++ b/pkg/compiler/interface.go @@ -18,6 +18,7 @@ package compiler import ( "runtime" + "github.com/mudler/luet/pkg/config" pkg "github.com/mudler/luet/pkg/package" "github.com/mudler/luet/pkg/solver" ) @@ -48,6 +49,8 @@ type CompilerOptions struct { Concurrency int CompressionType CompressionImplementation Clean bool + + SolverOptions config.LuetSolverOptions } func NewDefaultCompilerOptions() *CompilerOptions {