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

[gmp:x64-windows] build failure #12237

Closed
ghost opened this issue Jul 3, 2020 · 10 comments · Fixed by #13805 or #14003
Closed

[gmp:x64-windows] build failure #12237

ghost opened this issue Jul 3, 2020 · 10 comments · Fixed by #13805 or #14003
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@ghost
Copy link

ghost commented Jul 3, 2020

Host Environment

  • OS: [Microsoft Windows [Version 10.0.19041.331]]
  • Compiler: Visual Studio 2019 Version: 16.6.3 VS Tools Version: 14.26.28801

To Reproduce
Steps to reproduce the behavior:
SYSTEM@ANDROMEDA 07/02/2020 21:20:49 D:\Git\vs2019.prod
->vcpkg install gmp[core]:x64-windows nettle[core]:x64-windows

Additionally, attach any relevant sections from the log files above.

Failure logs

  • Cut and past the appropriate build messages from the console output.
    Computing installation plan...
    The following packages will be built and installed:
    gmp[core]:x64-windows
    nettle[core]:x64-windows
    Starting package 1/2: gmp:x64-windows
    Building package gmp[core]:x64-windows...
    -- Using cached D:/Git/vcpkg.downloads/ShiftMediaProject-gmp-e140dfc8668e96d7e56cbd46467945adcc6b3cc4.tar.gz
    -- Extracting source D:/Git/vcpkg.downloads/ShiftMediaProject-gmp-e140dfc8668e96d7e56cbd46467945adcc6b3cc4.tar.gz
    -- Applying patch vs.build.patch
    -- Applying patch runtime.patch
    -- Applying patch prefix.patch
    -- Using source at D:/Git/vs2019.prod/buildtrees/gmp/src/adcc6b3cc4-2b6258d695
    -- Building SMP/libgmp.sln for Release
    -- Building SMP/libgmp.sln for Debug
    -- Installing: D:/Git/vs2019.prod/packages/gmp_x64-windows/share/gmp/copyright
    CMake Error at ports/gmp/portfile.cmake:61 (file):
    file RENAME failed to rename

D:/Git/vs2019.prod/buildtrees/gmp/x64-windows-rel/adcc6b3cc4-2b6258d695/msvc/include

to

D:/Git/vs2019.prod/packages/gmp_x64-windows/include

because: File exists

Call Stack (most recent call first):
scripts/ports.cmake:76 (include)

Error: Building package gmp:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: gmp:x64-windows
Vcpkg version: 2020.02.04-nohash

Additional context
It appears gmp is trying to install its header (include) files in <vcpkg-root>\installed\x64-windows\include\include -- which fails because I also have the LLGL port installed and it also has installed its header (include) files into <vcpkg-root>\installed\x64-windows\include\include\LLGL (a separate issue I will submit under a separate issue.

Both are incorrect, I believe the gmp port files should just be in the <vcpkg-root>\install\x64-windows\include and LLGL port should be in <vcpkg-port>\installed\x64-windows\include\LLGL.

In other words there is one too many include in the file destination paths.

@JackBoosY JackBoosY changed the title [<gmp>] build failure [gmp:x64-windows] build failure Jul 3, 2020
@LilyWangL LilyWangL added the requires:repro The issue is not currently repro-able label Jul 3, 2020
@LilyWangL
Copy link
Contributor

Thanks for posting this issue. This error may be a CMake bug, I can't reproduce it locally. I clone new VCPKG and install gmp[core]:x64-windows successfully.
image

@ghost
Copy link
Author

ghost commented Jul 3, 2020

@LilyWangL Yes it will install fine if port LLGL is not installed (at least on vs2017, I still can not install it on vs2019 as it keeps saying the <vcpkg-root>\packages\gmp_x64-windows already exists even though it does not), but look in the <vcpkg-root>\installed\<triplet>\include folder. It will have another include folder within it containing the 2 gmp header files (gmp.h and gmpxx.h). The second embedded include folder should either be named gmp or the header files should be up one level, not in an include\include folder.
Also try installing port LLGL port first with all its features and then try to install gmp again.

@ghost
Copy link
Author

ghost commented Jul 3, 2020

@LilyWangL cc: @JackBoosY - I finally was able to get gmp to install by changing file portfile.cmake from:
https://github.com/microsoft/vcpkg/blob/master/ports/gmp/portfile.cmake#L61
file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" "${CURRENT_PACKAGES_DIR}/include")
to:
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
so now the port install does not try to install the gmp.h and gmpxx.h in the <vcpkg-root>\installed\x64-windows\include\include but just <vcpkg-root>\installed\x64-windows\include now.
I am still trying to figure out port nettle, and I am still not sure why LLGL is installing its files in <vcpkg-root>\installed\x64-windows\include\include\LLGL?

@LilyWangL
Copy link
Contributor

Did you install cmake manually before cloning VCPKG? I install port LLGL and its all features, and I can install gmp:x64-windows successfully. If I modify file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" "${CURRENT_PACKAGES_DIR}/include")
to:
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" DESTINATION "${CURRENT_PACKAGES_DIR}"), gmp:x64-windows will build failed. You can see my steps by the following picture.

  • Cloning new VCPKG:
    image

  • Installing llgl[opengl,direct3d11]:x64-windows:
    image

  • Installing gmp:x64-windows:
    image

  • Modifying portfile.cmake and rebuild gmp:x64-windows:
    image

@ghost
Copy link
Author

ghost commented Jul 6, 2020

Did you install cmake manually before cloning VCPKG? Yes, CMake is already installed, 3.17.3 x64 at the moment.

I have created my own portfile.cmake for gmp, nettle as they are the only 2 so far that keep failing if left in the vcpkg configuration being downloaded, well besides adding SKIP_CLEAN to all the ports using vcpkg_install_msbuild as I want to keep the source after build.

The other differences I can think of would be vcpkg itself is built 64 bit (.\bootstrap-vcpkg.bat -verbose -disableMetrics -win64 -withVSPath "'%VCPKG_VISUAL_STUDIO_PATH%'"), along with _IsNativeEnvironment=true and PreferredToolArchitecture=x64 is fed into vcpkg env via the VCPKG_ENV_PASSTHROUGH\VCPKG_KEEP_ENV_VARS forcing VS to use the 64-bit versions of all the compilers/linkers (except dumpbin which is hard-coded in vcpkg for some reason).

Only other difference could be... I am not sure, <vcpkg-root>\buildtrees is a hard disk junction symlink physically residing on another drive, but if that was the cause, every port having a rename would give an issue.

In other words, I use as much as a true 64-bit build environment as can be to create 64-bit binaries, as we have already seen in both shiva (64-bit python #7411) and nettle (64-bit yasm #12240) ports need 64-bit tools to properly build the 64-bit binaries

@JackBoosY JackBoosY added category:port-bug The issue is with a library, which is something the port should already support and removed requires:repro The issue is not currently repro-able labels Jul 8, 2020
@JackBoosY JackBoosY self-assigned this Jul 8, 2020
@JackBoosY JackBoosY linked a pull request Jul 8, 2020 that will close this issue
@Neumann-A
Copy link
Contributor

Only other difference could be... I am not sure, \buildtrees is a hard disk junction symlink physically residing on another drive, but if that was the cause, every port having a rename would give an issue.

I hear symlinks. Maybe @BillyONeal can comment since there were also issues using symlinks when rewriting vcpkg's CI and he might have encountered them all?

@BillyONeal
Copy link
Member

@Neumann-A The issues we were having with symlinks were primarily infrastructure issues, not issues with any individual ports; e.g. problems with updating where the symlinks target or symlinks getting erroneously followed by 'git clean'. The solution was to cut symlinks out of the equation entirely, but the tool should still work in their presence.

@BillyONeal
Copy link
Member

The problem that we're seeing is of the form:

D:\installed\x86-windows\share\vs-yasm\yasm.targets(50,5): error MSB3721: The command ""D:/downloads/tools/yasm/1.3.0.6/x86/"yasm.exe -Xvc -f win32 -o "D:\buildtrees\gmp\x86-windows-rel\adcc6b3cc4-2b6258d695.clean\SMP\obj\ReleaseDLL\Win32\libgmp\addmul_1.obj" -rraw -pgas "D:\buildtrees\gmp\x86-windows-rel\adcc6b3cc4-2b6258d695.clean\SMP\mpn\x86\addmul_1.s"" exited with code -1073741819.

https://james.darpinian.com/decoder/?q=-1073741819 says 'probably STATUS_ACCESS_VIOLATION. i.e. a wild pointer in yasm.exe itself. That we see such wildly varying results with the same input on different machines also suggests a wild pointer.

@ghost
Copy link
Author

ghost commented Jul 14, 2020

I close, I no longer use product.

@ghost ghost closed this as completed Jul 14, 2020
@BillyONeal
Copy link
Member

@ghost Reopening because I believe @JackBoosY was investigating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment