@@ -110,6 +110,39 @@ async function run() {
110110 }
111111 }
112112
113+ // --- an arm64 linux machine installs the arm64 engine ----------------
114+ // The whole install, not just the name mapping: before linux-arm64 was
115+ // published this threw, and the failure worth guarding against now is the
116+ // quiet one - the x64 asset is served alongside, so a rule that fell back to
117+ // it would install cleanly here and only fail when the user tried to run it.
118+ {
119+ const dir = scratch ( ) ;
120+ const release = await startRelease ( {
121+ "codegraph-server-linux-arm64" : { content : "arm64 engine" } ,
122+ "codegraph-server-linux-x64" : { content : "x64 engine" } ,
123+ } ) ;
124+ try {
125+ const { binary, fetched } = await ensureEngine ( VERSION , dir , {
126+ platform : "linux" ,
127+ arch : "arm64" ,
128+ baseUrl : release . baseUrl ,
129+ } ) ;
130+ check (
131+ path . basename ( binary ) === "codegraph-server-linux-arm64" ,
132+ "an arm64 linux install fetches the arm64 engine"
133+ ) ;
134+ check ( fs . readFileSync ( binary , "utf8" ) === "arm64 engine" , "and it is the arm64 build" ) ;
135+ check (
136+ fetched . length === 1 && ! fs . existsSync ( path . join ( dir , "codegraph-server-linux-x64" ) ) ,
137+ "and nothing else, least of all the x64 build"
138+ ) ;
139+ check ( installedVersion ( dir ) === VERSION , "and the release it came from is recorded" ) ;
140+ } finally {
141+ release . server . close ( ) ;
142+ fs . rmSync ( dir , { recursive : true , force : true } ) ;
143+ }
144+ }
145+
113146 // --- a corrupted download installs nothing ---------------------------
114147 {
115148 const dir = scratch ( ) ;
0 commit comments