Packaging top level artifacts#525
Conversation
f67b715 to
5715410
Compare
| Description: "This extension installs the appropriate nodejs runtime via dnf", | ||
| Keywords: []string{"keyword1", "keyword2"}, | ||
| Licenses: []cargo.ConfigExtensionLicense{ | ||
| Licenses: []cargo.ConfigBuildpackLicense{ |
There was a problem hiding this comment.
Curious why this changed? Everything else here is referencing "extension".
There was a problem hiding this comment.
This is unrelated to the scope of the PR, is just some code re-usability. The structure about the license of the extension, is no different from the buildpack's one.
| for dependencyIndex, dependency := range config.Metadata.Dependencies { | ||
| if isMultiArch { | ||
| if dependency.OS == "" || dependency.Arch == "" { | ||
| return fmt.Errorf("dependency %s has no OS or Arch", dependency.ID) |
There was a problem hiding this comment.
Would this indicate a binary that's not specific to an arch? i.e. it should be included for all arches? Or is that handled differently?
There was a problem hiding this comment.
If the buildpack is multi-arch (which means has more than one target) and there is not os and arch on the dependency it will fail to package it. Otherwise, it will add it under the dependencies directory under the correct platform directory, based on the os and arch that is specified for this dependency.
There was a problem hiding this comment.
Ok, so this means that there is no such thing as a "noarch" dependency, right? It means if we want to have a dependency for all the architectures, then we need to list it multiple times in buildpack.toml.
I don't think a lot of our buildpacks would need this, and I'm thinking ahead a little bit as I want to move the java buildpacks to use this tooling eventually. For the Java buildpacks, we have JAR dependencies that are "noarch", it doesn't matter. Ex: here. In this case, what we want is to have the tooling add that to all the architectures.
Rather than error here, I think we should follow the logic from RFC 0059...
Note: If os or arch are not given it should be assumed that the dependency is OS or Architecture agnostic and is compatible to run on any given OS or Architecture.
Which I believe would mean if we're in a multi-arch buildpack (i.e. we have targets), then we should copy a dependency without OS or architecture into each of the OS & architectures.
There was a problem hiding this comment.
Ok, so this means that there is no such thing as a "noarch" dependency, right? It means if we want to have a dependency for all the architectures, then we need to list it multiple times in buildpack.toml.
What you describe is correct, this is the current behavior of jam but only for the offline mode, because on the offline mode we download the dependencies, otherwise we dont touch the buildpack.toml. Still I have to validate that. I'll verify and I'll let you know.
Ok, I didnt know there is a spec for that! Thanks, I'll patch also the offline mode ASAP :)
…ample-cnb-with-target
…name to example-cnb-multi-arch
…lti-arch directories
60d83e5 to
621e872
Compare
621e872 to
4106906
Compare
|
@benjaminguttmann-avtq and without any other change on the php-dist repo, i managed to include the files under the config directory for all the architectures. Feel free to validate, based on the implementation of jam from the currect PR. |
|
Sorry for the huge PR, as it ended up a rabbit hole, due to the implementation of multi-arch needed some fixes, on the extension side and on the buildpack side. |
Summary
This PR, adds functionality for packaging top level artifacts if they are included on the include-scripts attribute on the buildpack/extension.toml . E.g. the a Readme.md file, in case of multi-arch will end up under the /os/arch directories and in case of single arch will end up on the root directory.
This PR:
Use Cases
Checklist