﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1818	Exporting a macro inhibits compiled program from locating libraries	Filip Jagiełłowicz		"The bug I found makes the compiled program unable to locate libraries
based on the environment variables `CHICKEN_INCLUDE_PATH` and
`CHICKEN_REPOSITORY_PATH`.

The bug is quite fiddly to reproduce so I've added a 7z archive that
contains the neccessary file structure and sets the environment
variables appropriately. To compile and run it execute the make.sh
script.

The program runs as expected as long as the 5. line (exporting the
macro) in the test.scm file is commented out, but fails to load the
testlib library if it's included.

What makes the bug so fiddly and likely the reason why it hasn't been
noticed so far is that everything works as expected as long as the
include *.import.scm files and the library *.so files are in the same
directory, as pointed by CHICKEN_REPOSITORY_PATH. This can be observed
by commenting out the 8. line in the make.sh script.

Therefore I hope it's a simple error in using a wrong variable to get
the search directory for the *.import.scm files.

Lastly, I've run it on Arch Linux updated as of 2023.03.30:

{{{#!sh
$ chicken-csc -version
CHICKEN
(c) 2008-2021, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.3.0 (rev e31bbee5)
linux-unix-gnu-x86-64 [ 64bit dload ptables ]
}}}
"	defect	new	major	someday	compiler	5.3.0				
