@@ -32,7 +32,7 @@ async function composeCygwinCacheKeys() {
3232async function composeDuneCacheKeys ( ) {
3333 const { workflow, job, runId } = github . context ;
3434 const ocamlCompiler = await RESOLVED_COMPILER ;
35- const plainKey = [ ocamlCompiler , workflow , job ] . join ( "," ) ;
35+ const plainKey = [ ocamlCompiler , workflow , job ] . join ( ) ;
3636 const hash = crypto . createHash ( "sha256" ) . update ( plainKey ) . digest ( "hex" ) ;
3737 const key = `${ CACHE_PREFIX } -setup-ocaml-dune-${ PLATFORM } -${ ARCHITECTURE } -${ hash } -${ runId } ` ;
3838 const restoreKeys = [
@@ -48,7 +48,7 @@ async function composeOpamCacheKeys() {
4848 const { version : opamVersion } = await retrieveLatestOpamRelease ( ) ;
4949 const sandbox = OPAM_DISABLE_SANDBOXING ? "nosandbox" : "sandbox" ;
5050 const ocamlCompiler = await RESOLVED_COMPILER ;
51- const repositoryUrls = OPAM_REPOSITORIES . map ( ( [ _ , value ] ) => value ) . join ( "," ) ;
51+ const repositoryUrls = OPAM_REPOSITORIES . map ( ( [ _ , value ] ) => value ) . join ( ) ;
5252 const osInfo = await system . osInfo ( ) ;
5353 const plainKey = [
5454 PLATFORM ,
@@ -58,7 +58,7 @@ async function composeOpamCacheKeys() {
5858 ocamlCompiler ,
5959 repositoryUrls ,
6060 sandbox ,
61- ] . join ( "," ) ;
61+ ] . join ( ) ;
6262 const hash = crypto . createHash ( "sha256" ) . update ( plainKey ) . digest ( "hex" ) ;
6363 const key = `${ CACHE_PREFIX } -setup-ocaml-opam-${ hash } ` ;
6464 const restoreKeys = [ key ] ;
@@ -67,9 +67,10 @@ async function composeOpamCacheKeys() {
6767}
6868
6969async function composeOpamDownloadCacheKeys ( ) {
70+ const isWin = PLATFORM === "windows" ;
7071 const ocamlCompiler = await RESOLVED_COMPILER ;
71- const repositoryUrls = OPAM_REPOSITORIES . map ( ( [ _ , value ] ) => value ) . join ( "," ) ;
72- const plainKey = [ ocamlCompiler , repositoryUrls ] . join ( "," ) ;
72+ const repositoryUrls = OPAM_REPOSITORIES . map ( ( [ _ , value ] ) => value ) . join ( ) ;
73+ const plainKey = [ isWin , ocamlCompiler , repositoryUrls ] . join ( ) ;
7374 const hash = crypto . createHash ( "sha256" ) . update ( plainKey ) . digest ( "hex" ) ;
7475 const { runId } = github . context ;
7576 const key = `${ CACHE_PREFIX } -setup-ocaml-opam-download-${ hash } -${ runId } ` ;
@@ -121,12 +122,11 @@ function composeOpamCachePaths() {
121122}
122123
123124function composeOpamDownloadCachePaths ( ) {
124- if ( PLATFORM === "windows" ) {
125- const opamDownloadCachePath = path . join ( "D:" , ".opam" , "download-cache" ) ;
126- return [ opamDownloadCachePath ] ;
127- }
128125 const homeDir = os . homedir ( ) ;
129- const opamDownloadCachePath = path . join ( homeDir , ".opam" , "download-cache" ) ;
126+ const opamDownloadCachePath =
127+ PLATFORM === "windows"
128+ ? path . join ( "D:" , ".opam" , "download-cache" )
129+ : path . join ( homeDir , ".opam" , "download-cache" ) ;
130130 return [ opamDownloadCachePath ] ;
131131}
132132
0 commit comments