~xvilka

Shanghai, China

https://rizin.re

Reverse engineer, Rizin RE framework core team member, Rustacean and OCamler, foreign languages fanatic.


#51 cmake-config.h.in: error extraneous characters on #cmakedefine line 21 days ago

Comment by ~xvilka on ~lattis/muon

Yes, it seems that Meson should follow the Muon example here and be stricter.

#50 error in method compiler.sizeof() 24 days ago

Comment by ~xvilka on ~lattis/muon

Thank you!

#51 cmake-config.h.in: error extraneous characters on #cmakedefine line 24 days ago

Ticket created by ~xvilka on ~lattis/muon

info [libzip] sizeof off_t: -1
info [libzip] sizeof off_t: 8
info [libzip] sizeof size_t: 8
info [libzip] configuring '/home/xvilka/rizin/build/subprojects/libzip-1.7.3/config.h
/home/xvilka/rizin/subprojects/libzip-1.7.3/cmake-config.h.in:49:26: error extraneous characters on #cmakedefine line
 49 | #cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@
                               ^
/home/xvilka/rizin/subprojects/libzip-1.7.3/meson.build:115:12: error in function configure_file()
115 | config_h = configure_file(
                 ^
/home/xvilka/rizin/meson.build:568:17: error in function subproject()
568 |   libzip_proj = subproject('libzip', default_options: [
                      ^

Caused by this piece of code:

config_h = configure_file(
  input: 'cmake-config.h.in',
  output: 'config.h',
  configuration: conf_data,
  format: 'cmake@',
)

See the full file at https://github.com/rizinorg/rizin/blob/dev/subprojects/packagefiles/libzip-1.7.3/meson.build

Note, I don't think it's related to the cmake module (#24), it was working in Meson even before we started to use the cmake module: https://github.com/rizinorg/rizin/commit/9349b2f3ed1a03e1e9b6b9a58e7e04d3baf9ddb8

#50 error in method compiler.sizeof() 26 days ago

Ticket created by ~xvilka on ~lattis/muon

Same files work with Meson without any problem

/home/xvilka/rizin/subprojects/libzip-1.7.3/meson.build:83:11: error in method compiler.sizeof()
 83 |   sz = cc.sizeof(type)
                ^
/home/xvilka/rizin/meson.build:568:17: error in function subproject()
568 |   libzip_proj = subproject('libzip', default_options: [
                      ^

This is the piece of code that triggers this error:

foreach type : types
  sz = cc.sizeof(type)
  if sz == -1
    # Windows requires the header to find off_t
    sz = cc.sizeof(type, prefix: '#include <sys/types.h>')
  endif
  conf_data.set('SIZEOF_@0@'.format(type.underscorify().to_upper()), sz)
endforeach

The original file is located at https://github.com/rizinorg/rizin/blob/dev/subprojects/packagefiles/libzip-1.7.3/meson.build

#38 error no compiler defined for language c 4 months ago

Comment by ~xvilka on ~lattis/muon

Good point. Thank you for the detailed explanation! I agree that handling subprojects separately is a better approach.

#38 error no compiler defined for language c 4 months ago

Ticket created by ~xvilka on ~lattis/muon

If I remove those meson.add_dist_script() lines from the meson.build from Rizin, it processes everything fine, except this error at the end:

info writing rules for target 'liblz4.a'
info writing rules for custom target 'zip_err_str'
info writing rules for target 'liblibzip.a'
info writing rules for target 'libmpc.a'
error no compiler defined for language c

The error a bit strange, given it detected the compiler before just fine:

info detected compiler gcc 11.2.1 (cc)
info configuring 'rizin', version: v0.4.0-git
message: rizin lib version: 0.4.0-git 
info found library 'dl' at '/usr/lib64/libdl.a'
info dependency threads found
info found library 'util' at '/usr/lib64/libutil.a'
info found library 'm' at '/usr/lib64/libm.so'
info '--std=gnu99' supported: ?[32mYES?[0m
info '-Werror=sizeof-pointer-memaccess' supported: ?[32mYES?[0m

info subproject: capstone-bundled
info detected compiler gcc 11.2.1 (cc)
info configuring 'capstone', version: 4.0
info added target libcapstone.a

#37 Add support for `meson.add_dist_script()` function. 4 months ago

Ticket created by ~xvilka on ~lattis/muon

/home/xvilka/rizin/rizin_copy/meson.build:679:9: error: function add_dist_script not found
679 |   meson.add_dist_script(meson.source_root() / dist_script)
              ^

This is how it's used in Rizin:

dist_script = 'sys/meson_dist_script.py'
if meson.version().version_compare('<0.57.0')
  meson.add_dist_script(meson.source_root() / dist_script)
else
  meson.add_dist_script(files(dist_script))
endif

See https://github.com/rizinorg/rizin/blob/dev/meson.build#L677

#36 Cannot parse the version of the subproject. 4 months ago

Ticket created by ~xvilka on ~lattis/muon

/home/xvilka/rizin/rizin_copy/librz/asm/meson.build:54:47: error: unable to parse 'unknown'
 54 | if capstone_dep.version().split('.')[0].to_int() > 4
                                                    ^
/home/xvilka/rizin/rizin_copy/librz/asm/meson.build:54:41: error: in method string.to_int
 54 | if capstone_dep.version().split('.')[0].to_int() > 4
                                              ^
/home/xvilka/rizin/rizin_copy/librz/meson.build:23:1: error: in function subdir
 23 | subdir('asm')
      ^
/home/xvilka/rizin/rizin_copy/meson.build:656:1: error: in function subdir
656 | subdir('librz')
      ^

On the following piece of code:

if capstone_dep.version().split('.')[0].to_int() > 4
  asm_plugins += 'riscv_cs'
endif

from https://github.com/rizinorg/rizin/blob/dev/librz/asm/meson.build

The capstone_dep is defined in the main meson file for the library: See https://github.com/rizinorg/rizin/blob/dev/meson.build#L237

In this run I used the capstone defined in capstone-bundled subproject:


[wrap-git]
url = https://github.com/rizinorg/capstone.git
revision = ed254c8a42b2fd6271cb66578440e5064356f6b5
patch_directory = capstone-bundled
directory = capstone-bundled

#31 error: function partial_dependency not found 4 months ago

Comment by ~xvilka on ~lattis/muon

It's implemented in https://git.sr.ht/~lattis/muon/commit/bc8152b and works on my project. Thank you!

#35 Cannot find subproject dependency 4 months ago

Ticket created by ~xvilka on ~lattis/muon

The exact cause of this is unclear from the error messages. It works with the Meson though.

warn dependency rzbochs not found
/home/user/rizin_copy/librz/io/meson.build:95:14: error: required dependency not found
 95 |   dependency('rzbochs'),
                   ^
/home/user/rizin_copy/librz/io/meson.build:95:3: error: in function dependency
 95 |   dependency('rzbochs'),
        ^
/home/user/rizin_copy/librz/meson.build:11:1: error: in function subdir
 11 | subdir('io')
      ^
/home/user/rizin_copy/meson.build:651:1: error: in function subdir
651 | subdir('librz')
      ^

Here those dependencies are used: https://github.com/rizinorg/rizin/blob/dev/librz/io/meson.build#L94 And here they are defined https://github.com/rizinorg/rizin/blob/dev/subprojects/rzbochs/meson.build

Could be the meson.override_dependency('rzbochs', bochs_dep), I suspect.