Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Makefiles break on linux when there are space(s) in the directory path #2426

Open
1 of 13 tasks
BuildMonkey opened this issue Jan 28, 2025 · 11 comments · May be fixed by #2433
Open
1 of 13 tasks

Generated Makefiles break on linux when there are space(s) in the directory path #2426

BuildMonkey opened this issue Jan 28, 2025 · 11 comments · May be fixed by #2433
Assignees
Labels

Comments

@BuildMonkey
Copy link

BuildMonkey commented Jan 28, 2025

Before opening a new bug report, please read Reporting Bugs and consider if this is something you can contribute yourself. If this a new bug, help us help you by filling in the template below.

What seems to be the problem?
When a person uses a path name to a project on linux that contains a space, the build process fails. We noticed the generated Makefiles do not account for the spaces in the paths and the build process will throw an error. Below is a santised generated Makefile command.

Linking foo.plugin^M
g++ -o "../../../linux-x86_64/foo.plugin.so" -L"/home/user/project name/release" -L/usr/lib64 -Wl,-rpath=/home/user/project name/release/python/lib -lpython3.11
g++: error: name/release/python/lib: No such file or directory
make[1]: *** [Makefile:102: ../../../linux-x86_64/foo.plugin.so] Error 1

What did you expect to happen?
I would have expected the generated Makefiles would account for the spaces in the directory paths. I notice the -L LIBDIRS are quoted, but not the rpath.

What have you tried so far?
We are not using spaces in the directory names on linux, but we can't manage all developers local development environment.

How can we reproduce this?
I would suggest trying any project on linux, checking out the git project where the root directory has a space, like "project name".

  • Visual Studio 2022 (vs2022)
  • Visual Studio 2019 (vs2019)
  • Visual Studio 2017 (vs2017)
  • Visual Studio 2015 (vs2015)
  • Visual Studio 2012 (vs2012)
  • Visual Studio 2010 (vs2010)
  • Visual Studio 2008 (vs2008)
  • Visual Studio 2005 (vs2005)
  • GNU Makefile (gmake)
  • GNU Makefile Legacy (gmakelegacy)
  • XCode (xcode)
  • Codelite
  • Other (Please list below)

What version of Premake are you using?
5.0.0-beta2

@nickclark2016
Copy link
Member

Is this gmake or gmake2?

@BuildMonkey
Copy link
Author

Apologies, I should have mentioned that. This is gmake2.

@samsinsane
Copy link
Member

@nickclark2016 looks like we just need to update the getrunpathdirs functions in the toolsets to use p.quoted like the getLibraryDirectories functions?

@nickclark2016
Copy link
Member

Appears to be the correct course of action

@nickclark2016
Copy link
Member

Getting around to taking a look at this. I will try to have a fix out within the next day or two

@nickclark2016 nickclark2016 self-assigned this Feb 20, 2025
@nickclark2016 nickclark2016 linked a pull request Feb 20, 2025 that will close this issue
6 tasks
@nickclark2016
Copy link
Member

Would it be possible for you to update to beta5 and verify a later version of Premake does not resolve your problem?

@nickclark2016
Copy link
Member

And would it be possible to get a little more context in terms of your Premake file and the generated Makefile.

@nickclark2016
Copy link
Member

Looking even further into this, I would highly suggest naming patterns including spaces. This is a known issue within GNU Make itself (see https://savannah.gnu.org/bugs/?712).

@BuildMonkey
Copy link
Author

Apologies, I cannot share the generated makefile and premake due to intellectual property (IP) restrictions. A simple test is placing a space in the project's root name and generating the makefile. As you can see some of the paths are encased in quotes to address the space, except for the rpath. This is why I figured there might be a solution to address the rpath, but if this is due to inheriting the known GNU Make issue, then I understand it cannot be addressed at this time.

@nickclark2016
Copy link
Member

I'll definitely keep investigating a workaround. Were you able to verify against the latest release?

@BuildMonkey
Copy link
Author

Not at this time. I won't be able to get to it for a couple of weeks. I will let you know when I do. I appreciate this work towards solving this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants