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

Can't build gettext-sys if any parent path has a space in it #9

Closed
audiodude opened this issue Jul 21, 2018 · 4 comments · Fixed by #52
Closed

Can't build gettext-sys if any parent path has a space in it #9

audiodude opened this issue Jul 21, 2018 · 4 comments · Fixed by #52
Labels
bug bulid Related to build system

Comments

@audiodude
Copy link

Probably because of https://www.gnu.org/software/autoconf/manual/autoconf-2.60/autoconf.html#Special-Chars-in-Variables

I believe the solution would be to build gettext in /tmp or some other place that has a known good path, but I'm new to this project.

@audiodude
Copy link
Author

Here's the output of running $ cargo build in gettext-sys from /tmp/space man/

$ cargo build
Updating registry https://github.com/rust-lang/crates.io-index
Compiling cc v1.0.18
Compiling gettext-sys v0.19.8 (file:///private/tmp/space%20man/gettext-rs/gettext-sys)
error: failed to run custom build command for gettext-sys v0.19.8 (file:///private/tmp/space%20man/gettext-rs/gettext-sys)
process didn't exit successfully: /private/tmp/space man/gettext-rs/target/debug/build/gettext-sys-80f993ee9d914c84/build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=X86_64_APPLE_DARWIN_GETTEXT_SYSTEM
cargo:rerun-if-env-changed=GETTEXT_SYSTEM
cargo:rustc-link-lib=framework=CoreFoundation
cargo:rustc-link-lib=dylib=iconv
cargo:rerun-if-env-changed=X86_64_APPLE_DARWIN_GETTEXT_DIR
cargo:rerun-if-env-changed=GETTEXT_DIR
cargo:rerun-if-env-changed=X86_64_APPLE_DARWIN_GETTEXT_BIN_DIR
cargo:rerun-if-env-changed=GETTEXT_BIN_DIR
cargo:rerun-if-env-changed=X86_64_APPLE_DARWIN_GETTEXT_LIB_DIR
cargo:rerun-if-env-changed=GETTEXT_LIB_DIR
cargo:rerun-if-env-changed=X86_64_APPLE_DARWIN_GETTEXT_INCLUDE_DIR
cargo:rerun-if-env-changed=GETTEXT_INCLUDE_DIR
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("true")
running: "tar" "xJf" "/private/tmp/space man/gettext-rs/gettext-sys/gettext-0.19.8.1.tar.xz" "--strip-components" "1"
running: "sh" "/private/tmp/space man/gettext-rs/target/debug/build/gettext-sys-6fc3dea112695cd0/out/gettext/configure" "--without-emacs" "--disable-java" "--disable-csharp" "--disable-c++" "--disable-shared" "--enable-static" "--enable-fast-install" "--with-included-gettext" "--with-included-glib" "--with-included-libcroco" "--with-included-libunistring" "--prefix=/private/tmp/space man/gettext-rs/target/debug/build/gettext-sys-6fc3dea112695cd0/out"
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane...
--- stderr
configure: error: unsafe srcdir value: '/private/tmp/space man/gettext-rs/target/debug/build/gettext-sys-6fc3dea112695cd0/out/gettext'
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1

build script failed, must exit now', gettext-sys/build.rs:251:5
note: Run with RUST_BACKTRACE=1 for a backtrace.

@Koka
Copy link
Owner

Koka commented Jul 22, 2018

@audiodude Thanks for your feedback, I'll try to fix this when I'll have some spare time

@Minoru
Copy link
Collaborator

Minoru commented Feb 27, 2021

I reproduced with GNU gettext 0.21 on Debian testing. That's directly from the upstream's tarball, but with our configure options. I sent an email to upstream to see if it's something they can fix; if not, I'll see if we can move the build to /tmp.

@Minoru
Copy link
Collaborator

Minoru commented Feb 28, 2021

Got a reply. This is indeed a limitation of autoconf, and not something upstream intends to address. GNU gettext maintainer also pointed out that it's dangerous to even try to build in such situation (since the commands can be cut short and do something unintended).

I'll work on moving the build to a temporary directory (don't know yet if I'll hard-code it, or rely on tempdir crate or something).

Minoru added a commit to Minoru/gettext-rs that referenced this issue Mar 2, 2021
This works around the autotools limitation, which prevented us from
building in directories whose absolute paths have spaces in them.

Fixes Koka#9.
@Minoru Minoru closed this as completed in #52 Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bulid Related to build system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants