-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[vcpkg baseline] [vs-yasm] Build yasm instead of downloading it to work around memory corruption bugs in yasm itself. #14003
Merged
Merged
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
51f7551
Remove trailing slashes from the URL in `vcpkg create`.
BillyONeal f51f572
[vs-yasm] Workaround yasm memory corruption bugs by building the tool…
BillyONeal 32d24ce
Install yasm-tool:x86-windows first.
BillyONeal d76ea13
Format-manifest.
BillyONeal ad2152e
Building yasm needs python.
BillyONeal c331fec
yasm-tool not yaml-tool.
BillyONeal 6a23857
yaml always needs to build dynamic. (It could be static but this pick…
BillyONeal 38c7512
Merge remote-tracking branch 'origin/master' into build_yasm
BillyONeal 35dc2ad
Fix crosscompilation.
BillyONeal 5ef1f1d
Treat x64 as a crosscompiler for yasm due to:
BillyONeal 8c901ec
elseif
BillyONeal b234c6f
[yasm-tool-helper][mpg123][libvpx][nettle][gmp] Replace uses of vcpkg…
ras0219-msft 8fc4ceb
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal 8726216
Merge branch 'build_yasm' of github.com:ras0219/vcpkg into build_yasm
BillyONeal 11b9b34
Merge remote-tracking branch 'origin/master' into build_yasm
BillyONeal 1c51883
Format
BillyONeal 001b88d
Merge remote-tracking branch 'origin/master' into build_yasm
BillyONeal d3ea0f8
yasm-tool needs x86
BillyONeal 250329f
Fix Robert code review comments.
BillyONeal ad56f16
Merge remote-tracking branch 'origin/master' into build_yasm
BillyONeal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
{ | ||
"name": "gmp", | ||
"version-string": "6.2.0", | ||
"port-version": 3, | ||
"port-version": 4, | ||
"description": "The GNU Multiple Precision Arithmetic Library", | ||
"homepage": "https://gmplib.org", | ||
"dependencies": [ | ||
{ | ||
"name": "vs-yasm", | ||
"platform": "windows" | ||
}, | ||
{ | ||
"name": "yasm-tool-helper", | ||
"platform": "windows" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
Source: libvpx | ||
Version: 1.9.0 | ||
Port-Version: 2 | ||
Port-Version: 3 | ||
Homepage: https://github.com/webmproject/libvpx | ||
Description: The reference software implementation for the video coding formats VP8 and VP9. | ||
Supports: !(uwp&arm) | ||
Build-Depends: yasm-tool-helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Source: mpg123 | ||
Version: 1.25.8 | ||
Port-Version: 13 | ||
Port-Version: 14 | ||
Homepage: https://sourceforge.net/projects/mpg123/ | ||
Description: mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers 1, 2 and 3 (MPEG 1.0 layer 3 also known as MP3). | ||
Build-Depends: yasm-tool-helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/yasm.props b/yasm.props | ||
index 06efe7a..10f6309 100644 | ||
--- a/yasm.props | ||
+++ b/yasm.props | ||
@@ -6,15 +6,15 @@ | ||
<YASMAfterTargets>CustomBuild</YASMAfterTargets> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
- <YasmPath Condition= "'$(YASMPATH)' == ''">$(VCInstallDir)</YasmPath> | ||
+ <YasmPath Condition= "'$(YasmPath)' == ''">$(VCInstallDir)</YasmPath> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup> | ||
<YASM> | ||
<Preprocessor>0</Preprocessor> | ||
<Parser>0</Parser> | ||
<ObjectFileName>$(IntDir)%(FileName).obj</ObjectFileName> | ||
- <CommandLineTemplate Condition="'$(Platform)' == 'Win32'">"$(YasmPath)"yasm.exe -Xvc -f win32 [AllOptions] [AdditionalOptions] "%(FullPath)"</CommandLineTemplate> | ||
- <CommandLineTemplate Condition="'$(Platform)' == 'x64'">"$(YasmPath)"yasm.exe -Xvc -f win64 [AllOptions] [AdditionalOptions] "%(FullPath)"</CommandLineTemplate> | ||
+ <CommandLineTemplate Condition="'$(Platform)' == 'Win32'">"$(YasmPath)" -Xvc -f win32 [AllOptions] [AdditionalOptions] "%(FullPath)"</CommandLineTemplate> | ||
+ <CommandLineTemplate Condition="'$(Platform)' == 'x64'">"$(YasmPath)" -Xvc -f win64 [AllOptions] [AdditionalOptions] "%(FullPath)"</CommandLineTemplate> | ||
<CommandLineTemplate Condition="'$(Platform)' != 'Win32' and '$(Platform)' != 'x64'">echo YASM not supported on this platform | ||
exit 1</CommandLineTemplate> | ||
<ExecutionDescription>%(Identity)</ExecutionDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "vs-yasm", | ||
"version-string": "0.5.0", | ||
"port-version": 1, | ||
"description": "Provides Visual Studio integration for the YASM assembler.", | ||
"homepage": "https://github.com/ShiftMediaProject/VSYASM", | ||
"supports": "windows & !arm" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
configure_file(${CMAKE_CURRENT_LIST_DIR}/yasm-tool-helper.cmake ${CURRENT_PACKAGES_DIR}/share/yasm-tool-helper/yasm-tool-helper.cmake COPYONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "yasm-tool-helper", | ||
"version-string": "2020-10-12", | ||
"description": "This port provides helper functions for ports needing to consume YASM", | ||
"homepage": "https://github.com/Microsoft/vcpkg", | ||
"dependencies": [ | ||
{ | ||
"name": "yasm-tool", | ||
"platform": "x86 & windows" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
function(yasm_tool_helper) | ||
cmake_parse_arguments(PARSE_ARGV 0 a | ||
"APPEND_TO_PATH;PREPEND_TO_PATH" | ||
"OUT_VAR" | ||
"" | ||
) | ||
|
||
if(CMAKE_HOST_WIN32) | ||
if(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP) | ||
# Native compilation | ||
set(YASM "${CURRENT_INSTALLED_DIR}/tools/yasm-tool/yasm.exe") | ||
else() | ||
# Cross compilation | ||
get_filename_component(YASM "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/yasm-tool/yasm.exe" ABSOLUTE) | ||
if(NOT EXISTS "${YASM}") | ||
message(FATAL_ERROR "Cross-targetting and x64 ports requiring yasm require the x86-windows yasm-tool to be available. Please install yasm-tool:x86-windows first.") | ||
endif() | ||
endif() | ||
else() | ||
vcpkg_find_acquire_program(YASM) | ||
endif() | ||
|
||
if(a_APPEND_TO_PATH) | ||
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) | ||
vcpkg_add_to_path("${YASM_EXE_PATH}") | ||
endif() | ||
if(a_PREPEND_TO_PATH) | ||
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) | ||
vcpkg_add_to_path(PREPEND "${YASM_EXE_PATH}") | ||
endif() | ||
if(a_OUT_VAR) | ||
set(${a_OUT_VAR} "${YASM}" PARENT_SCOPE) | ||
endif() | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,37 @@ | ||||||
vcpkg_fail_port_install(MESSAGE "The yasm-tool port currently only supports Windows" ON_TARGET "Linux" "OSX" ON_ARCH "x64" "arm") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) | ||||||
set(VCPKG_LIBRARY_LINKAGE static) | ||||||
|
||||||
vcpkg_find_acquire_program(PYTHON3) | ||||||
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) | ||||||
vcpkg_add_to_path("${PYTHON3_DIR}") | ||||||
|
||||||
vcpkg_from_github( | ||||||
OUT_SOURCE_PATH SOURCE_PATH | ||||||
REPO yasm/yasm | ||||||
REF 009450c7ad4d425fa5a10ac4bd6efbd25248d823 # 7.0.3 plus bugfixes for https://github.com/yasm/yasm/issues/153 | ||||||
SHA512 a542577558676d11b52981925ea6219bffe699faa1682c033b33b7534f5a0dfe9f29c56b32076b68c48f65e0aef7c451be3a3af804c52caa4d4357de4caad83c | ||||||
) | ||||||
|
||||||
vcpkg_configure_cmake( | ||||||
SOURCE_PATH ${SOURCE_PATH} | ||||||
PREFER_NINJA | ||||||
OPTIONS | ||||||
-DENABLE_NLS=OFF | ||||||
-DYASM_BUILD_TESTS=OFF | ||||||
) | ||||||
|
||||||
vcpkg_install_cmake() | ||||||
|
||||||
vcpkg_copy_tools(TOOL_NAMES yasm) | ||||||
|
||||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") | ||||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") | ||||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib") | ||||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include") | ||||||
|
||||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) | ||||||
foreach(LICENSE Artistic.txt BSD.txt GNU_GPL-2.0 GNU_LGPL-2.0) | ||||||
file(COPY "${SOURCE_PATH}/${LICENSE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||||||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "yasm-tool", | ||
"version-string": "2020-10-12", | ||
"description": "A modular assembler. This port is intended to build other ports and should not be used directly.", | ||
"homepage": "http://yasm.tortall.net/", | ||
"supports": "windows & x86" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a port-version update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was intentional because there are no changes in the output but...