microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.89k stars 6.32k forks source link

[vcpkg] Exit code zero (EXIT_SUCCESS) after failure (No space left on device) #17146

Open SamuelMarks opened 3 years ago

SamuelMarks commented 3 years ago

Describe the bug No space left on device but it still succeeds (runs to end)

Environment

To Reproduce

 $ ./vcpkg install wxwidgets
Computing installation plan...
The following packages will be built and installed:
    wxwidgets[core]:x64-osx -> 3.1.4#7
Detecting compiler hash for triplet x64-osx...
Could not locate cached archive: /Users/samuel/.cache/vcpkg/archives/64/644750c6ac4eb6c4ada968f9c58392ead3ff9e26.zip
Starting package 1/1: wxwidgets:x64-osx
Building package wxwidgets[core]:x64-osx...
-- Downloading https://github.com/wxWidgets/wxWidgets/archive/v3.1.4.tar.gz -> wxWidgets-wxWidgets-v3.1.4.tar.gz...
-- Extracting source /private/tmp/vcpkg/downloads/wxWidgets-wxWidgets-v3.1.4.tar.gz
-- Applying patch disable-platform-lib-dir.patch
-- Applying patch fix-stl-build-vs2019-16.6.patch
-- Using source at /private/tmp/vcpkg/buildtrees/wxwidgets/src/v3.1.4-b747a62900.clean
-- Configuring x64-osx-dbg
-- Configuring x64-osx-rel
-- Building x64-osx-dbg
-- Building x64-osx-rel
-- Installing: /private/tmp/vcpkg/packages/wxwidgets_x64-osx/share/wxwidgets/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: .cache/vcpkg/archives/64/644750c6ac4eb6c4ada968f9c58392ead3ff9e26.zip
Building package wxwidgets[core]:x64-osx... done
Installing package wxwidgets[core]:x64-osx...
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwx_baseu-3.1.a: No space left on device
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwx_osx_cocoau_xrc-3.1.a: No space left on device
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwxregexu-3.1.a: No space left on device
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwx_baseu_xml-3.1.a: No space left on device
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwx_osx_cocoau_ribbon-3.1.a: No space left on device
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwx_osx_cocoau_stc-3.1.a: No space left on device
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwx_osx_cocoau_gl-3.1.a: No space left on device
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwx_osx_cocoau_core-3.1.a: No space left on device
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwx_osx_cocoau_adv-3.1.a: No space left on device
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwx_baseu_net-3.1.a: No space left on device
failed: /private/tmp/vcpkg/installed/x64-osx/debug/lib/libwx_osx_cocoau_richtext-3.1.a: No space left on device
Installing package wxwidgets[core]:x64-osx... done
Elapsed time for package wxwidgets:x64-osx: 15.95 min

Total elapsed time: 15.99 min

The package wxwidgets provides CMake integration:

    find_package(wxWidgets REQUIRED)
    target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS})
    target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES})
    target_compile_options(main PRIVATE ${wxWidgets_FLAGS})

/tmp/vcpkg (dev/jack/17072) $ echo $?

Expected behavior It should fail earlier? - Well it certainly shouldn't succeed…

Additional context I should really clear up some space!

NancyLi1013 commented 3 years ago

Hi @SamuelMarks

Thanks for posting this issue.

The current behavior is intended. Since the error posts after post check has been done. Everything has been finished for this port. So you see that it installs successfully.

The only thing you need to do is to free some space on your machine.

SamuelMarks commented 3 years ago

But should it not provide a non-zero exit code if space is insufficient for installation, rather than indicating success when such a state is impossible?

NancyLi1013 commented 3 years ago

Since this is happening in a critical point. If space is insufficient, which is happening before completing all building and installing processes, it will end up with failures. So this is acceptable. If you installing another port without doing any operation for space, it should not be installed successfully.

SamuelMarks commented 3 years ago

But it didn't give me failure, it gave me success. Whence it clearly failed. So this is a bug. It should of failed.