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

meson: fix build on NixOS #4428

Merged
merged 2 commits into from
Apr 6, 2024
Merged

Conversation

mihalicyn
Copy link
Member

@mihalicyn mihalicyn commented Apr 5, 2024

It was reported recently that on NixOS LXC fails to build with the following errors:

[135/139] Linking target src/lxc/cmd/lxc-monitord
FAILED: src/lxc/cmd/lxc-monitord
gcc  -o src/lxc/cmd/lxc-monitord src/lxc/cmd/lxc-monitord.p/lxc_monitord.c.o src/lxc/cmd/lxc-monitord.p/.._.._include_netns_ifaddrs.c.o -flto -Wl,--no-undefined -pie -Wl,--no-as-needed -Wl,--gc-sections -Wl,-z,relro -Wl,-z,now -fstack-protector -fstack-protector-strong -Wl,-fuse-ld=gold -Wl,--warn-common '-Wl,-rpath,$ORIGIN/../../..' -Wl,-rpath-link,/home/adam/git/lxc/build/ -Wl,--start-group src/lxc/liblxc.a liblxc.so.1.8.0 /nix/store/jnlxl2ry9y03vq4skhm26igfd84xwa93-dbus-1.14.10-lib/lib/libdbus-1.so -pthread /nix/store/iglb2fmla149fbprj6fb18swfls033q4-libseccomp-2.5.4-lib/lib/libseccomp.so /nix/store/5mfk83ikgk62gv0xj95xylnkf0f52chv-libselinux-3.3/lib/libselinux.so /nix/store/wp5c5sjlvm6nxavvs1prdnw5n41mgciq-libapparmor-3.1.6/lib/libapparmor.so /nix/store/c7rf6w8xvxc4423m9rsgq5nsqhknshvy-openssl-3.0.12/lib/libssl.so /nix/store/c7rf6w8xvxc4423m9rsgq5nsqhknshvy-openssl-3.0.12/lib/libcrypto.so /nix/store/lmj8lfkd8h448grf1nf92lsm5gm2fnf6-libcap-2.69-lib/lib/libcap.so -lutil -Wl,--end-group
../src/lxc/cmd/lxc_monitord.c:67: error: undefined reference to 'lxc_monitor_fifo_name'
../src/lxc/cmd/lxc_monitord.c:104: error: undefined reference to 'lxc_monitor_fifo_name'
../src/lxc/cmd/lxc_monitord.c:140: error: undefined reference to 'lxc_read_nointr'
../src/lxc/cmd/lxc_monitord.c:193: error: undefined reference to 'lxc_mainloop_add_handler'
../src/lxc/cmd/lxc_monitord.c:219: error: undefined reference to 'lxc_monitor_sock_name'
../src/lxc/cmd/lxc_monitord.c:222: error: undefined reference to 'lxc_abstract_unix_open'
../src/lxc/cmd/lxc_monitord.c:236: error: undefined reference to 'lxc_monitor_sock_name'
../src/lxc/cmd/lxc_monitord.c:258: error: undefined reference to 'lxc_abstract_unix_close'
../src/lxc/cmd/lxc_monitord.c:277: error: undefined reference to 'lxc_read_nointr'
../src/lxc/cmd/lxc_monitord.c:284: error: undefined reference to 'lxc_write_nointr'
../src/lxc/cmd/lxc_monitord.c:297: error: undefined reference to 'lxc_mainloop_add_handler'
../src/lxc/cmd/lxc_monitord.c:306: error: undefined reference to 'lxc_mainloop_add_handler'
../src/lxc/cmd/lxc_monitord.c:343: error: undefined reference to 'lxc_global_config_value'
../src/lxc/cmd/lxc_monitord.c:351: error: undefined reference to 'lxc_safe_int'
../src/lxc/cmd/lxc_monitord.c:388: error: undefined reference to 'lxc_mainloop_open'
../src/lxc/cmd/lxc_monitord.c:405: error: undefined reference to 'lxc_write_nointr'
../src/lxc/cmd/lxc_monitord.c:420: error: undefined reference to 'lxc_mainloop'
../src/lxc/cmd/lxc_monitord.c:442: error: undefined reference to 'lxc_mainloop_close'
../src/include/netns_ifaddrs.c:430: error: undefined reference to 'addattr'
collect2: error: ld returned 1 exit status
[137/139] Linking target src/lxc/tools/lxc
FAILED: src/lxc/tools/lxc
gcc  -o src/lxc/tools/lxc src/lxc/tools/lxc.p/lxc_multicall.c.o src/lxc/tools/lxc.p/arguments.c.o src/lxc/tools/lxc.p/.._.._include_netns_ifaddrs.c.o src/lxc/tools/lxc.p/lxc_attach.c.o src/lxc/tools/lxc.p/lxc_autostart.c.o src/lxc/tools/lxc.p/lxc_cgroup.c.o src/lxc/tools/lxc.p/lxc_checkpoint.c.o src/lxc/tools/lxc.p/lxc_config.c.o src/lxc/tools/lxc.p/lxc_console.c.o src/lxc/tools/lxc.p/lxc_copy.c.o src/lxc/tools/lxc.p/lxc_create.c.o src/lxc/tools/lxc.p/lxc_destroy.c.o src/lxc/tools/lxc.p/lxc_device.c.o src/lxc/tools/lxc.p/lxc_execute.c.o src/lxc/tools/lxc.p/lxc_freeze.c.o src/lxc/tools/lxc.p/lxc_info.c.o src/lxc/tools/lxc.p/lxc_ls.c.o src/lxc/tools/lxc.p/lxc_snapshot.c.o src/lxc/tools/lxc.p/lxc_start.c.o src/lxc/tools/lxc.p/lxc_stop.c.o src/lxc/tools/lxc.p/lxc_top.c.o src/lxc/tools/lxc.p/lxc_unfreeze.c.o src/lxc/tools/lxc.p/lxc_unshare.c.o src/lxc/tools/lxc.p/lxc_wait.c.o src/lxc/tools/lxc.p/lxc_monitor.c.o -flto -Wl,--no-undefined -pie -Wl,--no-as-needed -Wl,--gc-sections -Wl,-z,relro -Wl,-z,now -fstack-protector -fstack-protector-strong -Wl,-fuse-ld=gold -Wl,--warn-common '-Wl,-rpath,$ORIGIN/../../..' -Wl,-rpath-link,/home/adam/git/lxc/build/ -Wl,--start-group src/lxc/liblxc.a liblxc.so.1.8.0 /nix/store/jnlxl2ry9y03vq4skhm26igfd84xwa93-dbus-1.14.10-lib/lib/libdbus-1.so -pthread /nix/store/iglb2fmla149fbprj6fb18swfls033q4-libseccomp-2.5.4-lib/lib/libseccomp.so /nix/store/5mfk83ikgk62gv0xj95xylnkf0f52chv-libselinux-3.3/lib/libselinux.so /nix/store/wp5c5sjlvm6nxavvs1prdnw5n41mgciq-libapparmor-3.1.6/lib/libapparmor.so /nix/store/c7rf6w8xvxc4423m9rsgq5nsqhknshvy-openssl-3.0.12/lib/libssl.so /nix/store/c7rf6w8xvxc4423m9rsgq5nsqhknshvy-openssl-3.0.12/lib/libcrypto.so /nix/store/lmj8lfkd8h448grf1nf92lsm5gm2fnf6-libcap-2.69-lib/lib/libcap.so -lutil -Wl,--end-group
../src/lxc/tools/arguments.c:214: error: undefined reference to 'remove_trailing_slashes'
../src/include/netns_ifaddrs.c:430: error: undefined reference to 'addattr'
../src/lxc/tools/lxc_attach.c:41: error: undefined reference to 'lxc_rexec'
../src/lxc/tools/lxc_attach.c:165: error: undefined reference to 'lxc_namespace_2_std_identifiers'
../src/lxc/tools/lxc_attach.c:168: error: undefined reference to 'lxc_fill_namespace_flags'
../src/lxc/tools/lxc_attach.c:202: error: undefined reference to 'lxc_safe_uint'
../src/lxc/tools/lxc_attach.c:206: error: undefined reference to 'lxc_safe_uint'
../src/lxc/tools/lxc_attach.c:331: error: undefined reference to 'lxc_caps_init'
../src/lxc/tools/lxc_attach.c:442: error: undefined reference to 'lxc_wait_for_pid_status'
../src/lxc/tools/lxc_autostart.c:48: error: undefined reference to 'lxc_safe_long'

at the same time everything works just fine on Ubuntu 20/22.

Let's workaround this for now by using link_whole instead of link_with, which means that we are explicitly asking all symbols to be linked (independent from if they are used or not). It's not a big deal, as this two binaries are big anyways. It's in my TODO to refactor all this build mess, but it's just too hard to make it at once and it requires a lot of changes and code reshuffling.

It's still interesting what's the difference between NixOS and Ubuntu in that regard. From what I found during debugging is that meson on NixOS (version 1.3.2) generates dependency files differently from how meason on Ubuntu does (version 0.61.2). Likely there is a problem, but it's a matter of further investigation.

Fixes: #4427

@mihalicyn mihalicyn requested a review from stgraber April 5, 2024 15:53
@mihalicyn
Copy link
Member Author

cc @adamcstephens

@mihalicyn mihalicyn removed the request for review from stgraber April 5, 2024 16:14
@mihalicyn mihalicyn changed the title meson: fix build on NixOS [WIP] meson: fix build on NixOS Apr 5, 2024
@adamcstephens
Copy link
Contributor

Looks like this may have broken the other builds. :/

@adamcstephens
Copy link
Contributor

Even with this patch it's still failing when using tool-muticall (which is my preference since I understand it reduces the output size)

[561/561] Linking target src/lxc/tools/lxc
FAILED: src/lxc/tools/lxc
gcc  -o src/lxc/tools/lxc src/lxc/tools/lxc.p/lxc_multicall.c.o src/lxc/tools/lxc.p/arguments.c.o src/lxc/tools/lxc.p/.._.._include_netns_ifaddrs.c.o src/lxc/tools/lxc.p/lxc_attach.c.o src/lxc/tools/lxc.p/lxc_autostart.c.o src/lxc/tools/lxc.p/lxc_cgroup.c.o src/lxc/tools/lxc.p/lxc_checkpoint.c.o src/lxc/tools/lxc.p/lxc_config.c.o src/lxc/tools/lxc.p/lxc_console.c.o src/lxc/tools/lxc.p/lxc_copy.c.o src/lxc/tools/lxc.p/lxc_create.c.o src/lxc/tools/lxc.p/lxc_destroy.c.o src/lxc/tools/lxc.p/lxc_device.c.o src/lxc/tools/lxc.p/lxc_execute.c.o src/lxc/tools/lxc.p/lxc_freeze.c.o src/lxc/tools/lxc.p/lxc_info.c.o src/lxc/tools/lxc.p/lxc_ls.c.o src/lxc/tools/lxc.p/lxc_snapshot.c.o src/lxc/tools/lxc.p/lxc_start.c.o src/lxc/tools/lxc.p/lxc_stop.c.o src/lxc/tools/lxc.p/lxc_top.c.o src/lxc/tools/lxc.p/lxc_unfreeze.c.o src/lxc/tools/lxc.p/lxc_unshare.c.o src/lxc/tools/lxc.p/lxc_wait.c.o src/lxc/tools/lxc.p/lxc_monitor.c.o -flto -Wl,--no-undefined -pie -Wl,--no-as-needed -Wl,--gc-sections -Wl,-z,relro -Wl,-z,now -fstack-protector -fstack-protector-strong -Wl,-fuse-ld=gold -Wl,--warn-common '-Wl,-rpath,$ORIGIN/../../..' -Wl,-rpath-link,/build/source/build/ -Wl,--start-group src/lxc/liblxc.a liblxc.so.1.8.0 /nix/store/qdah6gc69156iqaaji3hk2ryfckg5k9y-dbus-1.14.10-lib/lib/libdbus-1.so -pthread /nix/store/jssya8piz395z2yy90yshiqky5alimk2-libseccomp-2.5.5-lib/lib/libseccomp.so /nix/store/hmf4nmykf657qi7i0mra1jsfc7myy6m8-libselinux-3.6/lib/libselinux.so /nix/store/98l574asrjjnw0by1van3j4m814lzapi-libapparmor-3.1.7/lib/libapparmor.so /nix/store/p25ghy7y53lyc834xnw5mrhfq096wa4x-openssl-3.0.13/lib/libssl.so /nix/store/p25ghy7y53lyc834xnw5mrhfq096wa4x-openssl-3.0.13/lib/libcrypto.so /nix/store/afks7dzrymfc5lkzjn2wp7sry0k730bi-libcap-2.69-lib/lib/libcap.so -lutil -Wl,--end-group
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.3:(.text+0x123f): error: undefined reference to 'lxc_safe_uint'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.0:(.text+0x13bb): error: undefined reference to 'lxc_safe_uint'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.0:(.text+0x13de): error: undefined reference to 'lxc_namespace_2_std_identifiers'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.0:(.text+0x13f5): error: undefined reference to 'lxc_fill_namespace_flags'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.0:(.text+0x141b): error: undefined reference to 'lxc_safe_uint'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.12:(.text+0x1597): error: undefined reference to 'lxc_safe_long'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.1:(.text+0x165b): error: undefined reference to 'lxc_safe_long'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.13:(.text+0x16aa): error: undefined reference to 'lxc_safe_int'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function get_config_integer:(.text+0x176b): error: undefined reference to 'lxc_safe_int'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function restore:(.text+0x1ba6): error: undefined reference to 'wait_for_pid'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.5:(.text+0x1d7c): error: undefined reference to 'get_fssize'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get_ips:(.text+0x1e0a): error: undefined reference to 'lxc_string_join'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get_ips:(.text+0x1e1c): error: undefined reference to 'lxc_free_array'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function create_helpfn:(.text+0x1ea3): error: undefined reference to 'get_template_path'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function do_destroy:(.text+0x1fd4): error: undefined reference to 'file_exists'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function stdin_handler:(.text+0x21b1): error: undefined reference to 'lxc_read_nointr'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function do_destroy_with_snapshots:(.text+0x22cd): error: undefined reference to 'lxc_read_nointr'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function is_interface.part.0:(.text+0x249f): error: undefined reference to 'switch_to_ns'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function is_interface:(.text+0x2683): error: undefined reference to 'wait_for_pid'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.7:(.text+0x2773): error: undefined reference to 'lxc_safe_uint'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function print_net_stats:(.text+0x2c00): error: undefined reference to 'lxc_read_from_file'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function print_net_stats:(.text+0x2c46): error: undefined reference to 'lxc_read_from_file'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function stat_get_blk_stats:(.text+0x32bd): error: undefined reference to 'lxc_string_split_and_trim'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function stat_get_blk_stats:(.text+0x330d): error: undefined reference to 'lxc_free_array'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function stat_get_blk_stats:(.text+0x3327): error: undefined reference to 'lxc_string_split_and_trim'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function stat_get_blk_stats:(.text+0x33e9): error: undefined reference to 'lxc_free_array'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_send_str:(.text+0x34bf): error: undefined reference to 'lxc_write_nointr'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_send_str:(.text+0x34f6): error: undefined reference to 'lxc_write_nointr'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_recv_str:(.text+0x3553): error: undefined reference to 'lxc_read_nointr'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_recv_str:(.text+0x35b8): error: undefined reference to 'lxc_read_nointr'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_remove_lock:(.text+0x37be): error: undefined reference to 'get_rundir'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_remove_lock:(.text+0x3867): error: undefined reference to 'lxc_rm_rf'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get:(.text+0x39e7): error: undefined reference to 'lxc_append_paths'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get:(.text+0x3a00): error: undefined reference to 'dir_exists'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get:(.text+0x3c32): error: undefined reference to 'lxc_string_replace'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get:(.text+0x3c6c): error: undefined reference to 'lxc_string_split_and_trim'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get:(.text+0x3c77): error: undefined reference to 'lxc_array_len'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get:(.text+0x3cbb): error: undefined reference to 'lxc_free_array'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get:(.text+0x3e91): error: undefined reference to 'lxc_append_paths'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get:(.text+0x404f): error: undefined reference to 'lxc_string_join'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get:(.text+0x44d4): error: undefined reference to 'lxc_append_paths'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get:(.text+0x45ea): error: undefined reference to 'wait_for_pid'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get_wrapper:(.text+0x470e): error: undefined reference to 'lxc_write_nointr'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function ls_get_wrapper:(.text+0x4747): error: undefined reference to 'lxc_write_nointr'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_arguments_parse:(.text+0x4e1b): error: undefined reference to 'remove_trailing_slashes'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_attach_main:(.text+0x529b): error: undefined reference to 'lxc_caps_init'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_attach_main:(.text+0x5656): error: undefined reference to 'lxc_wait_for_pid_status'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_create_main:(.text+0x6ebd): error: undefined reference to 'lxc_mkdir_p'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_execute_main:(.text+0x7c1f): error: undefined reference to 'lxc_caps_init'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_execute_main:(.text+0x7da2): error: undefined reference to 'lxc_string_split_quoted'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_ls_main:(.text+0x882b): error: undefined reference to 'lxc_string_split_and_trim'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_ls_main:(.text+0x8838): error: undefined reference to 'lxc_array_len'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_start_main:(.text+0x9d0e): error: undefined reference to 'lxc_caps_init'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_top_main:(.text+0xa87f): error: undefined reference to 'lxc_mainloop_open'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_top_main:(.text+0xa8b3): error: undefined reference to 'lxc_mainloop_add_handler'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_top_main:(.text+0xaccc): error: undefined reference to 'lxc_mainloop'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_top_main:(.text+0xb05b): error: undefined reference to 'lxc_mainloop_close'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.4:(.text+0xb6cb): error: undefined reference to 'get_fssize'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.4:(.text+0xb7e9): error: undefined reference to 'lxc_string_split'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.4:(.text+0xb802): error: undefined reference to 'lxc_string_split'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.4:(.text+0xb81f): error: undefined reference to 'lxc_string_join'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.4:(.text+0xb84a): error: undefined reference to 'lxc_array_len'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.4:(.text+0xb926): error: undefined reference to 'lxc_string_split'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.4:(.text+0xb93f): error: undefined reference to 'lxc_string_split'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.4:(.text+0xb95c): error: undefined reference to 'lxc_string_join'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function my_parser.lto_priv.4:(.text+0xb987): error: undefined reference to 'lxc_array_len'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function create_helpfn:(.text+0x1e73): error: undefined reference to 'wait_for_pid'
/build/ccaoG8xH.ltrans0.ltrans.o:<artificial>:function lxc_attach_rexec:(.text.startup+0x1f2): error: undefined reference to 'lxc_rexec'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function lxc_monitor_main:(.text+0x3e3): error: undefined reference to 'lxc_monitor_open'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function lxc_monitor_main:(.text+0x666): error: undefined reference to 'lxc_monitor_open'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function lxc_monitor_main:(.text+0x730): error: undefined reference to 'lxc_safe_int'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function lxc_monitor_main:(.text+0x815): error: undefined reference to 'null_stdfds'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function lxc_monitor_main:(.text+0x936): error: undefined reference to 'lxc_monitor_read_fdset'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function lxc_monitor_main:(.text+0x998): error: undefined reference to 'lxc_state2str'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function my_parser.lto_priv.14:(.text+0x148c): error: undefined reference to 'lxc_namespace_2_std_identifiers'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function my_parser.lto_priv.14:(.text+0x14a1): error: undefined reference to 'lxc_fill_namespace_flags'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function lxc_unshare_main:(.text+0x1d5a): error: undefined reference to 'lxc_caps_init'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function lxc_unshare_main:(.text+0x1f50): error: undefined reference to 'lxc_clone'
/nix/store/hqvni28zpibl6jsqqimcvng6h6qm58xy-binutils-2.41/bin/ld.gold: error: hidden symbol 'write_id_mapping' is not defined locally
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function do_clone_ephemeral.constprop.0:(.text+0x3b7b): error: undefined reference to 'lxc_is_dir'
/build/ccaoG8xH.ltrans1.ltrans.o:<artificial>:function do_clone_ephemeral.constprop.0:(.text+0x3bd2): error: undefined reference to 'lxc_is_dir'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

@adamcstephens
Copy link
Contributor

This does succeed without tool-multicall in a nix build. Looking at the output it's only 6.9MB, so if we need to build with separate binaries I'm fine with that.

@mihalicyn
Copy link
Member Author

This does succeed without tool-multicall in a nix build. Looking at the output it's only 6.9MB, so if we need to build with separate binaries I'm fine with that.

no, I have a plan to fix and cover all cases, no doubt :-)

Fixes: lxc#4427
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
@lxc-jenkins
Copy link

Testsuite passed

1 similar comment
@lxc-jenkins
Copy link

Testsuite passed

@mihalicyn mihalicyn requested a review from stgraber April 6, 2024 20:22
@mihalicyn mihalicyn changed the title [WIP] meson: fix build on NixOS meson: fix build on NixOS Apr 6, 2024
@stgraber stgraber merged commit dda14e2 into lxc:main Apr 6, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Unable to build v6.0.0 with nix
4 participants