Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packit does not support absolute file:/// paths for dependency-mapping #591

Open
paulchambers opened this issue Aug 6, 2024 · 0 comments

Comments

@paulchambers
Copy link

Dependency mapping should allow users to use a local copy of a dependency by specifying an absolute file:/// path to a file mounted into the build. Instead packit always appends a base path to the path specified in the mapping

Expected Behavior

A dependency-mapping with the path failed to fetch dependency: failed to open file: file:///platform/bindings/dependency-mapping/binaries/yarn_1.22.19_linux_noarch_bionic_3235ba55.tgz should look in the given directory

Current Behavior

The packit based yarn buildpack instead gives this error:

failed to fetch dependency: failed to open file: open /cnb/buildpacks/paketo-buildpacks_yarn/1.3.7/platform/bindings/dependency-mapping/binaries/yarn_1.22.19_linux_noarch_bionic_3235ba55.tgz: no such file or directory

Possible Solution

Don't append the base path if the mapping starts with file:/// (a triple slash) (This is the behavior used in libpak based buildpacks)

This comment https://github.com/paketo-buildpacks/packit/blob/d558b87c97641ff5acfe9270248ecdfaaa4e7226/postal/service.go#L244C1-L247C1 suggests there may be buildpacks that expect the current behavior so it may need to append the base path for a non-absolute file URI (eg a double slash)

Steps to Reproduce

build a container using a dependency-mapping with an absolute file path

Motivations

This bug prevented using a local copy of the yarn dependency when deps.paketo.io failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant