Lemmings Forums

Lix => Lix Main => Topic started by: Forestidia86 on January 26, 2018, 02:16:24 AM

Title: (fixed) DAllegro5 batch fails on paths with spaces/hyphens
Post by: Forestidia86 on January 26, 2018, 02:16:24 AM
Just for completeness:
SiegeLord actually has provided a tool/batch file (https://github.com/SiegeLord/DAllegro5/blob/master/create_import_libs.bat) that creates Allegro libs from the DLLs. (Nevertheless good to know how to do it manually just in case.)

Just an addition: It looks like the directory path where the Allegro DLLs are situated shouldn't have something like spaces or hyphens ("-") for the batch file to work properly.
Title: Re: DAllegro5 batch chokes on paths with spaces/hyphens
Post by: Simon on January 26, 2018, 02:45:02 AM
Quote
shouldn't have something like spaces or hyphens ("-")

Should be reported directly against SiegeLord's repository. I'll forward it.

This is typically a bug in the script, the variable expansions should be enquoted, and the path shouldn't be split by hyphen. I don't know enough Windows batch to fix this.

-- Simon
Title: Re: DAllegro5 batch chokes on paths with spaces/hyphens
Post by: Forestidia86 on January 26, 2018, 02:56:25 AM
From what I've read my guess is that it comes from using DPNa (Drive, Path, Name (of a)) instead of just Na.
But maybe SiegeLord has a reason to use the full path instead of only the name. I really have no understanding of batch file scripting myself.
Title: Re: DAllegro5 batch chokes on paths with spaces/hyphens
Post by: Forestidia86 on January 26, 2018, 03:44:29 AM
Only another thing connected to that:
The same issue arises if you have e.g. something like allegro-debug-5.2.dll. It then only creates allegro.lib since it goes only to the first hyphen (as far as I've tested and maybe arising from "tokens=1 delims=-" ). That could be a problem if you have have release and debug dlls in the same folder since for allegro-5.2.dll as well as for allegro-debug-5.2.dll allegro.lib is created probably one overwriting the other. That was one thing that threw me off in the course of trying to run against Allegro debug libraries since I didn't know that at that time.
Couldn't the debug liberaries have an underscore rather than a hyphen like eg. allegro_debug-5.2.dll?
Title: Re: DAllegro5 batch chokes on paths with spaces/hyphens
Post by: Simon on January 26, 2018, 04:28:48 AM
Quote
Couldn't the debug liberaries have an underscore rather than a hyphen like eg. allegro_debug-5.2.dll?

You can name any file however you like. :lix-tongue:

The real problems:
If the script generates weird filenames, fix the script. Apparently the script works only for release libraries in certain paths. Ideally, the script builds debugging LIBs from debugging DLLs and release LIBs from release DLLs.

Renaming the files would produce a nonstandard build environment; you can do that, but you must assume that everybody else will not support it.

-- Simon
Title: Re: DAllegro5 batch chokes on paths with spaces/hyphens
Post by: Forestidia86 on January 27, 2018, 09:53:24 AM
Another point where people can trip over:
When installing dmd with the installer on Win it wanted to install another external big program for 64bit-support.
I always declined that and got a warning that there is no 64bit support then but for Lix it was sufficient without that (program). Lix builds fine even without.
Title: Re: DAllegro5 batch chokes on paths with spaces/hyphens
Post by: Simon on January 27, 2018, 10:01:28 AM
Good idea, I've added that to the docs.

-- Simon
Title: Re: DAllegro5 batch chokes on paths with spaces/hyphens
Post by: Forestidia86 on February 11, 2018, 12:16:31 AM
Just for completeness:
SiegeLord actually has provided a tool/batch file (https://github.com/SiegeLord/DAllegro5/blob/master/create_import_libs.bat) that creates Allegro libs from the DLLs. (Nevertheless good to know how to do it manually just in case.)

Just an addition: It looks like the directory path where the Allegro DLLs are situated shouldn't have something like spaces or hyphens ("-") for the batch file to work properly.

Hm, if it is not dealt with, maybe a short notice to not have hyphens or spaces in file path.
What really could confuse is when you have hyphens in the file path. Because then it likely gives no error message and creates a lib but not in a way you want.

Example:
Let's say you have a file path without hypens or spaces so far.
Then create folder test-5.
Put allegro DLLs, implib.exe and the batch file in there.
Start the batch file.
=>
test.lib is created and put in the folder above.
Title: Re: DAllegro5 batch chokes on paths with spaces/hyphens
Post by: Simon on February 11, 2018, 01:07:08 AM
This should be reported against DAllegro 5, not against Lix. I've forwarded it.

I don't have a Windows machine to test scripts, thus I can't fix this one myself. Since it's going to be in DAllegro 5 for a while, I'll warn about it in Lix's build docs.

-- Simon
Title: Re: DAllegro5 batch chokes on paths with spaces/hyphens
Post by: Forestidia86 on February 11, 2018, 03:06:10 AM
This should be reported against DAllegro 5, not against Lix. I've forwarded it.

Well, the problem occured to me in the context of Lix. And DAllegro 5 problems are technically Lix problems as well at least to the extent Lix uses it.
Since I pointed to the batch file I felt responsible to inform that there seem to be problems/that it has a restrictive use.
To be clear: personally I know that there is a problem and how to omit it, so I'm the last person that need the file to be fixed.
But the clarity of the build instructions may suffer from it and that was what my originial post and my last post were mainly about not about the issue with the batch file itself.
But in the future I will think twice if I report an issue.
Title: Re: DAllegro5 batch fails on paths with spaces/hyphens
Post by: Simon on February 11, 2018, 05:54:37 PM
I agree with everything, including that you push for a change in the build instructions, except your conclusion:

Quote
But in the future I will think twice if I report an issue.

Always report if your hunch is that something is wrong around Lix. Please continue, you have excellent reports. The documentation clearly belongs to Lix, and it shouldn't point to dangerous scripts without explanation. 100 % agree that I should either explain the bug or not point to the script.

At first, I thought you were pushing me to report against DAllegro5. You can see from the chatlogs that I was confused, I asked: What do you want me to do? For me, it was common sense to document the bug as far upstream as possible. I didn't realize at first that you wanted me to document it in the Lix build docs, which is a good idea here.

Thus, please continue to report liberally against Lix.

-- Simon
Title: (fixed) DAllegro5 batch fails on paths with spaces/hyphens
Post by: Simon on February 16, 2018, 06:25:25 AM
Fixed upstream (https://github.com/SiegeLord/DAllegro5/commit/96811036e877bb31b7510fc9e14830b15db4eadf) by SiegeLord. Thanks for the report!

-- Simon