Skip to content

Commit

Permalink
Merge pull request #139 from rainers/master
Browse files Browse the repository at this point in the history
Visual D 1.3.1
  • Loading branch information
rainers authored Oct 9, 2022
2 parents e67848f + 660d701 commit f182f4e
Show file tree
Hide file tree
Showing 21 changed files with 306 additions and 90 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: build visuald

on: [push, pull_request]

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: src/visuald_vs10.vcxproj

# Configuration type to build.
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64
BUILD_PLATFORM_TOOLSET: v142

jobs:
build:
# windows-latest doesn't have .net framework 4.0
runs-on: windows-2019

steps:
- name: Checkout visuald
uses: actions/checkout@v3
with:
path: visuald/trunk
submodules: recursive
# - name: Checkout cv2pdb
# uses: actions/checkout@v3
# with:
# repository: rainers/cv2pdb
# path: cv2pdb/trunk
# - name: Checkout mago
# uses: actions/checkout@v3
# with:
# repository: rainers/mago
# path: mago
- name: Prepare D compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: dmd-2.098.1
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Setup VS environment
uses: seanmiddleditch/gha-setup-vsdevenv@v4
- name: Download Visual D
uses: supplypike/setup-bin@v1
with:
uri: 'https://github.com/dlang/visuald/releases/download/v1.3.0/VisualD-v1.3.0.exe'
name: 'VisualD-v1.3.0.exe'
version: '1.3.0'
command: ./VisualD-v1.3.0.exe /S
- name: Register visuald
run: |
reg add "HKLM\SOFTWARE\DMD" /v "InstallationDir" /t REG_SZ /d "c:\hostedtoolcache\windows\dc\dmd-2.098.1\x64" /reg:32 /f
reg add "HKLM\SOFTWARE\VisualD" /v "DMDInstallDir" /t REG_SZ /d "c:\hostedtoolcache\windows\dc\dmd-2.098.1\x64\dmd2" /reg:32 /f
- name: Build visuald
working-directory: visuald/trunk
run: nmake d_modules
- name: Upload binaries
uses: actions/upload-artifact@v2
if: failure()
with:
name: bin
path: visuald/trunk/bin
10 changes: 9 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,15 @@ Version history
* bugzilla 22764: now searches the 32-bit registry hive for install paths of DMD and LDC
* bugzilla 23069: mago crashing when debugging VARIANT data type in VS 2022
* bugzilla 23043: project templates missing in VS 2022 until configuration manually updated
* semantic analysis: without a project loaded, a D file is now analized using the compile options
* semantic analysis: without a project loaded, a D file is now analyzed using the compile options
of "Compile and Run" with an import path derived from the module declaration.
* visualdproj: exit code printed for failed commands
* cv2pdb 0.52: improved DWARF support for non-contiguous functions, bug fixes

2022-10-09 version 1.3.1
* full installer now bundled with DMD 2.100.2 and LDC 1.30.0
* dmdserver: fixed memory leak
* fixed building against WinSDK 10.0.22621.0
* fixed projects no longer considered failing
* D files in VC projects failed to build in VS 2022 17.3 and 17.4, added separate versions of
dbuild.17.x.dll linked respective Microsoft.Build.CPPTasks.Common.dll
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ dbuild17_1:
dbuild17_2:
cd msbuild\dbuild && $(MSBUILD) dbuild.csproj /p:Configuration=Release-v17_2;Platform=AnyCPU /t:Rebuild

dbuild17_3:
cd msbuild\dbuild && $(MSBUILD) dbuild.csproj /p:Configuration=Release-v17_3;Platform=AnyCPU /t:Rebuild

dbuild17_4:
cd msbuild\dbuild && $(MSBUILD) dbuild.csproj /p:Configuration=Release-v17_4;Platform=AnyCPU /t:Rebuild

dbuild17_all: dbuild17 dbuild17_1 dbuild17_2 dbuild17_3 dbuild17_4

mago:
cd ..\..\mago && devenv /Build "Release|Win32" /Project "MagoNatDE" magodbg_2010.sln
cd ..\..\mago && devenv /Build "Release|x64" /Project "MagoRemote" magodbg_2010.sln
Expand Down Expand Up @@ -196,7 +204,9 @@ install_vs_no_vs2017: install_modules fake_dparser cv2pdb mago magogc dbuild12

install_vs_only_vs2017: install_modules dparser dparser_test cv2pdb_vs15 mago_vs15 magogc fake_dbuild12 fake_dbuild14 dbuild15 install_only

install_modules: prerequisites visuald_vs visuald_vs_x64 vdserver dmdserver vdextension vdext15 visualdwizard dcxxfilt
install_modules: d_modules vdextension vdext15 visualdwizard dcxxfilt

d_modules: prerequisites visuald_vs visuald_vs_x64 vdserver dmdserver

install_only:
if not exist ..\downloads\nul md ..\downloads
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 0
#define VERSION_REVISION 1
#define VERSION_BETA
#define VERSION_BUILD 0
53 changes: 48 additions & 5 deletions c2d/idl2d.d
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,22 @@ class idl2d
case "RtlFlushNonVolatileMemoryRanges":
return 1;

// SDK 10.0.22621.0
case "WIN_NOEXCEPT":
case "ReadLongPtrAcquire":
case "ReadLongPtrNoFence":
case "ReadLongPtrRaw":
case "WriteLongPtrRelease":
case "WriteLongPtrNoFence":
case "WriteLongPtrRaw":
case "ReadULongPtrAcquire":
case "ReadULongPtrNoFence":
case "ReadULongPtrRaw":
case "WriteULongPtrRelease":
case "WriteULongPtrNoFence":
case "WriteULongPtrRaw":
return 1;

default:
break;
}
Expand Down Expand Up @@ -1086,6 +1102,8 @@ version(all)
while(replaceTokenSequence(tokens, "$_not $_ident($_ident1)($expr)", "$_not cast($_ident1)($expr)", true) > 0) {}
replaceTokenSequence(tokens, "$_not $_ident($_ident1)cast", "$_not cast($_ident1)cast", true);
replaceTokenSequence(tokens, "$_not $_ident($_ident1*)$_not_semi;", "$_not cast($_ident1*)$_not_semi", true);
replaceTokenSequence(tokens, "$_not $_ident(const $_ident1*)$_not_semi;", "$_not cast(const $_ident1*)$_not_semi", true);
replaceTokenSequence(tokens, "$_not $_ident(volatile const $_ident1*)$_not_semi;", "$_not cast(volatile const $_ident1*)$_not_semi", true);
replaceTokenSequence(tokens, "$_not $_ident(struct $_ident1*)$_not_semi;", "$_not cast(struct $_ident1*)$_not_semi", true);
replaceTokenSequence(tokens, "$_not $_ident($_ident1 $_ident2*)", "$_not cast($_ident1 $_ident2*)", true);
replaceTokenSequence(tokens, "HRESULT cast", "HRESULT", true);
Expand Down Expand Up @@ -1270,6 +1288,11 @@ version(all)
replaceTokenSequence(tokens, "#ifndef TRUE\n#define TRUE$def\n#endif\n", "#define TRUE 1\n", false);
}

if(currentModule == "memoryapi")
{
replaceTokenSequence(tokens, "typedef struct DECLSPEC_ALIGN($_num)", "align($_num) typedef struct", true);
}

if(currentModule == "winnt")
{
replaceTokenSequence(tokens, "#if defined(MIDL_PASS)\ntypedef struct $_ident {\n"
Expand Down Expand Up @@ -1299,6 +1322,13 @@ version(all)

replaceTokenSequence(tokens, "RtlZeroMemory($dest,$length)",
"import core.stdc.string: memset; memset($dest,0,$length)", true);
// win 10.0.22621.0: duplicate definition
replaceTokenSequence(tokens, "POWER_SETTING_ALTITUDE, *PPOWER_SETTING_ALTITUDE;",
"*PPOWER_SETTING_ALTITUDE;", true);
replaceTokenSequence(tokens, "FORCEINLINE BYTE ReadUCharAcquire $code WriteULong64Raw($args) { $code2 }",
"/+ $* +/", true);
replaceTokenSequence(tokens, "FORCEINLINE PVOID ReadPointerAcquire $code WritePointerRaw($args) { $code2 }",
"/+ $* +/", true);
}

if(currentModule == "commctrl")
Expand Down Expand Up @@ -1385,7 +1415,10 @@ version(all)
// type name and field name identical
replaceTokenSequence(tokens, "ImageMoniker ImageMoniker;", "ImageMoniker mImageMoniker;", true);
}

if(currentModule.startsWith("webprop"))
{
replaceTokenSequence(tokens, "importlib(\"Microsoft.VisualStudio.Interop.tlb\");", "/+ $* +/;", true);
}
// select unicode version of the API when defining without postfix A/W
replaceTokenSequence(tokens, "#ifdef UNICODE\nreturn $_identW(\n#else\nreturn $_identA(\n#endif\n",
" return $_identW(", false);
Expand Down Expand Up @@ -1573,6 +1606,8 @@ version(all)
enums[tok.text] = true;
break;
}
if(indexOf(tok.pretext, "\\\n") >= 0)
tok.pretext = replace(tok.pretext, "\\\n", "\n");
prevtext = tok.text;
++tokIt;
}
Expand Down Expand Up @@ -1653,6 +1688,10 @@ version(none) version(vsi)
replaceTokenSequence(tokens, "InterlockedCompareExchange($args __in LONG ExChange, __in LONG Comperand);", "$* +/", true);
replaceTokenSequence(tokens, "InterlockedOr(&Barrier, 0);", "InterlockedExchangeAdd(&Barrier, 0);", true); // InterlockedOr exist only as intrinsic
}
if (currentModule == "winerror")
{
replaceTokenSequence(tokens, "HRESULT HRESULT_FROM_SETUPAPI($args) { $code }", "/+ $* +/", true);
}
if(currentModule == "ocidl")
{
// move alias out of interface declaration, it causes circular definitions with dmd 2.065+
Expand Down Expand Up @@ -2134,6 +2173,8 @@ else
TokenIterator inAlias = tokens.end();
for(TokenIterator tokIt = tokens.begin(); !tokIt.atEnd(); ++tokIt)
{
bool isAssign(string txt) { return txt == "=" || txt == "&=" || txt == "|=" || txt == "+=" || txt == "-="; }

Token tok = *tokIt;
//tok.pretext = tok.pretext.replace("//D", "");
tok.text = translateToken(tok.text);
Expand All @@ -2150,8 +2191,9 @@ else
}
else if(tok.text == "[" && tokIt[1].text != "]")
{
if((tokIt.atBegin() || tokIt[-1].text != "{" || tokIt[-2].text != "=") &&
if((tokIt.atBegin() || tokIt[-1].text != "{" || !isAssign(tokIt[-2].text)) &&
(tokIt[1].type != Token.Number || tokIt[2].text != "]") &&
tokIt[1].text != "i" && // RtlConstantTimeEqualMemory
(tokIt[2].text != "]" || tokIt[3].text != ";"))
{
TokenIterator bit = tokIt;
Expand All @@ -2168,8 +2210,9 @@ else
{
TokenIterator openit = tokIt;
if(retreatToOpeningBracket(openit) &&
(openit.atBegin || (openit-1).atBegin || openit[-1].text != "{" || openit[-2].text != "="))
(openit.atBegin || (openit-1).atBegin || openit[-1].text != "{" || !isAssign(openit[-2].text)))
if((tokIt[-1].type != Token.Number || tokIt[-2].text != "[") &&
tokIt[-1].text != "i" && // RtlConstantTimeEqualMemory
(tokIt[-2].text != "[" || tokIt[1].text != ";"))
tok.text = "]+/";
}
Expand Down Expand Up @@ -2900,8 +2943,8 @@ unittest
string exptxt = "
int convert() { return " ~ "
hello; }
// #define noconvert(n,m) \\
// hallo1 |\\
// #define noconvert(n,m)
// hallo1 |
// hallo2
";
version(macro2template) exptxt = replace(exptxt, "int", "auto");
Expand Down
4 changes: 2 additions & 2 deletions doc/VersionHistory.dd
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ $(H2 2022-06-05 Version 1.3.0)
$(LI bugzilla 22764: now searches the 32-bit registry hive for install paths of DMD and LDC)
$(LI bugzilla 23069: mago crashing when debugging VARIANT data type in VS 2022)
$(LI bugzilla 23043: project templates missing in VS 2022 until configuration manually updated)
$(LI semantic analysis: without a project loaded, a D file is now analized using the compile options)
$(LI of "Compile and Run" with an import path derived from the module declaration.)
$(LI semantic analysis: without a project loaded, a D file is now analyzed using the compile options
of "Compile and Run" with an import path derived from the module declaration.)
$(LI visualdproj: exit code printed for failed commands)
$(LI cv2pdb 0.52: improved DWARF support for non-contiguous functions, bug fixes)
)
Expand Down
58 changes: 56 additions & 2 deletions msbuild/dbuild/dbuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,50 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TargetVer>17.2</TargetVer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-v17_3|AnyCPU'">
<OutputPath>bin\Release-v17_3\</OutputPath>
<DefineConstants>TRACE;TOOLS_V17</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TargetVer>17.3</TargetVer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-v17_3|AnyCPU'">
<OutputPath>bin\Debug-v17_3\</OutputPath>
<DefineConstants>TRACE;DEBUG;TOOLS_V17</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TargetVer>17.3</TargetVer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-v17_4|AnyCPU'">
<OutputPath>bin\Release-v17_4\</OutputPath>
<DefineConstants>TRACE;TOOLS_V17</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TargetVer>17.4</TargetVer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-v17_4|AnyCPU'">
<OutputPath>bin\Debug-v17_4\</OutputPath>
<DefineConstants>TRACE;DEBUG;TOOLS_V17</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TargetVer>17.4</TargetVer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Expand Down Expand Up @@ -202,7 +246,7 @@
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion Condition=" '$(TargetVer)' == '12.0' or '$(TargetVer)' == '14.0' ">v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion Condition=" '$(TargetVer)' == '16.0' or '$(TargetVer)' == '16.1' ">v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion Condition=" '$(TargetVer)' == '17.0' or '$(TargetVer)' == '17.1' or '$(TargetVer)' == '17.2' ">v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion Condition=" '$(TargetVer)' == '17.0' or '$(TargetVer)' == '17.1' or '$(TargetVer)' == '17.2' or '$(TargetVer)' == '17.3' or '$(TargetVer)' == '17.4' ">v4.7.2</TargetFrameworkVersion>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
Expand Down Expand Up @@ -433,7 +477,7 @@
</Reference>
</ItemGroup>
<!-- VS2022 -->
<ItemGroup Condition="'$(TargetVer)' == '17.0' or '$(TargetVer)' == '17.1' or '$(TargetVer)' == '17.2'">
<ItemGroup Condition="'$(TargetVer)' == '17.0' or '$(TargetVer)' == '17.1' or '$(TargetVer)' == '17.2' or '$(TargetVer)' == '17.3' or '$(TargetVer)' == '17.4'">
<Reference Include="Microsoft.Build">
<HintPath>assemblies\v17\Microsoft.Build.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -471,6 +515,16 @@
<HintPath>assemblies\v17_2\Microsoft.Build.CPPTasks.Common.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(TargetVer)' == '17.3'">
<Reference Include="Microsoft.Build.CPPTasks.Common">
<HintPath>assemblies\v17_3\Microsoft.Build.CPPTasks.Common.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(TargetVer)' == '17.4'">
<Reference Include="Microsoft.Build.CPPTasks.Common">
<HintPath>assemblies\v17_4\Microsoft.Build.CPPTasks.Common.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Strings.resx">
<SubType>Designer</SubType>
Expand Down
2 changes: 1 addition & 1 deletion msbuild/dcompile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
Condition="'@(DCompile)' != '' and '$(DCompiler)' != 'None'"
DependsOnTargets="_collectDFiles;_replacePackageName">

<VCMessage Condition="$(MSBDBuildVersion_Major) == '17'" Type="Message" Code="MSB8034" Importance="low" Arguments="CPPTaskPath;$(CPPTaskPath)"/>
<VCMessage Condition="$(MSBuildVersion_Major) == '17'" Type="Message" Code="MSB8034" Importance="low" Arguments="CPPTaskPath;$(CPPTaskPath)"/>

<ItemGroup Condition="'@(dcompile_SelectedFiles)' != ''">
<DCompile Remove="@(DCompile)" Condition="'%(Identity)' != '@(dcompile_SelectedFiles)'" />
Expand Down
4 changes: 3 additions & 1 deletion msbuild/dcompile_defaults.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
<DBuildVersion Condition="$(MSBuildVersion_Major) == 16 and $(MSBuildVersion_Minor) != 0">16.1</DBuildVersion>
<DBuildVersion Condition="$(MSBuildVersion_Major) == 17 and $(MSBuildVersion_Minor) == 0">17.0</DBuildVersion>
<DBuildVersion Condition="$(MSBuildVersion_Major) == 17 and $(MSBuildVersion_Minor) == 1">17.1</DBuildVersion>
<DBuildVersion Condition="$(MSBuildVersion_Major) == 17 and $(MSBuildVersion_Minor) &gt; 1">17.2</DBuildVersion>
<DBuildVersion Condition="$(MSBuildVersion_Major) == 17 and $(MSBuildVersion_Minor) == 2">17.2</DBuildVersion>
<DBuildVersion Condition="$(MSBuildVersion_Major) == 17 and $(MSBuildVersion_Minor) == 3">17.3</DBuildVersion>
<DBuildVersion Condition="$(MSBuildVersion_Major) == 17 and $(MSBuildVersion_Minor) &gt; 3">17.4</DBuildVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(DBuildVersion)' == ''">
Expand Down
6 changes: 4 additions & 2 deletions nsis/visuald.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@

; define DMD source path to include dmd installation
; !define DMD
!define DMD_VERSION "2.100.0"
!define DMD_VERSION "2.100.2"
!define DMD_SRC c:\d\dmd-${DMD_VERSION}

; define LDC to include ldc installation
; !define LDC
!define LDC_VERSION "1.29.0"
!define LDC_VERSION "1.30.0"
!define LDC_SRC c:\d\ldc2-${LDC_VERSION}-windows-multilib

; define VS2019 to include VS2019 support
Expand Down Expand Up @@ -332,6 +332,8 @@ Section "Visual Studio package" SecPackage
${File} ..\msbuild\dbuild\obj\release-v17\ dbuild.17.0.dll
${File} ..\msbuild\dbuild\obj\release-v17_1\ dbuild.17.1.dll
${File} ..\msbuild\dbuild\obj\release-v17_2\ dbuild.17.2.dll
${File} ..\msbuild\dbuild\obj\release-v17_3\ dbuild.17.3.dll
${File} ..\msbuild\dbuild\obj\release-v17_4\ dbuild.17.4.dll
!endif
WriteRegStr HKLM "Software\${APPNAME}" "msbuild" $INSTDIR\msbuild
!endif
Expand Down
3 changes: 3 additions & 0 deletions sdk/port/base.d
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ enum CCM_TRANSLATEACCELERATOR = (WM_USER+97);
// msdbg*.d
alias ULONG32 XINT32;

// Win SDK 10.0.22621.0
struct _UNWIND_HISTORY_TABLE;

version(sdk) {}
else {

Expand Down
Loading

0 comments on commit f182f4e

Please sign in to comment.