Skip to content

Commit 15b5e90

Browse files
idiap-botpaketo-botsgaist
authored
Updates buildpack.toml with 25.9.1, 2026.0.2, 2026.0.3, 2.2.1, 25.7.0 (#70)
* Updating buildpack.toml with new versions 25.9.1, 2026.0.2, 2026.0.3, 2.2.1, 25.7.0 * fix: add buildpack.toml to REUSE.toml The file is auto-updated and stripped from its headers. * fix(conda): add auto-accept of TOS when installing * Updating buildpack.toml with new versions 2.3.2, 0.10.2, 2.3.1 * fix: correct name of miniconda download * feat: add more information in case of command failure * feat: add environment variable for ToS acceptation See https://www.anaconda.com/docs/getting-started/tos-plugin * fix: add missing unit test updates --------- Co-authored-by: paketo-bot <paketobuildpacks@gmail.com> Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
1 parent f0e1eb6 commit 15b5e90

7 files changed

Lines changed: 210 additions & 112 deletions

File tree

REUSE.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
version = 1
77

88
[[annotations]]
9-
path = ["go.mod", "go.sum"]
9+
path = ["go.mod", "go.sum", "buildpack.toml"]
1010
precedence = "override"
1111
SPDX-FileCopyrightText = "© 2025 Idiap Research Institute <contact@idiap.ch>"
1212
SPDX-License-Identifier = "Apache-2.0"

buildpack.toml

Lines changed: 183 additions & 105 deletions
Large diffs are not rendered by default.

dependency/retrieval/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func generateMinicondaMetadata(versionFetcher versionology.VersionFetcher) ([]ve
332332
Checksum: fmt.Sprintf("sha256:%s", minicondaRelease.BinarySHA256),
333333
ID: "miniconda3",
334334
Licenses: licenseIDsAsInterface,
335-
Name: "Miniconda3.sh",
335+
Name: "Miniconda.sh",
336336
OS: "linux",
337337
Arch: minicondaRelease.Arch,
338338
PURL: retrieve.GeneratePURL("miniconda3", version, minicondaRelease.SourceSHA256, minicondaRelease.SourceURL),

pkg/installers/miniconda/build.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
package miniconda
66

77
import (
8+
"bytes"
9+
"fmt"
810
"os"
911
"path/filepath"
1012
"time"
@@ -168,9 +170,17 @@ func Build(
168170

169171
conda := pexec.NewExecutable(condaLayer.Path + "/bin/conda")
170172
duration, err = clock.Measure(func() error {
171-
return conda.Execute(pexec.Execution{
172-
Args: []string{"install", "-n", "base", "conda-libmamba-solver", "-y"},
173+
buffer := bytes.NewBuffer(nil)
174+
err := conda.Execute(pexec.Execution{
175+
Args: []string{"install", "-n", "base", "conda-libmamba-solver", "-y"},
176+
Env: append(os.Environ(), "CONDA_PLUGINS_AUTO_ACCEPT_TOS=true"),
177+
Stdout: buffer,
178+
Stderr: buffer,
173179
})
180+
if err != nil {
181+
return fmt.Errorf("failed to setup solver:\n%s\nerror: %w", buffer.String(), err)
182+
}
183+
return nil
174184
})
175185
if err != nil {
176186
return packit.BuildResult{}, err
@@ -194,6 +204,7 @@ func Build(
194204

195205
}
196206

207+
condaLayer.SharedEnv.Append("CONDA_PLUGINS_AUTO_ACCEPT_TOS", "true", ":")
197208
condaLayer.Metadata = map[string]interface{}{
198209
DepKey: dependencyChecksum,
199210
}

pkg/installers/miniconda/build_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
131131
Expect(layer.Name).To(Equal("conda"))
132132
Expect(layer.Path).To(Equal(filepath.Join(layersDir, "conda")))
133133

134-
Expect(layer.SharedEnv).To(BeEmpty())
134+
Expect(layer.SharedEnv).To(HaveLen(2))
135+
Expect(layer.SharedEnv["CONDA_PLUGINS_AUTO_ACCEPT_TOS.delim"]).To(Equal(":"))
136+
Expect(layer.SharedEnv["CONDA_PLUGINS_AUTO_ACCEPT_TOS.append"]).To(Equal("true"))
137+
135138
Expect(layer.BuildEnv).To(BeEmpty())
136139
Expect(layer.LaunchEnv).To(BeEmpty())
137140
Expect(layer.ProcessLaunchEnv).To(BeEmpty())

pkg/installers/miniconda/script_runner.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package miniconda
66

77
import (
8+
"bytes"
89
"fmt"
910

1011
"github.com/paketo-buildpacks/packit/v2/pexec"
@@ -32,16 +33,20 @@ func NewScriptRunner(executable Executable) ScriptRunner {
3233
// Run invokes the miniconda script located in the given runPath, which
3334
// installs conda into the a layer path designated by condaLayerPath.
3435
func (s ScriptRunner) Run(runPath, condaLayerPath string) error {
36+
buffer := bytes.NewBuffer(nil)
3537
err := s.executable.Execute(pexec.Execution{
3638
Args: []string{
3739
runPath,
3840
"-b",
3941
"-f",
42+
"-u",
4043
"-p", condaLayerPath,
4144
},
45+
Stdout: buffer,
46+
Stderr: buffer,
4247
})
4348
if err != nil {
44-
return fmt.Errorf("failed while running miniconda install script: %w", err)
49+
return fmt.Errorf("failed while running miniconda install script:\n%s\nerror: %w", buffer.String(), err)
4550
}
4651

4752
return nil

pkg/installers/miniconda/script_runner_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func testScriptRunner(t *testing.T, context spec.G, it spec.S) {
6262
filepath.Join(scriptDir, "artifact"),
6363
"-b",
6464
"-f",
65+
"-u",
6566
"-p", layersDir,
6667
}))
6768
})
@@ -74,7 +75,7 @@ func testScriptRunner(t *testing.T, context spec.G, it spec.S) {
7475

7576
it("returns an error", func() {
7677
err := scriptRunner.Run(scriptPath, layersDir)
77-
Expect(err).To(MatchError("failed while running miniconda install script: script failed to run"))
78+
Expect(err).To(MatchError("failed while running miniconda install script:\n\nerror: script failed to run"))
7879
})
7980
})
8081
})

0 commit comments

Comments
 (0)