Created attachment 123481 [details] Generate/subst metadata in the makefile With this patch, one must always invoke make with: make ARCH=${arch} VERSION=${version} ...and the architecture and version (of base platform/sdk it produces) is not hard coded into the makefile.
I don't agree with having to specify VERSION. It is part of the state of the sources, not something you must know and specify from some external source. For instance, current master must be 1.5 and the 1.4 branch must have "1.4". If you let the user specify it you only risk getting things wrong. I recently added "xdg-app --default-arch". We should probably use the value of this as the default value for arch. Will the _FORCE thing really get the order right? Don't we need depencencies from all on the various metadata files?
(In reply to Alexander Larsson from comment #1) > I don't agree with having to specify VERSION. It is part of the state of the > sources, not something you must know and specify from some external source. > For instance, current master must be 1.5 and the 1.4 branch must have "1.4". > If you let the user specify it you only risk getting things wrong. > > I recently added "xdg-app --default-arch". We should probably use the value > of this as the default value for arch. Sure I agree, lets just hard code the version in the top level makefile here ? > Will the _FORCE thing really get the order right? Don't we need depencencies > from all on the various metadata files? Yes it does, metadata.platform is required when it's time to build ${FILE_REF_PLATFORM}, and as metadata.platform is one of the targets in ${METADATA_FILES}; it will be rebuilt unconditionally due to it's dependency on metadata_FORCE.
Created attachment 123528 [details] [review] Generate/subst metadata in the makefile [version 2] Here is another iteration of the said patch which does: a.) Keep the VERSION defined in one place in the toplevel Makefile b.) Defaults to `xdg-app --default-arch` for the ARCH, but can be overridden with make ARCH=
(In reply to Tristan Van Berkom from comment #2) > (In reply to Alexander Larsson from comment #1) > > Will the _FORCE thing really get the order right? Don't we need depencencies > > from all on the various metadata files? > > Yes it does, metadata.platform is required when it's time to build > ${FILE_REF_PLATFORM}, and as metadata.platform is one of the targets in > ${METADATA_FILES}; it will be rebuilt unconditionally due to it's dependency > on metadata_FORCE. This seems bad. The automatic build systems I've set up depends on "make" being a no-op if nothing changed, but with this setup the images will be rebuilt every time you run "make". Most stuff is cached, so the images will be mostly the same sans a time-stamp or two, but the difference will trigger a rebuild of the next runtime layer, etc. So, I think the proper solution is to have the image make rules depend on metadata.sdk.in, and then do the seding inside the build rule for the image.
Created attachment 123628 [details] [review] Generate metadata in the makefile [version 3] This patch substitutes the metadata every time it's needed with a canned sequence. Note that with this patch, the rename of metadata.sdk -> metadata.sdk.in is not really necessary - but I kept it in because: a.) Since it contains obvious substitutions it seems natural to use the .in suffix b.) Because of how flatpak-builder sets up it's directories and manages it's metadata, we will have to use intermediate substituted metadata files anyway there, so it seems alright to repeat that here.
Created attachment 123632 [details] [review] Generate metadata in the makefile [version 4] Oops, last patch forgot to change xdg-app -> flatpak in one place.
pushed to master and 1.4
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.