Bug 419196

Summary: craftenv.sh causes automake's AM_SANITY_CHECK to fail under macOS
Product: [Unmaintained] Craft Reporter: Dawid Wróbel <me>
Component: CoreAssignee: Hannah von Reth <vonreth>
Status: RESOLVED FIXED    
Severity: major CC: kde-windows
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: macOS   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dawid Wróbel 2020-03-24 20:18:40 UTC
SUMMARY

crafenv.sh sets the environment in a way that causes automake's AM_SANITY_CHECK to fail: 
checking whether build environment is sane... configure: error: ls -t appears to fail.  Make sure there is not a broken

Compilation works fine if manually executing ./configure without sourcing the craftenv.sh


STEPS TO REPRODUCE
1. set up craft under macOS
2. source craft/craftenv.sh
3. craft libs/libopensp

OBSERVED RESULT

source  /Volumes/External/CraftRootNew/craft/craftenv.sh
Craft               : /Volumes/External/CraftRootNew
Version             : master
ABI                 : macos-64-clang
Download directory  : /Volumes/External/CraftRootNew/download



CRAFT:craft libs/libopensp
Craft               : /Volumes/External/CraftRootNew
Version             : master
ABI                 : macos-64-clang
Download directory  : /Volumes/External/CraftRootNew/download
=====================================================================================================================================================================================================================================================================
*** Handling package: libs/libopensp, action: all ***
*** Action: fetch-binary for libs/libopensp ***
*** libs/libopensp not found in cache ***
*** Action: fetch for libs/libopensp ***
*** Action: unpack for libs/libopensp ***
executing command: /Volumes/External/CraftRootNew/dev-utils/bin/7za x /Volumes/External/CraftRootNew/download/archives/libs/libopensp/OpenSP-1.5.2.tar.gz -so -bsp2 | /usr/bin/tar --directory /Volumes/External/CraftRootNew/build/libs/libopensp/work -xf -
*** Action: compile for libs/libopensp ***
executing command: "/Volumes/External/CraftRootNew/build/libs/libopensp/work/OpenSP-1.5.2/configure"  --enable-shared --disable-static --disable-doc-build   --prefix='/Volumes/External/CraftRootNew'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... configure: error: ls -t appears to fail.  Make sure there is not a broken
alias in your environment
configure: error: newly created file is older than distributed files!
Check your system clock
Action: compile for libs/libopensp:1.5.2 FAILED
*** Craft all failed: libs/libopensp after 1 second ***
fatal error: package libs/libopensp all failed
Craft stopped with out completing ['libs/libopensp']


EXPECTED RESULT

compile@mac-mini OpenSP-1.5.2 % source  /Volumes/External/CraftRootNew/craft/craftenv.sh
Craft               : /Volumes/External/CraftRootNew
Version             : master
ABI                 : macos-64-clang
Download directory  : /Volumes/External/CraftRootNew/download
CRAFT:cd /Volumes/External/CraftRootNew/build/libs/libopensp/work/OpenSP-1.5.2
CRAFT:./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... configure: error: ls -t appears to fail.  Make sure there is not a broken
alias in your environment
configure: error: newly created file is older than distributed files!
Check your system clock


SOFTWARE/OS VERSIONS
macOS: 10.15.3

ADDITIONAL INFORMATION

Happens both with zsh and bash.
Comment 1 Dawid Wróbel 2020-03-24 20:32:50 UTC
After further debugging, this is caused by CLICOLOR_FORCE=1 introduced by this commit:

https://github.com/KDE/craft/commit/95782ab1463b50bddbec4653b1ffed16c798c53e
Comment 2 Dawid Wróbel 2020-03-24 20:44:28 UTC
I suppose a valid solution would be add a setting to options.py to allow to either override the "AllowAnsiColor", or more generically, to enforce as "vanilla" sh env as possible.
Comment 3 Hannah von Reth 2020-03-25 08:16:12 UTC
(In reply to Dawid Wróbel from comment #0)
> SUMMARY
> 
> crafenv.sh sets the environment in a way that causes automake's
> AM_SANITY_CHECK to fail: 
> checking whether build environment is sane... configure: error: ls -t
> appears to fail.  Make sure there is not a broken
> 
> Compilation works fine if manually executing ./configure without sourcing
> the craftenv.sh
> 
> 
> STEPS TO REPRODUCE
> 1. set up craft under macOS
> 2. source craft/craftenv.sh
> 3. craft libs/libopensp
> 
> OBSERVED RESULT
> 
> source  /Volumes/External/CraftRootNew/craft/craftenv.sh
> Craft               : /Volumes/External/CraftRootNew
> Version             : master
> ABI                 : macos-64-clang
> Download directory  : /Volumes/External/CraftRootNew/download
> 
> 
> 
> CRAFT:craft libs/libopensp
> Craft               : /Volumes/External/CraftRootNew
> Version             : master
> ABI                 : macos-64-clang
> Download directory  : /Volumes/External/CraftRootNew/download
> =============================================================================
> =============================================================================
> =============================================================================
> ==============================
> *** Handling package: libs/libopensp, action: all ***
> *** Action: fetch-binary for libs/libopensp ***
> *** libs/libopensp not found in cache ***
> *** Action: fetch for libs/libopensp ***
> *** Action: unpack for libs/libopensp ***
> executing command: /Volumes/External/CraftRootNew/dev-utils/bin/7za x
> /Volumes/External/CraftRootNew/download/archives/libs/libopensp/OpenSP-1.5.2.
> tar.gz -so -bsp2 | /usr/bin/tar --directory
> /Volumes/External/CraftRootNew/build/libs/libopensp/work -xf -
> *** Action: compile for libs/libopensp ***
> executing command:
> "/Volumes/External/CraftRootNew/build/libs/libopensp/work/OpenSP-1.5.2/
> configure"  --enable-shared --disable-static --disable-doc-build  
> --prefix='/Volumes/External/CraftRootNew'
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... configure: error: ls -t
> appears to fail.  Make sure there is not a broken
> alias in your environment
> configure: error: newly created file is older than distributed files!
> Check your system clock
> Action: compile for libs/libopensp:1.5.2 FAILED
> *** Craft all failed: libs/libopensp after 1 second ***
> fatal error: package libs/libopensp all failed
> Craft stopped with out completing ['libs/libopensp']
> 
> 
> EXPECTED RESULT
> 
> compile@mac-mini OpenSP-1.5.2 % source 
> /Volumes/External/CraftRootNew/craft/craftenv.sh
> Craft               : /Volumes/External/CraftRootNew
> Version             : master
> ABI                 : macos-64-clang
> Download directory  : /Volumes/External/CraftRootNew/download
> CRAFT:cd
> /Volumes/External/CraftRootNew/build/libs/libopensp/work/OpenSP-1.5.2
> CRAFT:./configure
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... configure: error: ls -t
> appears to fail.  Make sure there is not a broken
> alias in your environment
> configure: error: newly created file is older than distributed files!
> Check your system clock
> 
> 
> SOFTWARE/OS VERSIONS
> macOS: 10.15.3
> 
> ADDITIONAL INFORMATION
> 
> Happens both with zsh and bash.

Thx for finding the source of this issue, I hate autotools.... 🤦‍♀️
I guess unsetting of CLICOLOR_FORCE during the configure step would solve that issue, I'll have a look.

Thx
Comment 4 Hannah von Reth 2020-03-25 16:47:40 UTC
Git commit 3624389f2e79f63fa1bbbb55503e4728282837be by Hannah von Reth.
Committed on 25/03/2020 at 16:47.
Pushed by vonreth into branch 'master'.

Don't set CLICOLOR_FORCE during autotools configure

M  +2    -1    bin/BuildSystem/AutoToolsBuildSystem.py

https://commits.kde.org/craft/3624389f2e79f63fa1bbbb55503e4728282837be