Skip to content

Commit

Permalink
Fix perl handling of paths w/ spaces (#2005)
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth authored Dec 4, 2024
1 parent f6d3673 commit 4dbc48d
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 8 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/misc-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,45 @@ jobs:
echo "Error: PR description does not contain the required license statement."
exit 1
fi
path-has-spaces:
if: github.repository_owner == 'aws'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-14-xlarge ]
steps:
- if: ${{ matrix.os == 'windows-latest' }}
name: Install NASM
uses: ilammy/[email protected]
- uses: actions/setup-go@v4
with:
go-version: '>=1.18'
- name: Checkout
uses: actions/checkout@v4
with:
path: "path has spaces/aws-lc"
- uses: ilammy/msvc-dev-cmd@v1
- name: Setup CMake
uses: threeal/[email protected]
with:
source-dir: 'path has spaces/aws-lc'
build-dir: 'path has spaces/build'
generator: Ninja
- name: Build Project
run: cmake --build "path has spaces/build" --target all
- name: Run tests
run: cmake --build "path has spaces/build" --target run_tests
- name: Setup CMake FIPS
uses: threeal/[email protected]
with:
source-dir: 'path has spaces/aws-lc'
build-dir: 'path has spaces/build-fips'
generator: Ninja
options: CMAKE_BUILD_TYPE=Release FIPS=1 BUILD_SHARED_LIBS=${{ (matrix.os == 'ubuntu-latest' && '0') || '1' }}
- name: Build Project
run: cmake --build "path has spaces/build-fips" --target all
# TODO: Fix the FIPS ACVP tests on Windows to handle spaces in the path
- if: ${{ matrix.os != 'windows-latest' }}
name: Run tests
run: cmake --build "path has spaces/build-fips" --target run_tests
8 changes: 6 additions & 2 deletions .github/workflows/windows-alt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
uses: ilammy/[email protected]
- name: Checkout
uses: actions/checkout@v4
with:
path: "path has spaces/aws-lc"
- name: Setup MinGW
uses: egor-tensin/[email protected]
id: setup_mingw
Expand All @@ -25,6 +27,8 @@ jobs:
uses: threeal/[email protected]
with:
generator: Ninja
source-dir: 'path has spaces/aws-lc'
build-dir: 'path has spaces/build'
c-compiler: ${{ steps.setup_mingw.outputs.gcc }}
cxx-compiler: ${{ steps.setup_mingw.outputs.gxx }}
options: |
Expand All @@ -37,9 +41,9 @@ jobs:
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
CMAKE_BUILD_TYPE=Release \
- name: Build Project
run: cmake --build ./build --target all
run: cmake --build "path has spaces/build" --target all
- name: Run tests
run: cmake --build ./build --target run_tests
run: cmake --build "path has spaces/build" --target run_tests
clang:
if: github.repository_owner == 'aws'
runs-on: windows-latest
Expand Down
8 changes: 7 additions & 1 deletion crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,16 @@ if(PERL_EXECUTABLE)
set(PERLASM_FLAGS "${PERLASM_FLAGS} -DMY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX")
endif()

set(PERL_COMMAND "${PERL_EXECUTABLE}")
list(APPEND PERL_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
list(APPEND PERL_COMMAND "${PERLASM_STYLE}")
list(APPEND PERL_COMMAND "${dest}")
list(APPEND PERL_COMMAND ${PERLASM_FLAGS})

add_custom_command(
OUTPUT ${dest}
COMMAND ${CMAKE_COMMAND} -E make_directory ${dir}
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${PERLASM_STYLE} ${dest} ${PERLASM_FLAGS}
COMMAND ${PERL_COMMAND}
DEPENDS
${src}
${PROJECT_SOURCE_DIR}/crypto/perlasm/arm-xlate.pl
Expand Down
2 changes: 1 addition & 1 deletion crypto/cipher_extra/asm/chacha20_poly1305_armv8.pl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate) or
die "can't locate arm-xlate.pl";

open OUT,"| \"$^X\" $xlate $flavour $output";
open OUT, qq{| "$^X" "$xlate" $flavour "$output"};
*STDOUT=*OUT;

my ($oup,$inp,$inl,$adp,$adl,$keyp,$itr1,$itr2) = ("x0","x1","x2","x3","x4","x5","x6","x7");
Expand Down
2 changes: 1 addition & 1 deletion crypto/fipsmodule/ec/asm/p256-armv8-asm.pl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
( $xlate="${dir}../../../perlasm/arm-xlate.pl" and -f $xlate) or
die "can't locate arm-xlate.pl";

open OUT,"| \"$^X\" $xlate $flavour $output";
open OUT, qq{| "$^X" "$xlate" $flavour "$output"};
*STDOUT=*OUT;

{
Expand Down
2 changes: 1 addition & 1 deletion crypto/fipsmodule/ec/asm/p256_beeu-armv8-asm.pl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
( $xlate="${dir}../../../perlasm/arm-xlate.pl" and -f $xlate) or
die "can't locate arm-xlate.pl";
open OUT,"| \"$^X\" $xlate $flavour $output";
open OUT, qq{| "$^X" "$xlate" $flavour "$output"};
*STDOUT=*OUT;
#############################################################################
# extern int beeu_mod_inverse_vartime(BN_ULONG out[P256_LIMBS],
Expand Down
2 changes: 1 addition & 1 deletion crypto/fipsmodule/md5/asm/md5-armv8.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
( $xlate="${dir}../../../perlasm/arm-xlate.pl" and -f $xlate) or
die "can't locate arm-xlate.pl";

open OUT,"| \"$^X\" $xlate $flavour \"$output\""
open OUT, qq{| "$^X" "$xlate" $flavour "$output"}
or die "can't call $xlate: $1";
*STDOUT=*OUT;

Expand Down
2 changes: 1 addition & 1 deletion crypto/fipsmodule/modes/asm/aesv8-gcm-armv8.pl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
( $xlate="${dir}../../../perlasm/arm-xlate.pl" and -f $xlate) or
die "can't locate arm-xlate.pl";

open OUT,"| \"$^X\" $xlate $flavour $output";
open OUT, qq{| "$^X" "$xlate" $flavour "$output"};
*STDOUT=*OUT;

$code=<<___;
Expand Down

0 comments on commit 4dbc48d

Please sign in to comment.