Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while compiling on Debian bullseye (with backported meson) #66

Closed
tukanos opened this issue Feb 9, 2022 · 7 comments
Closed

Error while compiling on Debian bullseye (with backported meson) #66

tukanos opened this issue Feb 9, 2022 · 7 comments
Labels
question Further information is requested

Comments

@tukanos
Copy link

tukanos commented Feb 9, 2022

Environment:
meson 0.61.1
cargo 1.46.0

compile log:

tukan@magnetron:~/Application/build/fjp$ meson setup --buildtype=release _builddir
The Meson build system
Version: 0.61.1
Source dir: /home/tukan/Application/build/fjp
Build dir: /home/tukan/Application/build/fjp/_builddir
Build type: native build
Project name: fjp
Project version: 0.3.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program cargo found: YES (/usr/bin/cargo)
Build targets in project: 1

fjp 0.3.0

  User defined options
    buildtype: release

Found ninja-1.10.1 at /usr/bin/ninja
tukan@magnetron:~/Application/build/fjp$ meson configure _builddir -Dmanpage=true
tukan@magnetron:~/Application/build/fjp$ meson compile -C _builddir
ninja: Entering directory `/home/tukan/Application/build/fjp/_builddir'
[0/1] Regenerating build files.
The Meson build system
Version: 0.61.1
Source dir: /home/tukan/Application/build/fjp
Build dir: /home/tukan/Application/build/fjp/_builddir
Build type: native build
Project name: fjp
Project version: 0.3.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program cargo found: YES (/usr/bin/cargo)
Configuring fjp.1.rst using configuration
Program /home/tukan/Application/build/fjp/build-aux/manpage.sh found: YES (/bin/bash /home/tukan/Application/build/fjp/build-aux/manpage.sh)
Build targets in project: 3

fjp 0.3.0

  User defined options
    backend  : ninja
    buildtype: release
    manpage  : true

Found ninja-1.10.1 at /usr/bin/ninja
[0/3] Generating src/cargo-build with a custom command (wrapped by meson to set env)
    Updating crates.io index
  Downloaded termcolor v1.1.2
  Downloaded vec_map v0.8.2
  Downloaded addr2line v0.17.0
  Downloaded atty v0.2.14
  Downloaded quote v1.0.10
  Downloaded cc v1.0.72
  Downloaded clap v2.33.3
  Downloaded unicode-width v0.1.9
  Downloaded thiserror-impl v1.0.30
  Downloaded bitflags v1.3.2
  Downloaded term_size v0.3.2
  Downloaded thiserror v1.0.30
  Downloaded proc-macro2 v1.0.32
  Downloaded backtrace v0.3.63
  Downloaded env_logger v0.9.0
  Downloaded memchr v2.4.1
  Downloaded nix v0.23.0
  Downloaded object v0.27.1
  Downloaded syn v1.0.81
  Downloaded yaml-rust v0.3.5
  Downloaded anyhow v1.0.48
  Downloaded color-backtrace v0.5.1
  Downloaded cfg-if v1.0.0
  Downloaded miniz_oxide v0.4.4
  Downloaded gimli v0.26.1
  Downloaded strsim v0.8.0
  Downloaded unicode-xid v0.2.2
  Downloaded memoffset v0.6.4
  Downloaded lazy_static v1.4.0
  Downloaded textwrap v0.11.0
  Downloaded libc v0.2.108
  Downloaded ansi_term v0.11.0
  Downloaded adler v1.0.2
  Downloaded rustc-demangle v0.1.21
  Downloaded log v0.4.14
  Downloaded autocfg v1.0.1
  Downloaded 36 crates (2.9 MB) in 0.68s
   Compiling libc v0.2.108
   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.32
   Compiling unicode-xid v0.2.2
   Compiling memchr v2.4.1
   Compiling cfg-if v1.0.0
   Compiling syn v1.0.81
   Compiling cc v1.0.72
   Compiling unicode-width v0.1.9
   Compiling bitflags v1.3.2
   Compiling strsim v0.8.0
   Compiling gimli v0.26.1
   Compiling ansi_term v0.11.0
   Compiling adler v1.0.2
   Compiling yaml-rust v0.3.5
   Compiling vec_map v0.8.2
   Compiling log v0.4.14
   Compiling anyhow v1.0.48
   Compiling rustc-demangle v0.1.21
   Compiling termcolor v1.1.2
   Compiling lazy_static v1.4.0
   Compiling miniz_oxide v0.4.4
   Compiling memoffset v0.6.4
   Compiling object v0.27.1
   Compiling quote v1.0.10
   Compiling addr2line v0.17.0
   Compiling atty v0.2.14
   Compiling term_size v0.3.2
   Compiling env_logger v0.9.0
   Compiling textwrap v0.11.0
   Compiling nix v0.23.0
   Compiling clap v2.33.3
   Compiling backtrace v0.3.63
   Compiling color-backtrace v0.5.1
   Compiling thiserror-impl v1.0.30
   Compiling macros v0.3.0 (/home/tukan/Application/build/fjp/macros)
   Compiling fjp v0.3.0 (/home/tukan/Application/build/fjp)
   Compiling thiserror v1.0.30
error[E0658]: use of unstable library feature 'str_split_once': newly added
   --> src/profile_stream.rs:467:18
    |
467 |                 .split_once(',')
    |                  ^^^^^^^^^^
    |
    = note: see issue #74773 <https://github.com/rust-lang/rust/issues/74773> for more information

error[E0658]: use of unstable library feature 'str_split_once': newly added
   --> src/profile_stream.rs:502:18
    |
502 |                 .split_once('=')
    |                  ^^^^^^^^^^
    |
    = note: see issue #74773 <https://github.com/rust-lang/rust/issues/74773> for more information

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `fjp`.

To learn more, run the command again with --verbose.
while executing ['/usr/bin/cargo', 'build', '--manifest-path=/home/tukan/Application/build/fjp/Cargo.toml', '--release', '--features=color-backtrac
e']
[1/3] Generating man/manpage with a custom command
FAILED: man/fjp.1.gz
/bin/bash /home/tukan/Application/build/fjp/build-aux/manpage.sh man man/fjp.1.rst man/fjp.1.gz
Could not find rst2man.
[2/3] Generating man/manpage-html with a custom command
FAILED: man/fjp.1.html5
/bin/bash /home/tukan/Application/build/fjp/build-aux/manpage.sh html man/fjp.1.rst man/fjp.1.html5
Could not find rst2html5.
FAILED: src/fjp
/usr/bin/meson --internal exe --unpickle /home/tukan/Application/build/fjp/_builddir/meson-private/meson_exe_cargo_bafa7730a106b8cdd905211c85018cc1
2b52f501.dat
ninja: build stopped: subcommand failed.
tukan@magnetron:~/Application/build/fjp$
@rusty-snake
Copy link
Owner

MSRV: 1.52

Update your compiler.

@tukanos
Copy link
Author

tukanos commented Feb 9, 2022

Thank you for your quick reply!

I have updated the compiler to: rustc 1.58.1 (db9d1b20b 2022-01-20) and the compilation succeeded.

Only errors that are left are the man pages errors. How should I deal with those?

[1/3] Generating man/manpage with a custom command
FAILED: man/fjp.1.gz 
/bin/bash /home/tukan/Application/build/fjp/build-aux/manpage.sh man man/fjp.1.rst man/fjp.1.gz
Could not find rst2man.
[2/3] Generating man/manpage-html with a custom command
FAILED: man/fjp.1.html5 
/bin/bash /home/tukan/Application/build/fjp/build-aux/manpage.sh html man/fjp.1.rst man/fjp.1.html5
Could not find rst2html5.
ninja: build stopped: subcommand failed.

@rusty-snake
Copy link
Owner

If you don't need them, disable them otherwise follow the README:

docutils and Pygments are required too if you want to build the manpage.

@tukanos
Copy link
Author

tukanos commented Feb 9, 2022

Ah I, missed that part in the README. Thank you!

@rusty-snake
Copy link
Owner

FYI 7f80847

@rusty-snake rusty-snake added the question Further information is requested label Feb 9, 2022
@eli-schwartz
Copy link

 cargo = find_program('cargo', fs.expanduser('~/.cargo/bin/cargo'))
+cargo_version = run_command(cargo, '-V', check: true).stdout().split()[1]
+assert(cargo_version.version_compare('>=1.56'))

I would like to recommend the following instead:

cargo = find_program('cargo', fs.expanduser('~/.cargo/bin/cargo'), version: '>=1.56')

Meson will then internally run cargo --version, extract the version, report the version found, for example:

Program cargo found: YES 1.58.0 (/usr/bin/cargo)

And report more informative errors, such as potentially (bumping the version prospectively):

Program cargo found: NO found 1.58.0 but need: '>=1.59' (/usr/bin/cargo)

meson.build:5:0: ERROR: Invalid version of program, need 'cargo' ['>=1.59'] found '1.58.0'.

Your current method instead looks like this:

Program cargo found: YES (/usr/bin/cargo)

meson.build:7:0: ERROR: Assert failed: cargo_version.version_compare('>=1.59')

That assert is not really the best way to communicate with users.

rusty-snake added a commit that referenced this issue Feb 10, 2022
@rusty-snake
Copy link
Owner

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants