Unlike mattermost-server
, mattermost-webapp
fails to build if the webapp folder is not inside a git repository.
Download Mattermost server/webapp using the v4.8.0-rc1
Github releases.
Try to build Mattermost using those tarballs.
In v4.7.0
the build succeeded. v4.8.0-rc1
should behave similar.
Building the webapp fails (log):
$ cross-env NODE_ENV=production webpack --display-error-details --progress
fatal: Not a git repository (or any of the parent directories): .git
child_process.js:644
throw err;
^
Error: Command failed: git rev-parse HEAD
fatal: Not a git repository (or any of the parent directories): .git
Catch the error thrown by childprocess.execSync
(introduced by this pull request) and return an empty string. (Like BUILD_HASH = $(shell git rev-parse HEAD)
in mattermost-server/Makefile
.)
Thanks @SmartHoneybee,
I've asked one of our engineers to take a look and either they, or I, will post back here with feedback :)
@SmartHoneybee, can you elaborate on your workflow for modifying/building the source from the release vs. checking out the repository? You're right that this could be as simple as catching the error and returning an empty string, but just want to make sure we craft a holistic solution to other workflows.
@lieut-data, this is how I'm building Mattermost using your Github releases.
Thanks for the report. It's probably this line in the webpack.config.js that's causing the issue since we recently added it to show the web app's build hash in the About Mattermost modal.
I've filed a ticket in Jira here if you'd like to follow that, but in the mean time, you could have your script comment out that line from the webpack.config.js to have it build correctly.
Thanks @SmartHoneybee @lieut-data
I'll close off this issue here for now and we can track via the ticket that hmhealey
linked above 👍
Most helpful comment
Thanks for the report. It's probably this line in the webpack.config.js that's causing the issue since we recently added it to show the web app's build hash in the About Mattermost modal.
I've filed a ticket in Jira here if you'd like to follow that, but in the mean time, you could have your script comment out that line from the webpack.config.js to have it build correctly.