Author Topic: (fixed) DAllegro5 batch fails on paths with spaces/hyphens  (Read 386 times)

0 Members and 1 Guest are viewing this topic.

Offline Forestidia86

  • Posts: 453
    • View Profile
(fixed) DAllegro5 batch fails on paths with spaces/hyphens
« on: January 26, 2018, 02:16:24 am »
Just for completeness:
SiegeLord actually has provided a tool/batch file 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.
« Last Edit: February 16, 2018, 06:25:35 am by Simon »

Offline Simon

  • Administrator
  • Posts: 2406
    • View Profile
    • Lix
Re: DAllegro5 batch chokes on paths with spaces/hyphens
« Reply #1 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

Offline Forestidia86

  • Posts: 453
    • View Profile
Re: DAllegro5 batch chokes on paths with spaces/hyphens
« Reply #2 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.

Offline Forestidia86

  • Posts: 453
    • View Profile
Re: DAllegro5 batch chokes on paths with spaces/hyphens
« Reply #3 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?

Offline Simon

  • Administrator
  • Posts: 2406
    • View Profile
    • Lix
Re: DAllegro5 batch chokes on paths with spaces/hyphens
« Reply #4 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:
  • What governs which DLL is required at runtime? Example of what won't work: Have DLL, then generate LIB from DLL, then invent naming scheme and rename both the DLL and LIB according to this scheme. Build Lix and link against the LIB. When you try to run Lix, it crashes because it wants the un-renamed DLL.
  • Is the underscore naming conventional? Assume that we change the dubfile for linking against debugging Allegro libraries, then it would be nice to have the debugging libraries named the same on every system. I suppose -debug- is common and _debug- is not.
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

Offline Forestidia86

  • Posts: 453
    • View Profile
Re: DAllegro5 batch chokes on paths with spaces/hyphens
« Reply #5 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.

Offline Simon

  • Administrator
  • Posts: 2406
    • View Profile
    • Lix
Re: DAllegro5 batch chokes on paths with spaces/hyphens
« Reply #6 on: January 27, 2018, 10:01:28 am »
Good idea, I've added that to the docs.

-- Simon

Offline Forestidia86

  • Posts: 453
    • View Profile
Re: DAllegro5 batch chokes on paths with spaces/hyphens
« Reply #7 on: February 11, 2018, 12:16:31 am »
Just for completeness:
SiegeLord actually has provided a tool/batch file 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.

Offline Simon

  • Administrator
  • Posts: 2406
    • View Profile
    • Lix
Re: DAllegro5 batch chokes on paths with spaces/hyphens
« Reply #8 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

Offline Forestidia86

  • Posts: 453
    • View Profile
Re: DAllegro5 batch chokes on paths with spaces/hyphens
« Reply #9 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.

Offline Simon

  • Administrator
  • Posts: 2406
    • View Profile
    • Lix
Re: DAllegro5 batch fails on paths with spaces/hyphens
« Reply #10 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
« Last Edit: February 13, 2018, 01:49:39 am by Simon »

Offline Simon

  • Administrator
  • Posts: 2406
    • View Profile
    • Lix
(fixed) DAllegro5 batch fails on paths with spaces/hyphens
« Reply #11 on: February 16, 2018, 06:25:25 am »
Fixed upstream by SiegeLord. Thanks for the report!

-- Simon