Skip to content

Commit 73dd00d

Browse files
committed
Update compile-fixtures script
1 parent 03b4aea commit 73dd00d

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

scripts/ci/compile-fixtures.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ EOF
2121

2222
# Known failures - these will be skipped unless -f is used
2323
KNOWN_FAILURES=(
24-
iterator # Makes use of Apple block extension which would require clang (see #913)
25-
decls_in_signature # Unusable struct (see #1128)
26-
redeclaration # Same as typenames
27-
typenames # hs-bindgen namespace possible bug/feature
24+
edge-cases/iterator # Makes use of Apple block extension which would require clang (see #913)
25+
functions/decls_in_signature # Unusable struct (see #1128)
26+
declarations/redeclaration # Multiple declarations (intentional test case)
27+
types/typenames # Multiple declarations (hs-bindgen namespace possible bug/feature)
2828
)
2929

3030
# Default options
@@ -101,11 +101,15 @@ compile_fixture() {
101101
#
102102
# NOTE: I (Joris) am not 100% sure, but it looks like the order in which the
103103
# files are passed to the GHC invocation matters for module dependency
104-
# resolution. Just a simple sort based on the name of the file is sufficient
105-
# for now to prevent GHC errors. If a "module not found" error ever pop ups
106-
# in the future, then this might be caused by an inadequate sort here.
104+
# resolution. We sort by directory depth first (shallower files first), then
105+
# alphabetically. This ensures Example.pp.hs is compiled before Example/*.pp.hs,
106+
# which is necessary since the submodules import the main Example module.
107107
local files
108-
files=$(find "$FIXTURES_DIR/$fixture_name/" -type f -name "*.pp.hs" -print0 | sort -z | xargs -0 echo)
108+
files=$(find "$FIXTURES_DIR/$fixture_name/" -type f -name "*.pp.hs" -print0 | \
109+
xargs -0 -I {} sh -c 'echo $(echo "{}" | tr -cd "/" | wc -c) "{}"' | \
110+
sort -n | \
111+
cut -d' ' -f2- | \
112+
tr '\n' ' ')
109113

110114
# Use a temporary output file to avoid polluting the fixtures directory
111115
local output_dir

0 commit comments

Comments
 (0)