mirror of
https://github.com/mudler/luet.git
synced 2025-08-29 12:13:09 +00:00
Consume SolverOptions in compiler
This commit is contained in:
parent
6aa353edb2
commit
07a154474b
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user