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

Android prefab broken due to emscripten support #12359

Open
AlexAUT opened this issue Jul 10, 2020 · 7 comments · May be fixed by microsoft/vcpkg-tool#1344
Open

Android prefab broken due to emscripten support #12359

AlexAUT opened this issue Jul 10, 2020 · 7 comments · May be fixed by microsoft/vcpkg-tool#1344
Assignees
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@AlexAUT
Copy link

AlexAUT commented Jul 10, 2020

Describe the bug
It is currently not possible to create android prefabs (AAR) because of the emscripten support.

During the export command vcpkg tries to extract triplet information by running cmake with the toolchain file. However, the toolchain for emscripten returns a FATAL_ERROR in case emscripten is not present/installed. This results in vcpkg aborting.

A fix for this particular issue is to remove the emscripten present checks in the triplet, but this may break other things?

Environment

  • OS: Linux (should not matter)
  • Compiler: gcc 10.1, newest android ndk (should not matter)

To Reproduce
Steps to reproduce the behavior:

  1. Do not install emscripten / remove from PATH
  2. Try the android AAR example
    2.1 Add android triplets
    2.2 ./vcpkg install jsoncpp:arm-android jsoncpp:arm64-android jsoncpp:x64-android jsoncpp:x86-android
    2.3 ./vcpkg export --triplet arm64-android jsoncpp --prefab --prefab-debug

Expected behavior
Should create the AAR prefab for jsoncpp

Failure logs

./vcpkg export --triplet arm64-android jsoncpp --prefab --prefab-debug
The following packages are already built and will be exported:
    jsoncpp:arm64-android
d8187afd-ea4a-4fc3-9aa4-a6782e1ed9af
CMake Error at buildtrees/29.vcpkg_tags.cmake:8 (message):
  The EMSDK environment variable must be defined
Call Stack (most recent call first):
  scripts/vcpkg_get_tags.cmake:3 (vcpkg_triplet_file)
  buildtrees/29.vcpkg_tags.cmake:23 (vcpkg_get_tags)

Additional context
Add any other context about the problem here.
The first commit where this problem is present is the merge of the emscripten PR: a6257ac

@PhoebeHui
Copy link
Contributor

cc @MoAlyousef

@PhoebeHui PhoebeHui added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Jul 15, 2020
@MoAlyousef
Copy link
Contributor

I could remove the env checks in the cmake script. I don't see why vcpkg would check for it during an export for another triplet.

@ras0219
Copy link
Contributor

ras0219 commented Dec 5, 2020

This looks like a bug in the prefab exporter; it should not be iterating through all available triplets and attempting to "divine" the correct ones:

for (auto& triplet_file : available_triplets)

Instead, the user should explicitly label each of the required architectures; perhaps via individual options:

./vcpkg export jsoncpp --prefab-x86-triplet=x86-android --prefab-x86_64-triplet=x64-android ...

We'd be happy to review a PR fixing this!

+@atkawa7 as the original author

@PhoebeHui PhoebeHui added the category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. label Dec 7, 2020
@rpavlik
Copy link
Contributor

rpavlik commented Dec 8, 2020

Note that if you do "work around" it in this way, or specify something like this, it still fails:

 ./vcpkg export jsoncpp:x64-android jsoncpp:x86-android jsoncpp:arm-android jsoncpp:arm64-android --prefab  --prefab-debug
The following packages are already built and will be exported:
    jsoncpp:x64-android
    jsoncpp:x86-android
    jsoncpp:arm-android
    jsoncpp:arm64-android

Currently supported on android triplets

I've tracked down that the cmake_system_name that's being checked is empty, even though my triplet files match the instructions.

@atkawa7
Copy link
Contributor

atkawa7 commented Dec 9, 2020

@ras0219 @ras0219-msft I don't have time to look into this but based on my previous conversation with @strega-nil. She advised I do not pre-define triplets since users might define their own custom ones hence ended up loading available triplets.

Since an environment variable is missing for emscripten I am confused why vcpkg marks it as available. Shouldn't there be a check that marks this triplet as not available since all the requirements required for building it are not there. I am not sure if that's similar with platform specific triplets i.e you can't load windows triplets on linux/bsd variants.

One shouldn't check the triplet here, since someone might define their own android triplet.

Originally posted by @strega-nil in #10271 (comment).

@rpavlik
Copy link
Contributor

rpavlik commented Sep 30, 2022

Additionally, it shouldn't require all of the triplets: you can build an aar/prefab with as few architectures as you wish.

@dmn-star
Copy link

dmn-star commented Feb 9, 2024

Are there any news or possible solutions?

dmn-star added a commit to dmn-star/vcpkg-tool that referenced this issue Feb 10, 2024
@dmn-star dmn-star linked a pull request Feb 10, 2024 that will close this issue
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:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants