matrix-org / matrix-org/matrix-analytics-events
Can't publish/build on Windows (easily)
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 14
- Forks
- 10
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 1
Description
It's difficult to set this project up on Windows, and npm interactions (particularly after https://github.com/matrix-org/matrix-analytics-events/pull/31 lands for publishing) are near-impossible.
The major points of concern are:
../schemas/*.jsondoesn't expand on Windows, so the OS tries to open a literal../schemas/*.jsonfile (which doesn't exist). This preventsnpm buildfrom working.- The npm scripts launch bash windows which might not expose a proper exit code when they fail, which won't necessarily fail the commands.
- The scripts are also shell scripts, which causes issues in general for non-bash-enabled hosts.
- A possible fix for this is to use the low-risk parts of
shelljs: https://github.com/matrix-org/matrix-rust-sdk-bindings/blob/72b8b7ef7b5bef72f4d88dc45a92088b3f3a6700/crates/matrix-sdk-crypto-nodejs/check-exists.js#L7
Workaround steps for publishing (post-#31) are:
- Use WSL
yarn installyarn build:ts(run the prepublish script manually)- Go back to the host
- Disable
prepublishOnlyby renaming it npm publish --access public
It's obviously not great to have to jump around between VMs to do a release though.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the npm scripts behind npm build and yarn build:ts, especially the prepublishOnly path, and trace how ../schemas/*.json and shell scripts are invoked on Windows. Reproduce the failure on Windows and inspect the publishing workaround. Done means build and publish commands work on Windows without manual script renaming or VM/WSL steps, with failures returning correct exit codes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, shell
- Domain
- build-system, developer-experience, operating-systems, release
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100