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

SConscript.boot uses $HOME -- but it is not guarenteed to be there nor accessible. #133

Open
coldtobi opened this issue Aug 7, 2022 · 0 comments

Comments

@coldtobi
Copy link

coldtobi commented Aug 7, 2022

Looking into packaging swift for Debian, where builds are generally done e.g. in chroots, scons fails:

make[1]: Entering directory '/build/swift-im-5.0~alpha2+145+g12d031cf8'
scons V=1 qt5=1 optimize=1 debug=1 allow_warnings=1 swiften_dll=1 help2man=1 docbook_xsl=/usr/share/xml/docbook/stylesheet/docbook-xsl docbook_xml=/usr/share/xml/docbook/schema/dtd/4.5 linkflags="-Wl,-z,relro" ccflags="-Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/swift-im-5.0~alpha2+145+g12d031cf8=. -fstack-protector-strong -Wformat -Werror=format-security"  Swift Swiften debian/swift-im.1 debian/swiften-config.1
scons: Reading SConscript files ...
Checking whether the C++ compiler works... no

Looking into config.log gives a hint:

cat config.log 
file /build/swift-im-5.0~alpha2+145+g12d031cf8/BuildTools/SCons/SConstruct,line 140:
	Configure(confdir = .sconf_temp)
scons: Configure: Checking whether the C++ compiler works... 
.sconf_temp/conftest_737c003a897167642b70f8cdde8a0eaf_0.cpp <-
  |
  |int main(void)
  |{
  |    return 0;
  |}
  |
g++ -o .sconf_temp/conftest_737c003a897167642b70f8cdde8a0eaf_0_b9d11eb9c94b413e6393d4e120436264.o -c -std=c++11 -Wextra -Wall -Wnon-virtual-dtor -Wundef -Wold-style-cast -Wno-long-long -Woverloaded-virtual -Wfloat-equal -Wredundant-decls -Wno-unknown-pragmas -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/swift-im-5.0~alpha2+145+g12d031cf8=. -fstack-protector-strong -Wformat -Werror=format-security -isystem /build/swift-im-5.0~alpha2+145+g12d031cf8/Backport/ -O2 -g -fPIC -DSWIFT_EXPERIMENTAL_FT .sconf_temp/conftest_737c003a897167642b70f8cdde8a0eaf_0.cpp
ccache: error: Failed to create directory /nonexistent/.cache/ccache/tmp: Permission denied
scons: Configure: no

/nonexistent/ is the canonical location for a nonexistant home directories; while building Debian package $HOME is pointing there to catch policy violations during build.

Looking into SConscript.boot I see several locations where "HOME" is referenced…

TL;DR: You build system must not assume that HOME exists and/or is writeable.

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

No branches or pull requests

1 participant