podman-machine-qemu icon indicating copy to clipboard operation
podman-machine-qemu copied to clipboard

[BUG]: prefix paths with spaces are not supported

Open BlackHole1 opened this issue 2 years ago • 5 comments

export PREFIX="/tmp/foo bar"

./build-qemu.sh

Throw error: not found bar

/cc @anjannath

BlackHole1 avatar May 29 '23 11:05 BlackHole1

PREFIX="/tmp/foo bar": https://github.com/BlackHole1/podman-machine-qemu/actions/runs/5111483147/jobs/9188486207

PREFIX="/tmp/foo\ bar": https://github.com/BlackHole1/podman-machine-qemu/actions/runs/5111509705/jobs/9188543033

Although the ci shows success, the results are all wrong. This can be successfully reproduced locally.

BlackHole1 avatar May 29 '23 11:05 BlackHole1

When I tried to locate the problem, I found that the following line should be the cause of the problem.

https://github.com/containers/podman-machine-qemu/blob/0dee72654e4cf8b192f8745d8d2837419638f820/build-qemu.sh#L13

But I tried the following solutions, but none of them worked.

  1. export LDFLAGS=-L/tmp/bar\ foo/lib
  2. export LDFLAGS=-L"/tmp/bar\ foo/lib"
  3. export LDFLAGS=-L"/tmp/bar foo/lib"

BlackHole1 avatar May 29 '23 11:05 BlackHole1

BTW. Is it possible to use a statically compiled solution? That way we don't have to care about LDFLAGS anymore. 🤔

BlackHole1 avatar May 29 '23 14:05 BlackHole1

BTW. Is it possible to use a statically compiled solution? That way we don't have to care about LDFLAGS anymore. thinking

I think it should be possible to have static builds, and probably all the dependencies will also have to be statically build, i am not very familiar with c/c++ build tools, these scripts are based on the corresponding homebrew formulas

about PREFIX with spaces, the easiest is to use a directory without spaces in the name, as this could also be related to (i guess) autotools not supporting file/dir names with spaces, as wherever we are using the $PREFIX in the scripts, its always in quotes ("${PREFIX}")

anjannath avatar May 30 '23 06:05 anjannath

I think it should be possible to have static builds, and probably all the dependencies will also have to be statically build, i am not very familiar with c/c++ build tools, these scripts are based on the corresponding homebrew formulas

I searched for some information online, but most of it was about static compilation under Linux. I tried static compilation myself, but failed.

https://gitlab.com/qemu-project/qemu/-/issues/1670

BlackHole1 avatar May 30 '23 06:05 BlackHole1