Skip to content

CI: Correct validation & bring back pointer "max" bounds workaround #284

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

Merged
merged 2 commits into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/scripts/validate_sample.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

set -e
set -x
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duh! we missed those


# shellcheck disable=SC2034
declare -r GREEN='\033[0;32m'
declare -r BOLD='\033[1m'
Expand All @@ -14,14 +17,11 @@ echo "========================================================================"
printf "Validate sample '${BOLD}%s${RESET}' using: " "$sampleDir"
cd "$sampleDir" || exit
if [[ $(find . -name ${CI_VALIDATE_SCRIPT} -maxdepth 1) ]]; then
echo -e "Custom ${BOLD}${CI_VALIDATE_SCRIPT}${RESET} script..."
./${CI_VALIDATE_SCRIPT} || exit
elif [[ $(find . -name 'build.gradle*' -maxdepth 1) ]]; then
echo -e "${BOLD}Gradle${RESET} build..."
./gradlew build || ./gradlew build --info # re-run to get better failure output
echo -e "Run ${BOLD}${CI_VALIDATE_SCRIPT}${RESET} script..."
./${CI_VALIDATE_SCRIPT}
else
echo -e "${BOLD}SwiftPM${RESET} build..."
swift build || exit
echo -e "${BOLD}Missing ${CI_VALIDATE_SCRIPT} file!${RESET}"
exit
fi
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah let's just have each file be explicit about how it validates instead...


echo -e "Validated sample '${BOLD}${sampleDir}${RESET}': ${BOLD}passed${RESET}."
Expand Down
6 changes: 6 additions & 0 deletions Samples/SwiftKitSampleApp/ci-validate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -x
set -e

./gradlew run
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ public static long addressByteSize() {
public static final ValueLayout.OfLong SWIFT_INT64 = ValueLayout.JAVA_LONG;
public static final ValueLayout.OfFloat SWIFT_FLOAT = ValueLayout.JAVA_FLOAT;
public static final ValueLayout.OfDouble SWIFT_DOUBLE = ValueLayout.JAVA_DOUBLE;
public static final AddressLayout SWIFT_POINTER = ValueLayout.ADDRESS;
// .withTargetLayout(MemoryLayout.sequenceLayout(Long.MAX_VALUE, JAVA_BYTE));

// FIXME: this sequence layout is a workaround, we must properly size pointers when we get them.
public static final AddressLayout SWIFT_POINTER = ValueLayout.ADDRESS
.withTargetLayout(MemoryLayout.sequenceLayout(Long.MAX_VALUE, JAVA_BYTE));
public static final SequenceLayout SWIFT_BYTE_ARRAY = MemoryLayout.sequenceLayout(8, ValueLayout.JAVA_BYTE);

/**
Expand Down
Loading