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

Remove buidpack API changes from platform/0.4 #122

Merged
merged 1 commit into from
Jul 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 21 additions & 27 deletions buildpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ Executable: `/bin/detect <platform[AR]> <plan[E]>`, Working Dir: `<app[AR]>`
| Output | Description
|--------------------|----------------------------------------------
| [exit status] | Pass (0), fail (100), or error (1-99, 101+)
| Standard output | Logs (info)
| Standard error | Logs (warnings, errors)
| `/dev/stdout` | Logs (info)
| `/dev/stderr` | Logs (warnings, errors)
| `<plan>` | Contributions to the the Build Plan (TOML)


Expand Down Expand Up @@ -210,10 +210,9 @@ The lifecycle MUST consider layers that are marked `launch = false` and `build =

## App Interface

| Output | Description
|------------------------|----------------------------------------------
| `<app>/.profile` | [†](README.md#linux-only) Bash-formatted script sourced by shell before launch
| `<app>/.profile.bat` | [‡](README.md#windows-only) BAT-formatted script sourced by shell before launch
| Output | Description
|------------------|----------------------------------------------
| `<app>/.profile` | Script sourced by bash before launch

## Phase #1: Detection

Expand All @@ -227,9 +226,8 @@ These buildpacks must be compatible with the app.
### Process

**GIVEN:**
- An ordered list of buildpack groups resolved into buildpack implementations as described in [Order Resolution](#order-resolution)
- A directory containing application source code
- A shell, if needed,
- An ordered list of buildpack groups resolved into buildpack implementations as described in [Order Resolution](#order-resolution) and
- A directory containing application source code,

For each buildpack in each group in order, the lifecycle MUST execute `/bin/detect`.

Expand Down Expand Up @@ -407,7 +405,7 @@ This is achieved by:
- The Buildpack Plan,
- Any `<layers>/<layer>.toml` files placed on the filesystem during the analysis phase,
- Any locally cached `<layers>/<layer>` directories, and
- A shell, if needed,
- Bash version 3 or greater, if needed,

For each buildpack in the group in order, the lifecycle MUST execute `/bin/build`.

Expand Down Expand Up @@ -558,7 +556,7 @@ To choose an execution strategy,

1. **IF** a buildpack-provided process type is chosen as the start command,
1. **IF** the process type does not have `direct` set to `true`,
**THEN** the lifecycle MUST invoke the value of `command` as a command using the shell with values of `args` provided as arguments.
**THEN** the lifecycle MUST invoke the value of `command` as a command using Bash with values of `args` provided as arguments.

2. **IF** the process type does have `direct` set to `true`,
**THEN** the lifecycle MUST invoke the value of `command` using the `execve` syscall with values of `args` provided as arguments.
Expand All @@ -570,7 +568,7 @@ Given the start command and execution strategy,

1. The lifecycle MUST set all buildpack-provided launch environment variables as described in the [Environment](#environment) section.

2. If using an execution strategy involving a shell, the lifecycle MUST use a single shell process to
2. If using an execution strategy involving Bash, the lifecycle MUST use a single Bash process to
1. source each file in each `<layers>/<layer>/profile.d` directory,
1. Firstly, in order of `/bin/build` execution used to construct the OCI image.
2. Secondly, in alphabetically ascending order by layer directory name.
Expand All @@ -583,11 +581,8 @@ Given the start command and execution strategy,

3. The lifecycle MUST invoke the start command with the decided execution strategy.

[†](README.md#linux-only)When executing a process using any execution strategy, the lifecycle SHOULD replace the lifecycle process in memory without forking it.

[†](README.md#linux-only)When executing a process with Bash, the lifecycle SHOULD additionally replace the Bash process in memory without forking it.

[‡](README.md#windows-only)When executing a process with Command Prompt, the lifecycle SHOULD start a new process with the same security context, terminal, working directory, STDIN/STDOUT/STDERR handles and environment variables as the Command Prompt process.
When executing a process using any execution strategy, the lifecycle SHOULD replace the lifecycle process in memory without forking it.
When executing a process with Bash, the lifecycle SHOULD additionally replace the Bash process in memory without forking it.

## Environment

Expand Down Expand Up @@ -615,16 +610,15 @@ In either case,

- The lifecycle MUST order all `<layer>` paths to reflect the reversed order of the buildpack group.
- The lifecycle MUST order all `<layer>` paths provided by a given buildpack alphabetically ascending.
- The lifecycle MUST separate each path with the OS path list separator (e.g. `:` on Linux, `;` on Windows).

| Env Variable | Layer Path | Contents | Build | Launch |
|--------------------------------------------|--------------|------------------|-------|--------|
| `PATH` | `/bin` | binaries | [x] | [x] |
| [†](README.md#linux-only)`LD_LIBRARY_PATH` | `/lib` | shared libraries | [x] | [x] |
| [†](README.md#linux-only)`LIBRARY_PATH` | `/lib` | static libraries | [x] | |
| `CPATH` | `/include` | header files | [x] | |
| `PKG_CONFIG_PATH` | `/pkgconfig` | pc files | [x] | |
- The lifecycle MUST separate each path with the OS path list separator (e.g., `:` on Linux).

| Env Variable | Layer Path | Contents | Build | Launch
|-------------------|--------------|------------------|-------|--------
| `PATH` | `/bin` | binaries | [x] | [x]
| `LD_LIBRARY_PATH` | `/lib` | shared libraries | [x] | [x]
| `LIBRARY_PATH` | `/lib` | static libraries | [x] |
| `CPATH` | `/include` | header files | [x] |
| `PKG_CONFIG_PATH` | `/pkgconfig` | pc files | [x] |

### Provided by the Platform

Expand Down Expand Up @@ -754,7 +748,7 @@ For each process, the buildpack:

- MUST specify a `type` that is not identical to other process types provided by the same buildpack.
- MUST specify a `command` that is either:
- A command sequence that is valid when executed using the shell, if `args` is not specified.
- A command sequence that is valid when executed using the Bash 3+ shell, if `args` is not specified.
- A path to an executable or the file name of an executable in `$PATH`, if `args` is a list with zero or more elements.
- MAY specify an `args` list to be passed directly to the specified executable.
- MAY specify a `direct` boolean that bypasses the shell.
Expand Down