-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #382 from cbgbt/attribution-docs
attribution: upload dependency attributions as part of GitHub releases
- Loading branch information
Showing
6 changed files
with
153 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/target/ | ||
.ignore/ | ||
twoliter-attributions.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[clarify.bstr] | ||
version = "=1" | ||
expression = "(MIT OR Apache-2.0) AND Unicode-DFS-2016" | ||
license-files = [ | ||
{ path = "COPYING", hash = 0x278afbcf }, | ||
{ path = "LICENSE-APACHE", hash = 0x24b54f4b }, | ||
{ path = "LICENSE-MIT", hash = 0x462dee44 }, | ||
{ path = "src/unicode/data/LICENSE-UNICODE", hash = 0x70f7339 }, | ||
] | ||
|
||
[clarify.petgraph] | ||
expression = "MIT OR Apache-2.0" | ||
license-files = [ | ||
{ path = "LICENSE-APACHE", hash = 0x24b54f4b }, | ||
{ path = "LICENSE-MIT", hash = 0xc97e30bd }, | ||
] | ||
skip-files = [ | ||
# this license applies to graphical assets which we do not distribute | ||
"assets/LICENSE.md", | ||
] | ||
|
||
[clarify.regex-syntax] | ||
expression = "(MIT OR Apache-2.0) AND Unicode-DFS-2016" | ||
license-files = [ | ||
{ path = "LICENSE-APACHE", hash = 0x24b54f4b }, | ||
{ path = "LICENSE-MIT", hash = 0xb755395b }, | ||
{ path = "src/unicode_tables/LICENSE-UNICODE", hash = 0xa7f28b93 }, | ||
] | ||
|
||
[clarify.typenum] | ||
expression = "MIT OR Apache-2.0" | ||
license-files = [ | ||
{ path = "LICENSE-APACHE", hash = 0x91d5a0a7 }, | ||
{ path = "LICENSE-MIT", hash = 0xb9f15462 }, | ||
{ path = "LICENSE", hash = 0xa4618a29 }, | ||
] | ||
|
||
[clarify.unicode-ident] | ||
expression = "(MIT OR Apache-2.0) AND Unicode-DFS-2016" | ||
license-files = [ | ||
{ path = "LICENSE-APACHE", hash = 0xb5518783 }, | ||
{ path = "LICENSE-MIT", hash = 0x386ca1bc }, | ||
{ path = "LICENSE-UNICODE", hash = 0x9698cbbe }, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This dockerfile installs rustup into the Bottlerocket SDK so that attributions can be generated | ||
# using the same nightly compiler as is used to build twoliter. | ||
ARG BOTTLEROCKET_SDK_IMAGE | ||
FROM ${BOTTLEROCKET_SDK_IMAGE} | ||
|
||
# Rustup is installed using the given user, allowing the container to write the results to a | ||
# mounted filesystem to which the given user has write access. | ||
ARG UID | ||
ARG GID | ||
|
||
USER root | ||
|
||
RUN mkdir /home/attribution-creator \ | ||
&& chown ${UID}:${GID} /home/attribution-creator | ||
|
||
USER ${UID}:${GID} | ||
RUN export HOME=/home/attribution-creator \ | ||
&& curl --proto '=https' --tlsv1.2 -sS 'https://sh.rustup.rs' \ | ||
| sh -s -- -q --default-toolchain none -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# Generates attributions for dependencies of Twoliter | ||
# Meant to be run from Bottlerocket's SDK container: | ||
# https://github.com/bottlerocket-os/bottlerocket-sdk | ||
|
||
# See the "attribution" target in the project Makefile. | ||
|
||
set -eo pipefail | ||
|
||
LICENSEDIR=/tmp/twoliter-attributions | ||
|
||
# Use the toolchain installed via `Dockerfile.attribution` | ||
export HOME="/home/attribution-creator" | ||
source ~/.cargo/env | ||
|
||
# Source code is mounted to /src | ||
# rustup will automatically use the toolchain in rust-toolchain.toml | ||
cd /src | ||
|
||
# =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= | ||
echo "Clarifying crate dependency licenses..." | ||
/usr/libexec/tools/bottlerocket-license-scan \ | ||
--clarify /src/clarify.toml \ | ||
--spdx-data /usr/libexec/tools/spdx-data \ | ||
--out-dir ${LICENSEDIR}/vendor \ | ||
cargo --locked Cargo.toml | ||
|
||
# =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= | ||
# cargo-make (we currently use cargo-make from the SDK, but will ship it in Twoliter in the future) | ||
echo "Clarifying bottlerocket-sdk & dependency licenses..." | ||
mkdir -p ${LICENSEDIR}/bottlerocket-sdk/ | ||
cp -r /usr/share/licenses/cargo-make \ | ||
${LICENSEDIR}/bottlerocket-sdk/ | ||
|
||
# =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= | ||
# Twoliter licenses | ||
cp /src/COPYRIGHT /src/LICENSE-MIT /src/LICENSE-APACHE \ | ||
${LICENSEDIR}/ | ||
|
||
pushd $(dirname ${LICENSEDIR}) | ||
tar czf /src/twoliter-attributions.tar.gz $(basename ${LICENSEDIR}) | ||
popd |