Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

synapse 1.68.0rc1 fails to build: environment variable SYNAPSE_RUST_DIGEST not defined #13851

Closed
tgurr opened this issue Sep 20, 2022 · 7 comments · Fixed by #13866
Closed

synapse 1.68.0rc1 fails to build: environment variable SYNAPSE_RUST_DIGEST not defined #13851

tgurr opened this issue Sep 20, 2022 · 7 comments · Fixed by #13866
Labels
O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Release-Blocker Must be resolved before making a release

Comments

@tgurr
Copy link

tgurr commented Sep 20, 2022

Description

Try to build synapse 1.68.0rc1 now forcing an included rust component build.

Steps to reproduce

Trying to build synapse 1.68.0rc1 I run into the following error:

   Compiling synapse v0.1.0 (/var/tmp/paludis/build/net-synapse-1.68.0rc1/work/matrix-synapse-1.68.0rc1/rust)
     Running `rustc --crate-name synapse --edition=2021 rust/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type cdylib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --crate-type cdylib -C metadata=71f8cac97d837ea8 --out-dir /var/tmp/paludis/build/net-synapse-1.68.0rc1/work/matrix-synapse-1.68.0rc1/target/release/deps -L dependency=/var/tmp/paludis/build/net-synapse-1.68.0rc1/work/matrix-synapse-1.68.0rc1/target/release/deps --extern pyo3=/var/tmp/paludis/build/net-synapse-1.68.0rc1/work/matrix-synapse-1.68.0rc1/target/release/deps/libpyo3-c4fa1009b364ab5a.rlib`
error: environment variable `SYNAPSE_RUST_DIGEST` not defined
 --> rust/src/lib.rs:8:5
  |
8 |     env!("SYNAPSE_RUST_DIGEST")
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `synapse` due to previous error

Caused by:
  process didn't exit successfully: `rustc --crate-name synapse --edition=2021 rust/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type cdylib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --crate-type cdylib -C metadata=71f8cac97d837ea8 --out-dir /var/tmp/paludis/build/net-synapse-1.68.0rc1/work/matrix-synapse-1.68.0rc1/target/release/deps -L dependency=/var/tmp/paludis/build/net-synapse-1.68.0rc1/work/matrix-synapse-1.68.0rc1/target/release/deps --extern pyo3=/var/tmp/paludis/build/net-synapse-1.68.0rc1/work/matrix-synapse-1.68.0rc1/target/release/deps/libpyo3-c4fa1009b364ab5a.rlib` (exit status: 1)

Complete build log: synapse-1.68.0rc1.log

Homeserver

Synapse Version

1.68.0rc1

Installation Method

Other (please mention below)

Platform

Source based package, Exherbo Linux.

Relevant log output

-

Anything else that would be useful to know?

No response

@erikjohnston
Copy link
Member

Hi, how exactly were you trying to build this? Was it checking out the git repository and doing poetry install, or some other method?

@erikjohnston
Copy link
Member

Also can you check:

  1. What version of rust are you using?
  2. Is there a file called rust/build.rs.
  3. Does manually running cargo check work?

@tgurr
Copy link
Author

tgurr commented Sep 21, 2022

Hi, how exactly were you trying to build this? Was it checking out the git repository and doing poetry install, or some other method?

Our "package": https://gitlab.exherbo.org/exherbo/net/-/blob/5857e1e1216058d2934ffce928f39d3378cb8f81/packages/net/synapse/synapse-1.68.0rc1.exheres-0 downloads the respective release tarball https://github.com/matrix-org/synapse/releases/download/v1.68.0rc1/matrix-synapse-1.68.0rc1.tar.gz and runs /usr/x86_64-pc-linux-gnu/bin/python3.10 -B setup.py build for build as can be seen in the synapse-1.68.0rc1.log posted in the initial report.

  1. What version of rust are you using?

currently we're on rust 1.61.0

  1. Is there a file called rust/build.rs

In the workdir? Not as far as I can see.

  1. Does manually running cargo check work?

Manually running cargo check in the build directory results in the same error about SYNAPSE_RUST_DIGEST not being defined though environment may differ between running things manually in the build dir and what the package manager runs in.

We already have cryptography (https://git.exherbo.org/python.git/tree/packages/dev-python/cryptography/cryptography-38.0.1.exheres-0) which is also a python package with a rust component building pretty much the same way and not hitting any problem like this.

@NickCao
Copy link

NickCao commented Sep 21, 2022

rust/build.rs is missing from the release tarball, I can reproduce this issue.

@erikjohnston
Copy link
Member

Argh, looks like I must have messed up the soruce manifest then. Should be an easy fix.

@erikjohnston erikjohnston added the X-Release-Blocker Must be resolved before making a release label Sep 21, 2022
@H-Shay H-Shay added S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience labels Sep 21, 2022
erikjohnston added a commit that referenced this issue Sep 22, 2022
DMRobertson pushed a commit that referenced this issue Sep 22, 2022
* Fix sdist to include rust build script

Fixes #13851

* Newsfile
@DMRobertson DMRobertson linked a pull request Sep 22, 2022 that will close this issue
@DMRobertson
Copy link
Contributor

This should be fixed for the final release by the PR above.

@tgurr
Copy link
Author

tgurr commented Sep 22, 2022

This should be fixed for the final release by the PR above.

Thanks! I can confirm things compile fine for me with the matrix-synapse-1.68.0rc1.tar.gz tarball included in the Sdist.zip from the build artifact at https://github.com/matrix-org/synapse/actions/runs/3104896512.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Release-Blocker Must be resolved before making a release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants