chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Fix module.db generation on Windows


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Fix module.db generation on Windows
Date: Sun, 21 Feb 2016 14:01:43 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi all,

Evan pointed out that on Windows, installation would show various error
messages while building the module database, like this:

Failed to import from 
`c:/users/windows/chicken/lib/chicken/8\chicken.import.so': (import) 
during expansion of (import ...) - cannot import from undefined module: 
|8\\chicken|

All tests pass, and these errors scroll just out of view with default
terminal sizes so I hadn't noticed this.  Installation doesn't fail on
this (maybe it should?  Unsure...).  So thanks Evan for pointing this
out!

The reason this failed is because we generate paths using the system's
path separator (probably since edd4926b /  5920000), but the update-db
procedure in chicken-install.scm would try to match a regex which
allowed only for slashes as separator.  That means the final two
components which are separated by a backslash would get seen as one,
which explains the error message (it would chop off the "import.so" and
convert the remaining bit to a symbol and try to (import |8\\chicken)).

The attached patch applies to master and chicken-5, and simply replaces
the regex stuff with path manipulation operations.  It uses more careful
globbing to avoid including files that aren't import libraries, so we
can assume the procedure doesn't get invalid files passed to it.

And of course we shouldn't forget about https://xkcd.com/1171/

After this patch and the locative fix from the "this code looks wrong
to me" thread, I think we're all set for a release candidate!

Cheers,
Peter

Attachment: 0001-Fix-module-db-generation-on-Windows.patch
Description: Text Data

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]