Skip to content

Commit 00d02c5

Browse files
committed
Github actions workflow fix
1 parent fe1d784 commit 00d02c5

File tree

1 file changed

+107
-9
lines changed

1 file changed

+107
-9
lines changed

.github/workflows/ci.yml

Lines changed: 107 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,123 @@ jobs:
5151
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
5252
restore-keys: ${{ runner.os }}-test-${{ env.cache-name }}-
5353

54-
- name: Setup Julia project
54+
- name: Setup Julia project and install WrapIt
5555
run: |
5656
julia --project=. -e "
5757
using Pkg
5858
Pkg.instantiate()
59-
# Install WrapIt and make it available system-wide
59+
# Install WrapIt
6060
Pkg.add(\"WrapIt\")
6161
using WrapIt
6262
WrapIt.install()
6363
"
6464
65-
- name: Install WrapIt executable system-wide
65+
- name: Find and install WrapIt executable
6666
run: |
67-
# Find WrapIt executable and copy to /usr/bin
68-
WRAPIT_PATH=$(julia --project=. -e "using WrapIt; println(WrapIt.wrapit_path())")
69-
echo "WrapIt found at: $WRAPIT_PATH"
70-
sudo cp "$WRAPIT_PATH" /usr/bin/wrapit
71-
sudo chmod +x /usr/bin/wrapit
72-
wrapit --version
67+
# Try multiple ways to find WrapIt executable
68+
echo "=== Searching for WrapIt executable ==="
69+
70+
# Method 1: Check if it's in Julia packages
71+
JULIA_DEPOT=$(julia -e "println(first(DEPOT_PATH))")
72+
echo "Julia depot: $JULIA_DEPOT"
73+
74+
# Search for wrapit executable
75+
find $JULIA_DEPOT -name "wrapit*" -type f 2>/dev/null || echo "No wrapit found in depot"
76+
find ~/.julia -name "wrapit*" -type f 2>/dev/null || echo "No wrapit found in ~/.julia"
77+
78+
# Method 2: Try to get path from WrapIt module
79+
WRAPIT_PATH=$(julia --project=. -e "
80+
using WrapIt
81+
# Try different possible function names
82+
try
83+
println(WrapIt.wrapit_executable())
84+
catch
85+
try
86+
println(WrapIt.executable_path())
87+
catch
88+
try
89+
println(joinpath(dirname(pathof(WrapIt)), \"..\", \"deps\", \"wrapit\"))
90+
catch
91+
# Search in WrapIt package directory
92+
pkg_dir = dirname(dirname(pathof(WrapIt)))
93+
println(\"Searching in: \", pkg_dir)
94+
for (root, dirs, files) in walkdir(pkg_dir)
95+
for file in files
96+
if startswith(file, \"wrapit\") && isfile(joinpath(root, file))
97+
println(joinpath(root, file))
98+
break
99+
end
100+
end
101+
end
102+
end
103+
end
104+
end
105+
" 2>/dev/null || echo "Could not determine WrapIt path via Julia")
106+
107+
echo "WrapIt path candidate: $WRAPIT_PATH"
108+
109+
# Method 3: Manual search and install
110+
if [ -n "$WRAPIT_PATH" ] && [ -f "$WRAPIT_PATH" ]; then
111+
echo "Found WrapIt at: $WRAPIT_PATH"
112+
sudo cp "$WRAPIT_PATH" /usr/bin/wrapit
113+
sudo chmod +x /usr/bin/wrapit
114+
else
115+
echo "=== Manual WrapIt search ==="
116+
# Search common locations
117+
POSSIBLE_LOCATIONS=(
118+
"$JULIA_DEPOT/packages/WrapIt"
119+
"$JULIA_DEPOT/packages/WrapIt/*/deps"
120+
"$JULIA_DEPOT/packages/WrapIt/*/bin"
121+
"~/.julia/packages/WrapIt"
122+
"~/.julia/packages/WrapIt/*/deps"
123+
"~/.julia/packages/WrapIt/*/bin"
124+
)
125+
126+
FOUND_WRAPIT=""
127+
for loc in "${POSSIBLE_LOCATIONS[@]}"; do
128+
echo "Checking: $loc"
129+
if [ -d "$loc" ]; then
130+
FOUND_WRAPIT=$(find "$loc" -name "wrapit*" -type f -executable 2>/dev/null | head -1)
131+
if [ -n "$FOUND_WRAPIT" ]; then
132+
echo "Found WrapIt executable: $FOUND_WRAPIT"
133+
sudo cp "$FOUND_WRAPIT" /usr/bin/wrapit
134+
sudo chmod +x /usr/bin/wrapit
135+
break
136+
fi
137+
fi
138+
done
139+
140+
if [ -z "$FOUND_WRAPIT" ]; then
141+
echo "❌ Could not find WrapIt executable, trying to build from source"
142+
julia --project=. -e "
143+
using WrapIt
144+
# Force rebuild/reinstall
145+
try
146+
WrapIt.build()
147+
catch e
148+
println(\"Build failed: \", e)
149+
end
150+
"
151+
152+
# Try search again after build
153+
FOUND_WRAPIT=$(find ~/.julia -name "wrapit*" -type f -executable 2>/dev/null | head -1)
154+
if [ -n "$FOUND_WRAPIT" ]; then
155+
echo "Found WrapIt after build: $FOUND_WRAPIT"
156+
sudo cp "$FOUND_WRAPIT" /usr/bin/wrapit
157+
sudo chmod +x /usr/bin/wrapit
158+
fi
159+
fi
160+
fi
161+
162+
# Verify installation
163+
if command -v wrapit &> /dev/null; then
164+
echo "✅ WrapIt installed successfully"
165+
wrapit --version || echo "WrapIt installed but no version info"
166+
which wrapit
167+
else
168+
echo "❌ WrapIt installation failed"
169+
exit 1
170+
fi
73171
74172
- name: Clean and rebuild bindings from scratch
75173
run: |

0 commit comments

Comments
 (0)