Thank you for the kind words!

There are two more issues I found before everything can work smoothly: 
the first is the new path normalization. It prepends a '/' to the path 
regardless of platform, which is unacceptable on Windows since absolute 
paths must begin with a drive letter. I've attached a patch to solve 
that using 'normalize-pathname' which works just fine for me.

The second issue is likely with csc itself--I suspect it only considers 
files with the .obj extension as objects on Windows. As a result, when 
passed a .o file for linking, csc instead tries to compile it which 
obviously fails. I've also attached an output demonstrating that. This 
is the reason why I added the Windows-specific extensions for objects 
and shared libraries, but if chicken-install works with the UNIX-like 
extensions on Windows then maybe it's worth fixing on the csc level.

Best regards,
Quinn

On 8/27/2026 7:13 AM, Felix Winkelmann wrote:
> 
> Many thanks for the patch. I applied it partially - the use of "process-run"
> is of course the right thing to do and should make things work better
> on Windows, as you already described. I also added the executable-extension
> handling. For objects and shared libraries I decided to keep the current
> extensions, as this is compatible with chicken-install.
> 
> Thanks again, you did a much better job at porting csm to Windows than me.
> 
> 
> cheers,
> felix
> 
Index: csm.scm
===================================================================
--- csm.scm     (revision 46106)
+++ csm.scm     (working copy)
@@ -1081,17 +1081,8 @@
 (define (normalize str #!optional dir)
   (unless (absolute-pathname? str)
     (set! str (make-absolute-pathname (or dir (current-directory)) str)))
-  (string-append
-    "/"
-    (string-intersperse
-      (let loop ((parts (string-split str "/")))
-        (match parts
-          (() '())
-          ((_ ".." . more) (loop more))
-          (("." . more) (loop more))
-          ((part . more) (cons part (loop more)))))
-      "/")))
-
+  (normalize-pathname str))
+  
 (define (fail fstr . args)
   (apply fprintf (current-error-port) fstr args)
   (newline (current-error-port))
C:/code/avs/code $ cat all.options
-program avs -static
C:/code/avs/code $ csm -v
  "C:/CHICKEN/bin/csc" "-c" "-static" "-J" "C:/code/avs/code/core.scm" "-I" 
"C:/code/avs/code" "-C" "-I" "-C" "C:/code/avs/code" "-unit" "core" 
"-emit-link-file" "core.link" "-o" "core.static.o" "-v"
"C:/CHICKEN/bin/chicken.exe" "C:/code/avs/code/core.scm" "-output-file" 
"core.static.c" "-static" "-emit-all-import-libraries" "-include-path" 
"C:/code/avs/code" "-unit" "core" "-emit-link-file" "core.link" "-verbose"
generating import library `core.import.scm' for module `core' ...
"gcc" "core.static.c" "-o" "core.static.o" "-c" "-fno-strict-aliasing" 
"-fwrapv" "-DHAVE_CHICKEN_CONFIG_H" "-DC_ENABLE_PTABLES" "-Os" "-I" 
"C:/code/avs/code" "-IC:/CHICKEN/include/chicken"
rm core.static.c
  "C:/CHICKEN/bin/csc" "-o" "avs.exe" "-I" "C:/code/avs/code" "-C" "-I" "-C" 
"C:/code/avs/code" "-static" "core.static.o" "-uses" "core" 
"C:/code/avs/code/avs.scm" "-v"
"C:/CHICKEN/bin/chicken.exe" "core.static.o" "-output-file" "core.static.c" 
"-static" "-include-path" "C:/code/avs/code" "-uses" "core" "-verbose" 
"-emit-link-file" "core.static.link"

Error: (line 1) unterminated string

Error: shell command terminated with non-zero exit status 70: 
"C:/CHICKEN/bin/chicken.exe" "core.static.o" "-output-file" "core.static.c" 
"-static" "-include-path" "C:/code/avs/code" "-uses" "core" "-verbose" 
"-emit-link-file" "core.static.link"

Error: shell command terminated with non-zero exit status 70: 
"C:/CHICKEN/bin/csc" "-o" "avs.exe" "-I" "C:/code/avs/code" "-C" "-I" "-C" 
"C:/code/avs/code" "-static" "core.static.o" "-uses" "core" 
"C:/code/avs/code/avs.scm" "-v"

Reply via email to