From 83e44eddef8bab8ca0964a97b879185c797a9b0f Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Wed, 17 May 2023 15:01:24 -0700 Subject: [PATCH] Revert "remove custom source dir in packages.txt" This reverts commit 25e9df48cadab7ba1d2bcf4e6fec02f5f108cbc8. --- CONTRIBUTING.md | 33 +-------------------------------- Makefile | 21 ++++++++++++++++----- bazel-5 | 1 - bazel-6 | 1 - mariadb-10.11 | 1 - mariadb-10.6 | 1 - packages.txt | 23 +++++++++++++---------- postgresql-11 | 1 - postgresql-12 | 1 - postgresql-13 | 1 - postgresql-14 | 1 - postgresql-15 | 1 - 12 files changed, 30 insertions(+), 56 deletions(-) delete mode 120000 bazel-5 delete mode 120000 bazel-6 delete mode 120000 mariadb-10.11 delete mode 120000 mariadb-10.6 delete mode 120000 postgresql-11 delete mode 120000 postgresql-12 delete mode 120000 postgresql-13 delete mode 120000 postgresql-14 delete mode 120000 postgresql-15 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 16c32ffa958..da2455c1e67 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,37 +52,6 @@ Your build packages should be found in the generated `./packages` directory. - `melange` CLI has a command `bump` to make it easier. More details are [available here](https://github.com/chainguard-dev/melange/blob/f52b622351657fd9ccdb7e3bfb124caef61ad651/NEWS.md). -## Source Directory - -If your package needs some additional files to include in the package, you can create a folder with the -same name as the package.yaml and put them there. For example, if you have a file named `foo.yaml`, you can -create a folder named `foo/` and put all the files you want to include in the package there. - -If the directory does not exist, it will _not_ be an error; it simply will be ignored. - -You should **not** put additional source files for your package in this root directory, as it -will pollute it for source from too many packages. - -For example, see [busybox.yaml](./busybox.yaml) and the source directory [busybox/](./busybox/). - -If multiple packages share a source, create a single directory and symlink the others to the source. -The name of the symlink must be the name of the package in `.yaml`. For example, -all of the following files share the same source directory, [postgres/](./postgres/): - -* [postgres-11.yaml](./postgres-11.yaml) -* [postgres-12.yaml](./postgres-12.yaml) -* [postgres-13.yaml](./postgres-13.yaml) -* [postgres-14.yaml](./postgres-14.yaml) -* [postgres-15.yaml](./postgres-15.yaml) - -And all have symlinks: - -* `postgres-11` -> `postgres/` -* `postgres-12` -> `postgres/` -* `postgres-13` -> `postgres/` -* `postgres-14` -> `postgres/` -* `postgres-15` -> `postgres/` - ## Some tips - melange has a few built-in pipelines. You can see their source code [in the melange repository](https://github.com/chainguard-dev/melange/tree/main/pkg/build/pipelines). @@ -97,7 +66,7 @@ And all have symlinks: gsutil -m rsync -r gs://wolfi-production-registry-destination/os/ ./packages ``` -- If you don't want to install `gsutil` locally, you can use this image `gcr.io/google.com/cloudsdktool/google-cloud-cli:slim` which is the official SDK image from GCP and already include `gsutil` in there. +- If you dont want to install `gsutil` locally, you can use this image `gcr.io/google.com/cloudsdktool/google-cloud-cli:slim` which is the official SDK image from GCP and already include `gsutil` in there. - When deciding how to add `update:` configuration see the [update docs](./docs/UPDATES.md) diff --git a/Makefile b/Makefile index a72906f1bc9..92a04965764 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,9 @@ MELANGE_OPTS += -r ${WOLFI_PROD} endif define build-package -$(eval pkgname = $(1)) -$(eval sourcedir = $(pkgname)) +$(eval pkgname = $(call comma-split,$(1),1)) +$(eval sourcedir = $(call comma-split,$(1),2)) +$(eval sourcedir = $(or $(sourcedir),$(pkgname))) $(eval pkgfullname = $(shell $(MELANGE) package-version $(pkgname).yaml)) $(eval pkgtarget = $(TARGETDIR)/$(pkgfullname).apk) packages/$(pkgname): $(pkgtarget) @@ -46,6 +47,9 @@ endef # The list of packages to be built. The order matters. # At some point, when ready, this should be replaced with `wolfictl text -t name .` +# non-standard source directories are provided by adding them separated by a comma, +# e.g. +# postgres-11,postgres PKGLIST ?= $(shell cat packages.txt | grep -v '^\#' ) all: ${KEY} .build-packages @@ -58,14 +62,21 @@ clean: .PHONY: list list-yaml list: - $(info $(PKGLIST)) + $(info $(PKGNAMELIST)) @printf '' list-yaml: - $(info $(addsuffix .yaml,$(PKGLIST))) + $(info $(addsuffix .yaml,$(PKGNAMELIST))) @printf '' -PACKAGES := $(addprefix packages/,$(PKGLIST)) +comma := , +comma-split = $(word $2,$(subst ${comma}, ,$1)) + +# PKGLIST includes the optional directory e.g. mariadb-10.6,mariadb +# PKGNAMELIST is only the names +PKGNAMELIST = $(foreach F,$(PKGLIST), $(firstword $(subst ${comma}, ,${F}))) + +PACKAGES := $(addprefix packages/,$(PKGNAMELIST)) $(foreach pkg,$(PKGLIST),$(eval $(call build-package,$(pkg)))) diff --git a/bazel-5 b/bazel-5 deleted file mode 120000 index 7fd901bbdc8..00000000000 --- a/bazel-5 +++ /dev/null @@ -1 +0,0 @@ -bazel \ No newline at end of file diff --git a/bazel-6 b/bazel-6 deleted file mode 120000 index 7fd901bbdc8..00000000000 --- a/bazel-6 +++ /dev/null @@ -1 +0,0 @@ -bazel \ No newline at end of file diff --git a/mariadb-10.11 b/mariadb-10.11 deleted file mode 120000 index 45f92cdb790..00000000000 --- a/mariadb-10.11 +++ /dev/null @@ -1 +0,0 @@ -mariadb \ No newline at end of file diff --git a/mariadb-10.6 b/mariadb-10.6 deleted file mode 120000 index 45f92cdb790..00000000000 --- a/mariadb-10.6 +++ /dev/null @@ -1 +0,0 @@ -mariadb \ No newline at end of file diff --git a/packages.txt b/packages.txt index cb9e83688af..92cc5dd3c8c 100644 --- a/packages.txt +++ b/packages.txt @@ -1,5 +1,8 @@ # The list of packages to be built. The order matters. -# When ready, this should be replaced with `wolfictl text -t name .` +# At some point, when ready, this should be replaced with `wolfictl text -t name .` +# non-standard source directories are provided by adding them separated by a comma, +# e.g. +# postgres-11,postgres # lines beginning with # are ignored gmp mpfr @@ -187,11 +190,11 @@ libjpeg-turbo lcms2 su-exec llvm15 -postgresql-11 -postgresql-12 -postgresql-13 -postgresql-14 -postgresql-15 +postgresql-11,postgresql +postgresql-12,postgresql +postgresql-13,postgresql +postgresql-14,postgresql +postgresql-15,postgresql tzdata maven-stage0 maven @@ -231,8 +234,8 @@ composer yaml docker-credential-ecr-login pwgen -mariadb-10.6 -mariadb-10.11 +mariadb-10.6,mariadb +mariadb-10.11,mariadb wait-for-it argon2 haproxy @@ -611,8 +614,8 @@ openjdk-12 openjdk-13 openjdk-14 openjdk-17 -bazel-5 -bazel-6 +bazel-5,bazel +bazel-6,bazel envoy aws-efs-csi-driver prometheus-bind-exporter diff --git a/postgresql-11 b/postgresql-11 deleted file mode 120000 index 360e6d1a1f4..00000000000 --- a/postgresql-11 +++ /dev/null @@ -1 +0,0 @@ -postgresql \ No newline at end of file diff --git a/postgresql-12 b/postgresql-12 deleted file mode 120000 index 360e6d1a1f4..00000000000 --- a/postgresql-12 +++ /dev/null @@ -1 +0,0 @@ -postgresql \ No newline at end of file diff --git a/postgresql-13 b/postgresql-13 deleted file mode 120000 index 360e6d1a1f4..00000000000 --- a/postgresql-13 +++ /dev/null @@ -1 +0,0 @@ -postgresql \ No newline at end of file diff --git a/postgresql-14 b/postgresql-14 deleted file mode 120000 index 360e6d1a1f4..00000000000 --- a/postgresql-14 +++ /dev/null @@ -1 +0,0 @@ -postgresql \ No newline at end of file diff --git a/postgresql-15 b/postgresql-15 deleted file mode 120000 index 360e6d1a1f4..00000000000 --- a/postgresql-15 +++ /dev/null @@ -1 +0,0 @@ -postgresql \ No newline at end of file