Fixes to docs and scripts for building seshat (#2733)

... because it took me all day to figure out.
This commit is contained in:
Richard van der Hoff
2025-12-08 11:52:24 +00:00
committed by GitHub
parent 8ca1f193e3
commit b9840c5801
4 changed files with 39 additions and 31 deletions

View File

@@ -52,7 +52,9 @@ If you only want to run the app locally and don't need to build packages, you ca
provide the `webapp` directory directly:
```
# Assuming you've checked out and built a copy of element-web in ../element-web
# Assuming you've checked out and built a copy of element-web in ../element-web.
# Note that you will not be able to `yarn build` after this, but `yarn start`
# will work fine.
ln -s ../element-web/webapp ./
```

View File

@@ -13,12 +13,35 @@ custom build of Element without installing the various build tools required.
The process is automated by [vector-im/element-builder](https://github.com/vector-im/element-builder)
when releasing.
## Use docker
If you are building for Linux, you can build the native modules with:
```
yarn docker:setup
yarn docker:install
INDOCKER_SQLCIPHER_BUNDLED=1 yarn docker:build:native
```
The above will build `matrix-seshat` in
`docker/node_modules/matrix-seshat`. You can then either run `yarn docker:build`
to build the app inside docker, or:
```
yarn --cwd docker/node_modules/matrix-seshat link
yarn link matrix-seshat
```
... and build the app with `yarn build` or run it with `yarn start`.
(See also https://github.com/element-hq/element-desktop#docker.)
## Building
Install the pre-requisites for your system:
- [Windows pre-requisites](https://github.com/vector-im/element-desktop/blob/develop/docs/windows-requirements.md)
- Linux: TODO
- Linux: TODO. Using the docker environment as above is recommended.
- OS X: TODO
Then optionally, [add seshat and dependencies to support search in E2E rooms](#adding-seshat-for-search-in-e2e-encrypted-rooms).
@@ -56,7 +79,8 @@ This is also needed to when pulling in changes to Seshat using `yarn link`.
Recompiling Seshat itself can be done like so:
yarn run electron-build-env -- --electron 6.1.1 -- neon build matrix-seshat --release
ELECTRON_VERSION=$(electron --version)
yarn run electron-build-env -- --electron ${ELECTRON_VERSION#v} -- neon build matrix-seshat --release
Please make sure to include all the `--` as well as the `--release` command line
switch at the end. Modify your electron version accordingly depending on the

View File

@@ -7,41 +7,17 @@ Please see LICENSE files in the repository root for full details.
*/
import path from "node:path";
import os from "node:os";
import fsProm from "node:fs/promises";
import type HakEnv from "./hakEnv.js";
import { type DependencyInfo } from "./dep.js";
export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const yarnrc = path.join(hakEnv.projectRoot, ".yarnrc");
// this is fairly terrible but it's reasonably clunky to either parse a yarnrc
// properly or get yarn to do it, so this will probably suffice for now.
// We just check to see if there is a local .yarnrc at all, and assume that
// if you've put one there yourself, you probably know what you're doing and
// we won't meddle with it.
// Also we do this for each module which is unnecessary, but meh.
try {
await fsProm.stat(yarnrc);
} catch {
await fsProm.writeFile(
yarnrc,
// XXX: 1. This must be absolute, as yarn will resolve link directories
// relative to the closest project root, which means when we run it
// in the dependency project, it will put the link directory in its
// own project folder rather than the main project.
// 2. The parser gets very confused by strings with colons in them
// (ie. Windows absolute paths) but strings in quotes get parsed as
// JSON so need to be valid JSON encoded strings (ie. have the
// backslashes escaped). JSON.stringify will add quotes and escape.
"--link-folder " + JSON.stringify(path.join(hakEnv.dotHakDir, "links")) + os.EOL,
);
}
await hakEnv.spawn("yarn", ["link"], {
const linkFolder = path.join(hakEnv.dotHakDir, "links");
await hakEnv.spawn("yarn", ["link", "--link-folder", linkFolder], {
cwd: moduleInfo.moduleOutDir,
});
await hakEnv.spawn("yarn", ["link", moduleInfo.name], {
await hakEnv.spawn("yarn", ["link", "--link-folder", linkFolder, moduleInfo.name], {
cwd: hakEnv.projectRoot,
});
}

View File

@@ -1,5 +1,9 @@
#!/bin/bash
set -e
cd $(dirname "$0")/..
IMAGE=${DOCKER_IMAGE_NAME:-"element-desktop-dockerbuild"}
docker inspect "$IMAGE" 2> /dev/null > /dev/null
@@ -8,6 +12,8 @@ if [ $? != 0 ]; then
exit 1
fi
mkdir -p docker/node_modules docker/.hak docker/.gnupg
# Taken from https://www.electron.build/multi-platform-build#docker
# Pass through any vars prefixed with INDOCKER_, removing the prefix
docker run --rm -ti \