Makefile: Add the ability to create a source code release with all deps #104240
No reviewers
Labels
No Label
Good First Issue
Priority
High
Priority
Low
Priority
Normal
Status
Archived
Status
Confirmed
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Job Type
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: studio/flamenco#104240
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ZedDB/flamenco:vendor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds two new recipes:
"only-deps": Download all the deps required to build the project offline
"release-package-source": Create a .tar.gz source release with all deps included
I'm not sure if you want this to be part of the "publish-release-packages" recipe, so I didn't touch that.
Perhaps we should also rename
with-deps
to something else?oapi-codegen
is already pulled in viago.mod
.It seems to me like all usage of
mockgen
is commented out.The
hugo
dep also seem to only be for theproject-website
recipe?Since this is 'vendoring', and the Go command used is also
go mod vendor
, I thinkmake vendor
would be a better name.👍
Yeah, everything that's part of 'the release' should be built by that command.
Check the
//go:generate
lines in*.go
to find where it's used.It is, indeed.
850464a927
toc3a133983c
I discovered that mockgen is already pulled in by
mock
ingo.mod
. So I moved the last dep to theproject-website
target as it is not used to build the default flamenco package (manager, worker, and addon).I also noticed that google has dropped mockgen, but Uber as taken over the maintance, so the package url should probably updated in the future. (https://github.com/golang/mock)
c3a133983c
to7bcce79085
Thinking about this again, this is not the right move.
hugo
is also used while working on the website, and that makefile rule is only used to publish the website. This means that you should be able to usehugo
before running that rule.👍
There are some issues with the generated source package:
flamenco-3.3-alpha0-src.tar.gz
should have a directory likeflamenco-3.3-alpha0
, which then contains all the current contents.web/app/package-cache
directory is empty.vendor
directory in the working directory. This makes the Go tooling behave differently (see go build docs about the-mod=vendor
option), and gets in the way of future development.@ -54,2 +49,3 @@
go mod vendor
application: webapp flamenco-manager flamenco-worker
application: webapp-deps flamenco-manager flamenco-worker
Shouldn't
webapp-deps
be a dependency of thewebapp-static
rule?That is correct.
It will not work otherwise.
I've updated the make targets to reflect this.
@ -356,0 +359,4 @@
rm -f dist/${RELEASE_SOURCE_ARCHIVE_GZ}
git archive -o dist/${RELEASE_SOURCE_ARCHIVE} HEAD
tar -rvf dist/${RELEASE_SOURCE_ARCHIVE} vendor web/app/package-cache
gzip dist/${RELEASE_SOURCE_ARCHIVE}
What's the reason to use two separate commands, and keep two separate files, for the
.tar
and the.tar.gz
?I think it's better to switch from GZip to a more modern compression standard, and to compress in one go, with
tar -rvJf
and setRELEASE_SOURCE_ARCHIVE := flamenco-${VERSION}-src.tar.xz
The reason is that you can not append un-tracked folders with
git archive
.So I do this in two steps so that we only create a source archive will all tracked files plus the two vendoring folders.
However the
gzip
command will not keep the original.tar
file so you will only end up with one.tar.gz
file.The reason I used .tar.gz is that it seems to be the default source archive format on all big git file hosts (github, gitlab, and gitea).
Of course we can change this to xz if you wish.
There doesn't seem to be a nice way to check if the user has the
vendor
directory already and not remove it after running that recipe.However if you want to unconditionally remove it after packaging is done, we can do that.
I've created a new standalone rule for it so if one wants to install the dependencies to work on the project website, it is now easy to do so.
IMO changing this is out of scope for this PR. In current
main
there is just onemake
command to use to install all the dependencies (except for Go & NodeJS themselves). This ease of getting started with development is important, and having to figure out which part of the work requires which initialisation steps goes against that.Having a way to package the dependencies (as per the PR title) shouldn't impact how people are onboarded into the project.
Now I'm confused, these changes doesn't impact how people are on-boarded or makes them jump through hoops to figure out which target the need to make.
This instead simplifies it so that they don't even have to run any prerequisite make targets as now everything properly depends on the targets they need. So I would strongly argue that this makes onboarding and building the the whole project or individual parts much easier.
This wasn't the case before, at least for the website. Before the user must have known to run the
with-deps
otherwise building theproject-website
target would fail. Now they can just runmake project-website
and everything it needs deps wise is pulled in automatically.You moved the installation of Hugo from the regular dependencies to the rule that deploys the website to the Blender infrastructure.
Anybody working on the documentation will need to be able to self-host the website, and thus be able to run Hugo. Not just the two people on the planet who deploy the actual website to the production server.
e3e6283296
tobdc63b3057
We talked a bit offline and made sure we were on the same page on all points.
I've forced pushed the rebased patches and dropped the latest change that wasn't what we actually wanted to change.
The way the Makefile is structured now will always run
yarn install --force
, also for situations where you don't want to build a source package. I don't think that's the right approach. Regular builds should be as fast as possible, as build time has a direct impact on iteration speed of developers.The removal of the
with-deps
target means that the developer documentation is no longer correct. This should be addressed in this commit as well.@ -96,2 +93,2 @@
webapp:
yarn --cwd web/app install
webapp-deps:
# We have to use --force here to ensure that the offline package cache is up to date with no missing files
This comment should be hidden from the regular output. Right now it's actually shown when running
make webapp-deps
(and any other target that runs this target).@ -332,2 +330,4 @@
RELEASE_PACKAGE_SHAFILE := flamenco-${VERSION}.sha256
RELEASE_SOURCE_ARCHIVE := flamenco-${VERSION}-src.tar
RELEASE_SOURCE_ARCHIVE_GZ := flamenco-${VERSION}-src.tar.gz
I think it's better to define
RELEASE_SOURCE_ARCHIVE_GZ
as${RELEASE_SOURCE_ARCHIVE}.gz
@ -380,0 +383,4 @@
mkdir -p dist
rm -f dist/${RELEASE_SOURCE_ARCHIVE_GZ}
git archive --prefix=flamenco-${VERSION}/ -o dist/${RELEASE_SOURCE_ARCHIVE} HEAD
tar --transform 's,^,flamenco-${VERSION}/,' -rvf dist/${RELEASE_SOURCE_ARCHIVE} vendor web/app/package-cache
What's the reason to use
gzip
separately? Why not just usetar z
?@ -0,0 +1,2 @@
yarn-offline-mirror "./package-cache"
yarn-offline-mirror-pruning true
Instead of always caching the packages, put this into a special file
.yarnrc-source-pkg
or something, and specify that when runningyarn install
for grabbing the sources. That way the regular builds don't have to bother with this package cache.Checkout
From your project repository, check out a new branch and test the changes.