muon icon indicating copy to clipboard operation
muon copied to clipboard

Muon fails to detect nasm

Open LoneFox78 opened this issue 6 months ago • 2 comments

Trying to build libass 0.17.4 using current git master of Muon, it complains:

error failed to detect linker
warn nasm was not found; ASM functions are disabled. Install nasm >= 2.10 for a significantly faster libass build.

I do have nasm 2.16.03 installed, and if I use autotools to build this same package, it detects and uses nasm without any problems.

My system is self-built Linux, so it is possible that the problem is something unique to my setup. It is hard to debug, because the error message doesn't contain enough information. If I knew what it is doing to detect nasm, I could try running the same command manually and see what is going wrong. Would it be possible to add the failed command to the error message, at least in verbose mode if not always?

LoneFox78 avatar Jun 08 '25 05:06 LoneFox78

in src/compilers.c, look at the function compiler_detect_nasm()

vtorri avatar Jun 08 '25 05:06 vtorri

OK, after adding some printf() calls, I see what is going on.

It didn't show a failing command, because it is bailing out before even running one. Right here:

diff -bur muon-20250608-orig/src/compilers.c muon-20250608/src/compilers.c
--- muon-20250608-orig/src/compilers.c	2025-06-08 07:53:20.000000000 +0300
+++ muon-20250608/src/compilers.c	2025-06-08 11:39:40.000000000 +0300
@@ -717,6 +717,7 @@
 	toolchain_detect_cmd_arr_cb cb)
 {
 	if (!toolchain_exe_option_name) {
+printf("derp!\n");
 		return false;
 	}
 

And the fix is to add the missing thing. I'm not sure if this is the right thing to put in there, but it does work:

diff -bur muon-20250608-orig/src/options.c muon-20250608/src/options.c
--- muon-20250608-orig/src/options.c	2025-06-08 07:53:20.000000000 +0300
+++ muon-20250608/src/options.c	2025-06-08 11:55:27.000000000 +0300
@@ -872,7 +872,7 @@
 	[compiler_language_cpp] = { "env.CXX", "env.CXX_LD" },
 	[compiler_language_objc] = { "env.OBJC", "env.OBJC_LD" },
 	[compiler_language_objcpp] = { "env.OBJCXX", "env.OBJCXX_LD" },
-	[compiler_language_nasm] = { "env.NASM" },
+	[compiler_language_nasm] = { "env.NASM", "env.NASM_LD" },
 };
 
 bool

LoneFox78 avatar Jun 08 '25 09:06 LoneFox78

This should be fixed now

annacrombie avatar Jul 01 '25 13:07 annacrombie