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

[armadillo] Fix installation path #7041

Merged
merged 6 commits into from
Jul 19, 2019

Conversation

LilyWangL
Copy link
Contributor

Remove empty path share/Armadillo in Linux.
Related PR: #7022

@LilyWangL LilyWangL added the info:internal This PR or Issue was filed by the vcpkg team. label Jun 26, 2019
@LilyWangL
Copy link
Contributor Author

I removed file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/Armadillo) on Darwin, but armadillo built failed on CI and got this error.

There should be no empty directories in /Users/vagrant/azure_agent/_work/3/s/packages/armadillo_x64-osx
The following empty directories were found:

    /Users/vagrant/azure_agent/_work/3/s/packages/armadillo_x64-osx/share/Armadillo

If a directory should be populated but is not, this might indicate an error in the portfile.
If the directories are not needed and their creation cannot be disabled, use something like this in the portfile to remove them:

    file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/a/dir ${CURRENT_PACKAGES_DIR}/some/other/dir)


Found 1 error(s). Please correct the portfile:
    /Users/vagrant/azure_agent/_work/3/s/ports/armadillo/portfile.cmake

I don't have a Darwin machine, can you help me to verify it?

@cenit
Copy link
Contributor

cenit commented Jun 26, 2019

@wangli28 i don't have my macbook with me. I can help you tomorrow

@LilyWangL
Copy link
Contributor Author

@cenit it's great! Thank you very much!

@cenit
Copy link
Contributor

cenit commented Jun 30, 2019

[user@macbook code]$ git clone https://github.com/wangli28/vcpkg vcpkg_wangli
Cloning into 'vcpkg_wangli'...
remote: Enumerating objects: 65257, done.
remote: Total 65257 (delta 0), reused 0 (delta 0), pack-reused 65257
Receiving objects: 100% (65257/65257), 16.16 MiB | 8.74 MiB/s, done.
Resolving deltas: 100% (41278/41278), done.
[user@macbook code]$ cd vcpkg_wangli/
[user@macbook vcpkg_wangli (master)]$ git checkout dev/Lily/issue680802
Branch 'dev/Lily/issue680802' set up to track remote branch 'dev/Lily/issue680802' from 'origin'.
Switched to a new branch 'dev/Lily/issue680802'
[user@macbook vcpkg_wangli (dev/Lily/issue680802)]$ ./bootstrap-vcpkg.sh 
Downloading cmake...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   621    0   621    0     0   1734      0 --:--:-- --:--:-- --:--:--  1734
100 31.9M  100 31.9M    0     0  2832k      0  0:00:11  0:00:11 --:--:-- 5265k
Downloading cmake... done.
Extracting cmake...
Extracting cmake... done.
Downloading ninja...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   602    0   602    0     0   1835      0 --:--:-- --:--:-- --:--:--  1829
100 77284  100 77284    0     0  76292      0  0:00:01  0:00:01 --:--:-- 76292
Downloading ninja... done.
Extracting ninja...
Extracting ninja... done.
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/bin/g++-9
-- Check for working CXX compiler: /usr/local/bin/g++-9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/code/vcpkg_wangli/toolsrc/build.rel
[44/64] Building CXX object CMakeFiles/vcpkg.dir/src/vcpkg/export.cpp.o
In file included from ../include/vcpkg/base/view.h:3,
                 from ../include/vcpkg/base/strings.h:7,
                 from ../include/vcpkg/base/checks.h:5,
                 from ../include/vcpkg/base/expected.h:3,
                 from ../include/vcpkg/packagespec.h:3,
                 from ../include/vcpkg/build.h:3,
                 from ../include/vcpkg/commands.h:3,
                 from ../src/vcpkg/export.cpp:3:
../include/vcpkg/base/span.h: In instantiation of 'constexpr vcpkg::Span<T>::Span(std::initializer_list<_Tp>) [with T = const vcpkg::Export::handle_export_command_arguments(const vcpkg::VcpkgCmdArguments&, const vcpkg::Triplet&)::OptionPair]':
../src/vcpkg/export.cpp:368:26:   required from here
../include/vcpkg/base/span.h:26:97: warning: initializing 'vcpkg::Span<const vcpkg::Export::handle_export_command_arguments(const vcpkg::VcpkgCmdArguments&, const vcpkg::Triplet&)::OptionPair>::m_ptr' from 'std::initializer_list<const vcpkg::Export::handle_export_command_arguments(const vcpkg::VcpkgCmdArguments&, const vcpkg::Triplet&)::OptionPair>::begin' does not extend the lifetime of the underlying array [-Winit-list-lifetime]
   26 |         constexpr Span(std::initializer_list<T> l) noexcept : m_ptr(l.begin()), m_count(l.size()) {}
      |                                                                                                 ^
[64/64] Linking CXX executable vcpkg
[user@macbook vcpkg_wangli (dev/Lily/issue680802)]$ ./vcpkg install armadillo
The following packages will be built and installed:
    armadillo[core]:x64-osx
Starting package 1/1: armadillo:x64-osx
Building package armadillo[core]:x64-osx...
-- Downloading https://gitlab.com/conradsnicta/armadillo-code/-/archive/f00d3225b1c005775044369723f31cecc3cd6569/armadillo-code-f00d3225b1c005775044369723f31cecc3cd6569.tar.gz...
-- Extracting source /Users/user/code/vcpkg_wangli/downloads/conradsnicta-armadillo-code-f00d3225b1c005775044369723f31cecc3cd6569.tar.gz
-- Applying patch remove_custom_modules.patch
-- Using source at /Users/user/code/vcpkg_wangli/buildtrees/armadillo/src/ecc3cd6569-c7b5ad093a
-- Configuring x64-osx-dbg
-- Configuring x64-osx-rel
-- Building x64-osx-dbg
-- Building x64-osx-rel
-- Installing: /Users/user/code/vcpkg_wangli/packages/armadillo_x64-osx/share/armadillo/copyright
-- Performing post-build validation
-- Performing post-build validation done
Building package armadillo[core]:x64-osx... done
Installing package armadillo[core]:x64-osx...
Installing package armadillo[core]:x64-osx... done
Elapsed time for package armadillo:x64-osx: 9.843 s

Total elapsed time: 9.843 s

The package armadillo:x64-osx provides CMake targets:

    find_package(Armadillo CONFIG REQUIRED)
    target_link_libraries(main PRIVATE armadillo)

[user@macbook vcpkg_wangli (dev/Lily/issue680802)]$ ll installed/x64-osx/share/Armadillo/
total 64
-rw-r--r--  1 user  staff    753 Jun 30 21:18 ArmadilloConfig.cmake
-rw-r--r--  1 user  staff    369 Jun 30 21:18 ArmadilloConfigVersion.cmake
-rw-r--r--  1 user  staff    814 Jun 30 21:18 ArmadilloLibraryDepends-debug.cmake
-rw-r--r--  1 user  staff    812 Jun 30 21:18 ArmadilloLibraryDepends-release.cmake
-rw-r--r--  1 user  staff   3361 Jun 30 21:18 ArmadilloLibraryDepends.cmake
-rw-r--r--  1 user  staff  11560 Jun 30 21:18 copyright

cannot reproduce locally

@LilyWangL
Copy link
Contributor Author

@Rastaban, The port installed failed on CI and installed successfully on the Stefano's macbook. Can you help me to confirm it?

@Rastaban
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Rastaban
Copy link
Contributor

The filesystem used on the Mac CI machines is case sensitive, so it would have the same issue as Linux. I think on the Mac it lets you select case sensitivity when you format the drive. Can you change the logic so it checks if the directory is empty instead of checking if you are on Linux (along with a comment on case sensitivity)?

@LilyWangL
Copy link
Contributor Author

Related issue: #7081

@cenit
Copy link
Contributor

cenit commented Jul 18, 2019

sorry but your new correction resume the old broken behaviour. Since APFS is case-insensitive by default, your line now deletes the share/armadillo folder also!

@Rastaban
Copy link
Contributor

I was thinking something more like this https://stackoverflow.com/questions/27302142/cmake-detect-empty-directory-during-build-time

file(GLOB SHARE_CONTENT ${CURRENT_PACKAGES_DIR}/share/Armadillo)
list(LENGTH SHARE_CONTENT SHARE_LEN)
if(SHARE_LEN EQUAL 0)
    # On case sensitive file system there is an extra empty directory created that should be removed
    file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/Armadillo)
endif()

@LilyWangL LilyWangL marked this pull request as ready for review July 19, 2019 07:18
@Rastaban Rastaban merged commit cf9820b into microsoft:master Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants