mirror of
https://github.com/mudler/luet.git
synced 2025-09-03 08:14:46 +00:00
Resolve deps before compiling
This commit is contained in:
@@ -189,6 +189,11 @@ func (cs *LuetCompiler) compileWithImage(image, buildertaggedImage, packageImage
|
||||
func (cs *LuetCompiler) Compile(concurrency int, keepPermissions bool, p CompilationSpec) (Artifact, error) {
|
||||
Debug("Compiling " + p.GetPackage().GetName())
|
||||
|
||||
err := cs.Tree().ResolveDeps(concurrency) // FIXME: This should be cached in CompileParallel, and not done for each compilation
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "While resoolving tree world deps")
|
||||
}
|
||||
|
||||
if len(p.GetPackage().GetRequires()) == 0 && p.GetImage() == "" {
|
||||
Error("Package with no deps and no seed image supplied, bailing out")
|
||||
return nil, errors.New("Package " + p.GetPackage().GetFingerPrint() + "with no deps and no seed image supplied, bailing out")
|
||||
|
@@ -106,7 +106,7 @@ var _ = Describe("Compiler", func() {
|
||||
})
|
||||
|
||||
Context("Reconstruct image tree", func() {
|
||||
FIt("Compiles it", func() {
|
||||
It("Compiles it", func() {
|
||||
generalRecipe := tree.NewCompilerRecipe()
|
||||
tmpdir, err := ioutil.TempDir("", "package")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
@@ -125,12 +125,12 @@ var _ = Describe("Compiler", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
spec3, err := compiler.FromPackage(&pkg.DefaultPackage{Name: "d", Category: "test", Version: "1.0"})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
Expect(spec.GetPackage().GetPath()).ToNot(Equal(""))
|
||||
Expect(spec3.GetPackage().GetRequires()[0].GetName()).To(Equal("c"))
|
||||
|
||||
spec.SetOutputPath(tmpdir)
|
||||
spec2.SetOutputPath(tmpdir)
|
||||
spec3.SetOutputPath(tmpdir)
|
||||
|
||||
artifacts, errs := compiler.CompileParallel(2, false, []CompilationSpec{spec, spec2, spec3})
|
||||
Expect(errs).To(BeNil())
|
||||
Expect(len(artifacts)).To(Equal(3))
|
||||
|
@@ -32,6 +32,9 @@ func Spinner(i int) {
|
||||
func SpinnerText(suffix, prefix string) {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
if s == nil {
|
||||
s = spinner.New(spinner.CharSets[22], 100*time.Millisecond) // Build our new spinner
|
||||
}
|
||||
s.Suffix = Bold(Magenta(suffix)).BgBlack().String()
|
||||
s.Prefix = Bold(Cyan(prefix)).String()
|
||||
}
|
||||
|
@@ -77,6 +77,7 @@ type Tree interface {
|
||||
SetPackageSet(s PackageSet)
|
||||
World() ([]Package, error)
|
||||
FindPackage(Package) (Package, error)
|
||||
ResolveDeps(int) error
|
||||
}
|
||||
|
||||
// >> Unmarshallers
|
||||
|
Reference in New Issue
Block a user