Skip to content

Commit

Permalink
Fixed the _write bug with proper codegen modification
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchcapper committed Dec 19, 2024
1 parent e7140a8 commit 62400bc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/do_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ jobs:
- name: Unpack / Move Artifacts
if: ${{ inputs.RequiredDeps != '' && inputs.BuildPkg != 'script' }}
run: ${{env.WLB_SCRIPT_FOLDER}}/.github/move_dl_artifacts.ps1

- name: VSLatest Build Tools Install
if: ${{ inputs.InstallLatestVSTools }}
run: ${{env.WLB_SCRIPT_FOLDER}}/vs_buildtools_installer.ps1
run: ${{env.WLB_SCRIPT_FOLDER}}/vs_buildtools_installer.ps1 -install_path d:/vstools


- name: Build Package
Expand Down
17 changes: 9 additions & 8 deletions build/f_gnutls_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BLD_CONFIG_BUILD_ADDL_CFLAGS=( "-I../gl/" )
BLD_CONFIG_BUILD_ADDL_CFLAGS_STATIC=("-DASN1_STATIC")
BLD_CONFIG_OUR_LIB_DEPS=("libtasn1" "p11-kit" "zlib")
BLD_CONFIG_OUR_LIB_BINS_PATH=("libtasn1")
BLD_CONFIG_BUILD_MSVC_IGNORE_WARNINGS=( "4068" "4061" "4820" "5045" "4668" )
BLD_CONFIG_BUILD_MSVC_IGNORE_WARNINGS=( "4068" "4061" "4820" "5045" "4668" "4996" )

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

if [[ -z $SKIP_STEP || $SKIP_STEP == "our_patch" ]]; then
apply_our_repo_patch; # Applies from patches folder repo_BUILD_NAME.patch to the sources
P11_FILE="cligen/cligen/code.py"
if [[ -e "${P11_FILE}" ]]; then
if grep -q "^struct {struct_name} {global_name};" "${P11_FILE}"; then
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
echo "Fixed ${P11_FILE} for _write bug"
fi
fi
fi

if [[ $BLD_CONFIG_GNU_LIBS_USED -eq "1" ]]; then
Expand Down Expand Up @@ -72,13 +79,7 @@ fi
else
setup_build_env;
fi
P11_FILE="src/p11tool-options.c"
if [[ -e "${P11_FILE}" ]]; then
if grep -Fq " p11tool_options;" "${P11_FILE}"; then
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
echo "Fixed ${P11_FILE} for _write bug"
fi
fi


run_make
make_install
Expand Down
5 changes: 4 additions & 1 deletion vs_buildtools_installer.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
param (
[string] $install_path="c:/Program Files/vs_buildtools"
)

Set-StrictMode -version latest;
$ErrorActionPreference = "Stop";
param ($install_path="c:/Program Files/vs_buildtools")
$installer=Get-ChildItem ([IO.Path]::GetTempFileName()) | Rename-Item -NewName { [IO.Path]::ChangeExtension($_, ".exe") } -PassThru
Invoke-WebRequest 'https://aka.ms/vs/17/pre/vs_buildtools.exe' -OutFile $installer
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
Expand Down

0 comments on commit 62400bc

Please sign in to comment.