Skip to content

Commit 8541657

Browse files
committed
Fixed the _write bug with proper codegen modification
1 parent e7140a8 commit 8541657

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

.github/workflows/do_build.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,6 @@ jobs:
111111
key: gnulib-bare
112112
enableCrossOsArchive: true
113113

114-
- name: MSBuild Setup
115-
uses: microsoft/[email protected]
116-
if: matrix.platform == 'windows'
117-
118114
- name: Move Bad DEFAULT MSYS
119115
shell: powershell
120116
run: Rename-Item c:/msys64 c:/trashmsys
@@ -144,10 +140,17 @@ jobs:
144140
- name: Unpack / Move Artifacts
145141
if: ${{ inputs.RequiredDeps != '' && inputs.BuildPkg != 'script' }}
146142
run: ${{env.WLB_SCRIPT_FOLDER}}/.github/move_dl_artifacts.ps1
143+
147144
- name: VSLatest Build Tools Install
148145
if: ${{ inputs.InstallLatestVSTools }}
149-
run: ${{env.WLB_SCRIPT_FOLDER}}/vs_buildtools_installer.ps1
146+
run: ${{env.WLB_SCRIPT_FOLDER}}/vs_buildtools_installer.ps1 -install_path d:/vstools
150147

148+
- name: MSBuild Setup
149+
uses: microsoft/[email protected]
150+
if: matrix.platform == 'windows'
151+
with:
152+
vs-prerelease: true
153+
msbuild-architecture: x64
151154

152155
- name: Build Package
153156
if: ${{ inputs.BuildPkg != 'script' }}

build/f_gnutls_build.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ BLD_CONFIG_BUILD_ADDL_CFLAGS=( "-I../gl/" )
1111
BLD_CONFIG_BUILD_ADDL_CFLAGS_STATIC=("-DASN1_STATIC")
1212
BLD_CONFIG_OUR_LIB_DEPS=("libtasn1" "p11-kit" "zlib")
1313
BLD_CONFIG_OUR_LIB_BINS_PATH=("libtasn1")
14-
BLD_CONFIG_BUILD_MSVC_IGNORE_WARNINGS=( "4068" "4061" "4820" "5045" "4668" )
14+
BLD_CONFIG_BUILD_MSVC_IGNORE_WARNINGS=( "4068" "4061" "4820" "5045" "4668" "4996" )
1515

1616
# BLD_CONFIG_BUILD_FOLDER_NAME="myapp2"; #if you want it compiling in a diff folder
1717
# BLD_CONFIG_BUILD_DEBUG=1
@@ -29,6 +29,13 @@ fi
2929

3030
if [[ -z $SKIP_STEP || $SKIP_STEP == "our_patch" ]]; then
3131
apply_our_repo_patch; # Applies from patches folder repo_BUILD_NAME.patch to the sources
32+
P11_FILE="cligen/cligen/code.py"
33+
if [[ -e "${P11_FILE}" ]]; then
34+
if grep -q "^struct {struct_name} {global_name};" "${P11_FILE}"; then
35+
ex sed -i -E 's/^struct \{struct_name\} \{global_name\};/struct {struct_name} {global_name} ;\n#undef write/' "${P11_FILE}" # fix issue where write is refined to _write but then .write on a struct has problems
36+
echo "Fixed ${P11_FILE} for _write bug"
37+
fi
38+
fi
3239
fi
3340

3441
if [[ $BLD_CONFIG_GNU_LIBS_USED -eq "1" ]]; then
@@ -72,13 +79,7 @@ fi
7279
else
7380
setup_build_env;
7481
fi
75-
P11_FILE="src/p11tool-options.c"
76-
if [[ -e "${P11_FILE}" ]]; then
77-
if grep -Fq " p11tool_options;" "${P11_FILE}"; then
78-
sed -i -E 's/ p11tool_options;/ p11tool_options ;\n#undef write/' "${P11_FILE}" # fix issue where write is refined to _write but then .write on a struct has problems
79-
echo "Fixed ${P11_FILE} for _write bug"
80-
fi
81-
fi
82+
8283

8384
run_make
8485
make_install

vs_buildtools_installer.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
param (
2+
[string] $install_path="c:/Program Files/vs_buildtools"
3+
)
4+
15
Set-StrictMode -version latest;
26
$ErrorActionPreference = "Stop";
3-
param ($install_path="c:/Program Files/vs_buildtools")
47
$installer=Get-ChildItem ([IO.Path]::GetTempFileName()) | Rename-Item -NewName { [IO.Path]::ChangeExtension($_, ".exe") } -PassThru
58
Invoke-WebRequest 'https://aka.ms/vs/17/pre/vs_buildtools.exe' -OutFile $installer
69
$startInfo = New-Object System.Diagnostics.ProcessStartInfo

vs_msys_shell_launch.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ if (! $env:VS_ENV_INITIALIZED) {
66
$instances=Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs;
77
$VS_INSTANCE = $instances[0]
88
foreach ($instance in $instances) {
9-
if ( [System.Version]$VS_INSTANCE.Version -gt [System.Version]$instance.Version ) {
9+
if ( [System.Version]$VS_INSTANCE.Version -lt [System.Version]$instance.Version ) {
1010
$VS_INSTANCE=$instance;
1111
}
1212
}
1313
$VS_DEV_SHELL_PATH="$($VS_INSTANCE.InstallLocation)/Common7/Tools/Microsoft.VisualStudio.DevShell.dll";
1414
$VS_INSTANCE_ID=$VS_INSTANCE.IdentifyingNumber;
1515
$env:VS_ENV_INITIALIZED=1;
16+
Write-Host "Starting msys shell with VS tools from: $($VS_INSTANCE.ProductLocation)"
1617
Import-Module $VS_DEV_SHELL_PATH;
1718
Enter-VsDevShell $VS_INSTANCE_ID -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64";
1819
}

0 commit comments

Comments
 (0)