Skip to content

[nettle] fix build on apple arm macs#16595

Closed
autoantwort wants to merge 4 commits intomicrosoft:masterfrom
autoantwort:nettle-osx
Closed

[nettle] fix build on apple arm macs#16595
autoantwort wants to merge 4 commits intomicrosoft:masterfrom
autoantwort:nettle-osx

Conversation

@autoantwort
Copy link
Copy Markdown
Contributor

Describe the pull request


if(VCPKG_TARGET_IS_OSX AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
# fix for apple arm macs (see #16464)
set(VCPKG_MAKE_BUILD_TRIPLET "--host=x86_64-apple-darwin")
Copy link
Copy Markdown
Contributor

@Neumann-A Neumann-A Mar 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this an error in _vcpkg_determine_autotools_host_arch_mac ?

editted out

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah wait. it is in _vcpkg_determine_autotools_target_arch_mac

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macro(_vcpkg_determine_autotools_target_arch_mac out_var)
list(LENGTH VCPKG_OSX_ARCHITECTURES _num_osx_archs)
if(_num_osx_archs GREATER_EQUAL 2)
set(${out_var} "universal")
else()
# Better match the arch behavior of config.guess
# See: https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
if(VCPKG_OSX_ARCHITECTURES MATCHES "^(ARM|arm)64$")
set(${out_var} "aarch64")
else()
set(${out_var} "${VCPKG_OSX_ARCHITECTURES}")
endif()
endif()
unset(_num_osx_archs)
endmacro()

needs to be fixed for your use case. don't add this extra arguments in every port

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_vcpkg_determine_autotools_host_arch_mac is right. It created the following call:

Command failed: /bin/bash ./../src/48e146e54f-e59f545639.clean/configure --build=arm64-apple-darwin --host=x86_64-apple-darwin ...

The Problem is, that the nettle configure tool can not handle arm64-apple-darwin

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you only pass --host=x86_64-apple-darwin, everything works. But this is a specific problem of the nettle configure tool. E.g. the icu configure tool can handle --build=arm64-apple-darwin

Copy link
Copy Markdown
Contributor

@Neumann-A Neumann-A Mar 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not remove

set(_csc_BUILD_TRIPLET "--build=${BUILD_ARCH}-apple-darwin")

generally? Configure should be able to figure it out any way. Windows just needs it because configure is not common on windows and needs some help in figuring out the correct one which everywhere works.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configure should be able to figure it out any way.

Yeah ok. Then we can remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configure should be able to figure it out any way.

As you can see in #16596, gmp does not build without --build=... and I only have tested one package. Because of that I think it is better to stick with the solution of this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gmp on apple arm seems to be problematic anyway according to the release notes at https://gmplib.org/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it currently builds (and it is a dependency of nettle)

@JackBoosY JackBoosY added category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist labels Mar 9, 2021
@ras0219-msft
Copy link
Copy Markdown
Contributor

Waiting to merge #16596 first

@JackBoosY JackBoosY added the depends:different-pr This PR or Issue depends on a PR which has been filed label Mar 17, 2021
@autoantwort
Copy link
Copy Markdown
Contributor Author

Already fixed by #16596

@autoantwort autoantwort deleted the nettle-osx branch September 1, 2021 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist depends:different-pr This PR or Issue depends on a PR which has been filed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[nettle] fails to build an x64-osx triplet on Apple Silicon

4 participants