@andersbakken/fisk 3.4.101 → 3.4.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/code/cache/6f3d6f00c1fec0eb44ef1d4d65edf1506dc3d824 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/code/cache/9b50cb3b165351cfaf3a84c7452b5625a53982bd +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/code/cache/a187396d7c2e3dc16e77ed1dfd8e1c1ef0e486ee +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/code/cache/aa48bf61fe6d1e09d8e2088e7174bd3cc665486b +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/code/cache/ab0db788eb4ffd1406d5c967b8d8a1f9c4f872a1 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/code/cache/c437c9f3ca4fe26852e48992562e8f625e6eb3d5 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/code/cache/feb4835b4c3c5ca207c3adaeba3bf7d539d598a4 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/semanticDiagnostics/cache/6f3d6f00c1fec0eb44ef1d4d65edf1506dc3d824 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/semanticDiagnostics/cache/9b50cb3b165351cfaf3a84c7452b5625a53982bd +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/semanticDiagnostics/cache/a187396d7c2e3dc16e77ed1dfd8e1c1ef0e486ee +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/semanticDiagnostics/cache/aa48bf61fe6d1e09d8e2088e7174bd3cc665486b +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/semanticDiagnostics/cache/ab0db788eb4ffd1406d5c967b8d8a1f9c4f872a1 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/semanticDiagnostics/cache/c437c9f3ca4fe26852e48992562e8f625e6eb3d5 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/semanticDiagnostics/cache/feb4835b4c3c5ca207c3adaeba3bf7d539d598a4 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/syntacticDiagnostics/cache/6f3d6f00c1fec0eb44ef1d4d65edf1506dc3d824 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/syntacticDiagnostics/cache/9b50cb3b165351cfaf3a84c7452b5625a53982bd +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/syntacticDiagnostics/cache/a187396d7c2e3dc16e77ed1dfd8e1c1ef0e486ee +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/syntacticDiagnostics/cache/aa48bf61fe6d1e09d8e2088e7174bd3cc665486b +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/syntacticDiagnostics/cache/ab0db788eb4ffd1406d5c967b8d8a1f9c4f872a1 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/syntacticDiagnostics/cache/c437c9f3ca4fe26852e48992562e8f625e6eb3d5 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/syntacticDiagnostics/cache/feb4835b4c3c5ca207c3adaeba3bf7d539d598a4 +1 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/0633edb60fd6a23c41b4a3ecd6745d0918ddc443 +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/0fbe0fd936446971be562f345406924c189b440d +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/1460dbc1a06c23e1b35a5ea7503af46ecf64a3d7 +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/275df2f723ff5eb991b1f1314c27d5ee8f368d0f +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/442395a1e95b214924378140af2474e7dcabc38a +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/4cf155d27ec97f64a8625356918240d54b7b648e +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/6abbc694eb7c9915d4bc616b87ec96a7f1beabe8 +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/6ddcf876c72761cf72ce026ac36e5a85a3fef426 +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/8171e95e73521604a2d9dee15217d199330f4207 +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/9d464c7351b779db405539ce4295a3fb9d80f181 +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/aeb253b245b256f7f45a7a4d8ecba39abe53b421 +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/bb509537d07eafe005fa7dbf3251e24a71d7d073 +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/be48c1dd473009fceabbbd08c8bf0dde615280b3 +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/c6ab093e229a9a7d7442ac43d8b832c68f454faa +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/d7129ca09c222bcedabe550058a1dc00f770a7bb +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/da2cdf367b48c84adc1c966cb1aaa0115a2ba25e +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/da7a45624ab6c7901cf496b81a9f7d6beb85516c +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/db2a6425476330dda1162995f162ab52f3438f8b +0 -0
- package/.cache/rpt2_5ee3bf3b1ea0871757cf6d9c5526a3abe9b0a81c/types/cache/e0f94621f43e73a1c561c1b7610a95ed6d54ee78 +0 -0
- package/README.md +1 -1
- package/builder/fisk-builder.js +0 -3
- package/dist/fisk-daemon.js +4159 -0
- package/dist/fisk-daemon.js.map +1 -0
- package/package.json +1 -1
- package/scheduler/server.js +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"code":"export const Constants = {\n // client codes\n get AcquireCppSlot() {\n return 1;\n },\n get AcquireCompileSlot() {\n return 2;\n },\n get ReleaseCppSlot() {\n return 3;\n },\n get ReleaseCompileSlot() {\n return 4;\n },\n get JSON() {\n return 5;\n },\n // daemon codes\n get CppSlotAcquired() {\n return 10;\n },\n get CompileSlotAcquired() {\n return 11;\n },\n get JSONResponse() {\n return 12;\n }\n};\n//# sourceMappingURL=constants.js.map","references":[],"map":"{\"version\":3,\"file\":\"constants.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../daemon/constants.ts\"],\"names\":[],\"mappings\":\"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,eAAe;IACf,IAAI,cAAc;QACd,OAAO,CAAC,CAAC;IACb,CAAC;IACD,IAAI,kBAAkB;QAClB,OAAO,CAAC,CAAC;IACb,CAAC;IACD,IAAI,cAAc;QACd,OAAO,CAAC,CAAC;IACb,CAAC;IACD,IAAI,kBAAkB;QAClB,OAAO,CAAC,CAAC;IACb,CAAC;IACD,IAAI,IAAI;QACJ,OAAO,CAAC,CAAC;IACb,CAAC;IAED,eAAe;IACf,IAAI,eAAe;QACf,OAAO,EAAE,CAAC;IACd,CAAC;IACD,IAAI,mBAAmB;QACnB,OAAO,EAAE,CAAC;IACd,CAAC;IACD,IAAI,YAAY;QACZ,OAAO,EAAE,CAAC;IACd,CAAC;CACJ,CAAC\"}"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"code":"import EventEmitter from \"events\";\nimport assert from \"assert\";\nclass Slots extends EventEmitter {\n constructor(count, name, debug) {\n super();\n this.count = count;\n this.name = name;\n this.used = new Map();\n this.debug = debug;\n this.pending = new Map();\n if (this.debug) {\n console.log(\"Slots created\", this.toString());\n }\n }\n acquire(id, data, cb) {\n if (this.used.size < this.count) {\n this.used.set(id, data);\n if (this.debug) {\n console.log(\"acquired slot\", id, data, this.toString());\n }\n cb();\n }\n else {\n if (this.debug) {\n console.log(\"pending slot\", id, this.toString());\n }\n this.pending.set(id, { data: data, cb: cb });\n }\n }\n release(id) {\n this.pending.delete(id);\n if (this.used.has(id)) {\n const data = this.used.get(id);\n this.used.delete(id);\n assert(this.used.size < this.count);\n assert(this.used.size + 1 === this.count || this.pending.size === 0);\n if (this.debug) {\n console.log(\"released\", id, data, this.toString());\n }\n // eslint-disable-next-line no-unreachable-loop\n for (const p of this.pending) {\n this.used.set(p[0], p[1].data);\n this.pending.delete(p[0]);\n p[1].cb();\n break;\n }\n }\n }\n toString() {\n return `${this.name} ${this.used.size}/${this.count}`;\n }\n dump() {\n const pending = {}, used = {};\n for (const p of this.pending) {\n pending[p[0]] = p[1].data;\n }\n for (const p of this.used) {\n used[p[0]] = p[1];\n }\n return { pending: pending, capacity: this.count, used: this.used.size };\n }\n}\nexport { Slots };\n//# sourceMappingURL=slots.js.map","references":[],"map":"{\"version\":3,\"file\":\"slots.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../daemon/slots.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAQ5B,MAAM,KAAM,SAAQ,YAAY;IAO5B,YAAY,KAAa,EAAE,IAAY,EAAE,KAAc;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,KAAK,EAAE;YACZ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACjD;IACL,CAAC;IAED,OAAO,CAAC,EAAU,EAAE,IAAa,EAAE,EAAc;QAC7C,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE;YAC7B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,KAAK,EAAE;gBACZ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC3D;YACD,EAAE,EAAE,CAAC;SACR;aAAM;YACH,IAAI,IAAI,CAAC,KAAK,EAAE;gBACZ,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;aACpD;YACD,IAAI,CAA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AAI,IAAI,CAAC,KAAK,EAAE,CAAC;IAC1D,CAAC;IAED,IAAI;QACA,MAAM,OAAO,GAA4B,EAAE,EACvC,IAAI,GAA4B,EAAE,CAAC;QACvC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;YAC1B,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;SAC7B;QAED,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE;YACvB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACrB;QACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5E,CAAC;CACJ;AAED,OAAO,EAAE,KAAK,EAAE,CAAC\"}"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"code":"// #!/usr/bin/env node\nimport { Constants } from \"./constants\";\nimport { Server } from \"./server\";\nimport { Slots } from \"./slots\";\nimport Common from \"../common\";\nimport assert from \"assert\";\nimport options from \"@jhanssen/options\";\nimport os from \"os\";\nconst option = options({\n prefix: \"fisk/daemon\",\n noApplicationPath: true,\n additionalFiles: [\"fisk/daemon.conf.override\"]\n});\nconst common = Common(option);\nconst debug = Boolean(option(\"debug\"));\nprocess.on(\"unhandledRejection\", (reason, p) => {\n console.log(\"Unhandled Rejection at: Promise\", p, \"reason:\", reason.stack);\n process.exit();\n // if (client)\n // client.send('log', { message: `Unhandled Rejection at: Promise ${p}, reason: ${reason.stack}` });\n});\nprocess.on(\"uncaughtException\", (err) => {\n console.error(\"Uncaught exception\", err);\n process.exit();\n // if (client)\n // client.send('log', { message: `Uncaught exception ${err.toString()} ${err.stack}` });\n});\nconst server = new Server(option, common);\nserver.listen().then(() => {\n console.log(\"listening on\", server.file);\n});\n// server.on(\"message\nserver.on(\"error\", (err) => {\n console.error(\"server error\", err);\n});\nconst cppSlots = new Slots(option.int(\"cpp-slots\", Math.max(os.cpus().length * 2, 1)), \"cpp\", debug);\nconst compileSlots = new Slots(option.int(\"slots\", Math.max(os.cpus().length, 1)), \"compile\", debug);\nserver.on(\"compile\", (compile) => {\n compile.on(\"dumpSlots\", () => {\n const ret = { cpp: cppSlots.dump(), compile: compileSlots.dump() };\n if (debug) {\n console.log(\"sending dump\", ret);\n }\n compile.send(ret);\n });\n let requestedCppSlot = false;\n compile.on(\"acquireCppSlot\", () => {\n if (debug) {\n console.log(\"acquireCppSlot\");\n }\n assert(!requestedCppSlot);\n requestedCppSlot = true;\n cppSlots.acquire(compile.id, { pid: compile.pid }, () => {\n // compile.send({ type: 'cppSlotAcquired' });\n compile.send(Constants.CppSlotAcquired);\n });\n });\n compile.on(\"releaseCppSlot\", () => {\n if (debug) {\n console.log(\"releaseCppSlot\");\n }\n assert(requestedCppSlot);\n if (requestedCppSlot) {\n requestedCppSlot = false;\n cppSlots.release(compile.id);\n }\n });\n let requestedCompileSlot = false;\n compile.on(\"acquireCompileSlot\", () => {\n if (debug) {\n console.log(\"acquireCompileSlot\");\n }\n assert(!requestedCompileSlot);\n requestedCompileSlot = true;\n compileSlots.acquire(compile.id, { pid: compile.pid }, () => {\n // compile.send({ type: 'compileSlotAcquired' });\n compile.send(Constants.CompileSlotAcquired);\n });\n });\n compile.on(\"releaseCompileSlot\", () => {\n if (debug) {\n console.log(\"releaseCompileSlot\");\n }\n assert(requestedCompileSlot);\n if (requestedCompileSlot) {\n requestedCompileSlot = false;\n compileSlots.release(compile.id);\n }\n });\n compile.on(\"error\", (err) => {\n if (debug) {\n console.error(\"Got error from fiskc\", compile.id, compile.pid, err);\n }\n if (requestedCppSlot) {\n requestedCppSlot = false;\n cppSlots.release(compile.id);\n }\n if (requestedCompileSlot) {\n requestedCompileSlot = false;\n compileSlots.release(compile.id);\n }\n });\n compile.on(\"end\", () => {\n if (debug) {\n console.log(\"got end from\", compile.id, compile.pid);\n }\n if (requestedCppSlot) {\n requestedCppSlot = false;\n cppSlots.release(compile.id);\n }\n if (requestedCompileSlot) {\n requestedCompileSlot = false;\n compileSlots.release(compile.id);\n }\n });\n});\nprocess.on(\"exit\", () => {\n server.close();\n});\nprocess.on(\"SIGINT\", () => {\n server.close();\n process.exit();\n});\n/*\n const client = new Client(option, common.Version);\n\nlet connectInterval;\nclient.on('quit', message => {\n process.exit(message.code);\n});\n\nclient.on('connect', () => {\n console.log('connected');\n if (connectInterval) {\n clearInterval(connectInterval);\n connectInterval = undefined;\n }\n});\n\nclient.on('error', err => {\n console.error('client error', err);\n});\n\nclient.on('close', () => {\n console.log('client closed');\n if (!connectInterval) {\n connectInterval = setInterval(() => {\n console.log('Reconnecting...');\n client.connect();\n }, 1000);\n }\n});\n*/\n//# sourceMappingURL=fisk-daemon.js.map","references":["/home/abakken/dev/fisk/daemon/constants.ts","/home/abakken/dev/fisk/daemon/server.ts","/home/abakken/dev/fisk/daemon/slots.ts","/home/abakken/dev/fisk/common/index.ts","/home/abakken/dev/fisk/node_modules/@jhanssen/options/index.d.ts"],"map":"{\"version\":3,\"file\":\"fisk-daemon.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../daemon/fisk-daemon.ts\"],\"names\":[],\"mappings\":\"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,MAAM,GAAG,OAAO,CAAC;IACnB,MAAM,EAAE,aAAa;IACrB,iBAAiB,EAAE,IAAI;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C,CAAC;SACvE;QACD,IAAI,gBAAgB,EAAE;YAClB,gBAAgB,GAAG,KAAK,CAAC;YACzB,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SAChC;QACD,IAAI,oBAAoB,EAAE;YACtB,oBAAoB,GAAG,KAAK,CAAC;YAC7B,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SACpC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;QACnB,IAAI,KAAK,EAAE;YACP,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;SACxD;QACD,IAAI,gBAAgB,EAAE;YAClB,gBAAgB,GAAG,KAAK,CAAC;YACzB,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SAChC;QACD,IAAI,oBAAoB,EAAE;YACtB,oBAAoB,GAAG,KAAK,CAAC;YAC7B,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SACpC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,MAAM,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,MAAM,CAAC,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,IAAI,EAAE,CAAC;AACnB,CAAC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BE\"}"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"code":"import fs from \"fs-extra\";\nimport os from \"os\";\nimport path from \"path\";\nconst Version = 5;\nfunction cacheDir(option) {\n let dir = option(\"cache-dir\");\n if (!dir) {\n // @ts-ignore\n dir = path.join(os.homedir(), \".cache\", \"fisk\", path.basename(option.prefix));\n }\n return String(dir);\n}\nfunction validateCache(option) {\n const dir = cacheDir(option);\n const file = path.join(dir, \"version\");\n // console.log(dir);\n let version;\n try {\n version = fs.readFileSync(file);\n if (version.readUInt32BE() === Version) {\n return;\n }\n }\n catch (err) {\n /* */\n }\n if (version) {\n console.log(`Wrong version. Destroying cache ${dir}`);\n }\n fs.removeSync(dir);\n fs.mkdirpSync(dir);\n const buf = Buffer.allocUnsafe(4);\n buf.writeUInt32BE(Version);\n fs.writeFileSync(file, buf);\n}\nexport default function (option) {\n validateCache(option);\n return {\n cacheDir: cacheDir.bind(undefined, option),\n Version\n };\n}\n//# sourceMappingURL=index.js.map","references":["/home/abakken/dev/fisk/node_modules/@jhanssen/options/index.d.ts","/home/abakken/dev/fisk/node_modules/@types/fs-extra/index.d.ts"],"map":"{\"version\":3,\"file\":\"index.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../common/index.ts\"],\"names\":[],\"mappings\":\"AACA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,OAAO,GAAG,CAAC,CAAC;AAElB,SAAS,QAAQ,CAAC,MAAsB;IACpC,IAAI,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAC9B,IAAI,CAAC,GAAG,EAAE;QACN,aAAa;QACb,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;KACjF;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,aAAa,CAAC,MAAsB;IACzC,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACvC,oBAAoB;IACpB,IAAI,OAAO,CAAC;IACZ,IAAI;QACA,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,OAAO,CAAC,YAAY,EAAE,KAAK,OAAO,EAAE;YACpC,OAAO;SACV;KACJ;IAAC,OAAO,GAAG,EAAE;QACV,KAAK;KACR;IACD,IAAI,OAAO,EAAE;QACT,OAAO,CAAC,GAAG,CAAC,mCAAmC,GAAG,EAAE,CAAC,CAAC;KACzD;IACD,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACnB,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACnB,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAClC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3B,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAChC,CAAC;AAID,MAAM,CAAC,OAAO,WAAW,MAAsB;IAC3C,aAAa,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO;QACH,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC;QAC1C,OAAO;KACV,CAAC;AACN,CAAC\"}"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"code":"import { ClientBuffer } from \"./clientbuffer\";\nimport { Constants } from \"./constants\";\nimport EventEmitter from \"events\";\nclass Compile extends EventEmitter {\n constructor(conn, id, option) {\n super();\n this.debug = Boolean(option(\"debug\"));\n this.id = id;\n this.connection = conn;\n this.buffer = new ClientBuffer();\n this.messageLength = 0;\n this.pid = undefined;\n this.connection.on(\"data\", this._onData.bind(this));\n this.connection.on(\"end\", () => {\n // console.log(\"connection ended\", id);\n this.emit(\"end\");\n });\n this.connection.on(\"error\", (err) => {\n // console.log(\"connection error\", id, err);\n this.emit(\"error\", err);\n });\n }\n send(message) {\n if (this.debug) {\n console.log(\"Compile::send\", message);\n }\n try {\n if (typeof message === \"number\") {\n this.connection.write(Buffer.from([message]));\n }\n else {\n const msg = Buffer.from(JSON.stringify(message), \"utf8\");\n const header = Buffer.allocUnsafe(5);\n header.writeUInt8(Constants.JSONResponse, 0);\n header.writeUInt32BE(msg.length, 1);\n if (this.debug) {\n console.log(\"Compile::send header\", header, Constants.JSONResponse);\n }\n this.connection.write(header);\n this.connection.write(msg);\n }\n }\n catch (err) {\n console.error(\"Got error sending message\", err);\n }\n }\n _onData(data) {\n // console.log(\"got data\", data.length);\n this.buffer.write(data);\n let available = this.buffer.available;\n if (this.debug) {\n console.log(\"Compile::_onData\", \"id\", this.id, \"pid\", this.pid, data, \"available\", available, this.messageLength);\n }\n if (!this.pid) {\n if (available < 4) {\n return;\n }\n const pidBuffer = this.buffer.read(4);\n available -= 4;\n this.pid = pidBuffer.readUInt32BE();\n if (this.debug) {\n console.log(\"Compile::_onData got pid\", \"id\", this.id, \"pid\", this.pid);\n }\n }\n const emit = (type) => {\n if (this.debug) {\n console.log(\"Compile::_onData::emit\", type, available);\n }\n const read = this.buffer.read(1);\n if (this.debug) {\n console.log(\"Discarded\", read);\n }\n --available;\n this.emit(type);\n };\n while (available) {\n if (!this.messageLength) {\n if (this.debug) {\n console.log(\"peeking\", this.buffer.peek());\n }\n switch (this.buffer.peek()) {\n case Constants.AcquireCppSlot:\n emit(\"acquireCppSlot\");\n continue;\n case Constants.AcquireCompileSlot:\n emit(\"acquireCompileSlot\");\n continue;\n case Constants.ReleaseCppSlot:\n emit(\"releaseCppSlot\");\n continue;\n case Constants.ReleaseCompileSlot:\n emit(\"releaseCompileSlot\");\n continue;\n case Constants.JSON:\n if (available < 5) {\n break;\n }\n this.buffer.read(1);\n this.messageLength = this.buffer.read(4).readUInt32BE();\n available -= 5;\n break;\n default:\n console.error(\"Bad data\", this.buffer.peek(), \"available\", available);\n throw new Error(\"Got unexpected type \" + this.buffer.peek());\n }\n }\n if (!this.messageLength || this.messageLength > available) {\n // console.log(\"Still waiting on data\", this.messageLength, this.buffer.available);\n break;\n }\n const raw = this.buffer.read(this.messageLength);\n available -= this.messageLength;\n this.messageLength = 0;\n try {\n const msg = JSON.parse(raw.toString(\"utf8\"));\n if (this.debug) {\n console.log(\"Got json message\", msg);\n }\n // console.log(\"Got message\", msg);\n this.emit(msg.type, msg);\n }\n catch (err) {\n console.error(\"Bad JSON received\", err);\n this.connection.destroy();\n break;\n }\n }\n }\n}\nexport { Compile };\n//# sourceMappingURL=compile.js.map","references":["/home/abakken/dev/fisk/daemon/clientbuffer.ts","/home/abakken/dev/fisk/daemon/constants.ts","/home/abakken/dev/fisk/node_modules/@jhanssen/options/index.d.ts"],"map":"{\"version\":3,\"file\":\"compile.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../daemon/compile.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,MAAM,OAAQ,SAAQ,YAAY;IAS9B,YAAY,IAAY,EAAE,EAAU,EAAE,MAAsB;QACxD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC;QAErB,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACpD,IAAI,C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C,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,GAAG,SAAS,EAAE;gBACvD,mFAAmF;gBACnF,MAAM;aACT;YAED,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACjD,SAAS,IAAI,IAAI,CAAC,aAAa,CAAC;YAChC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;YAEvB,IAAI;gBACA,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC7C,IAAI,IAAI,CAAC,KAAK,EAAE;oBACZ,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;iBACxC;gBACD,mCAAmC;gBACnC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aAC5B;YAAC,OAAO,GAAG,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;gBACxC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;gBAC1B,MAAM;aACT;SACJ;IACL,CAAC;CACJ;AAED,OAAO,EAAE,OAAO,EAAE,CAAC\"}"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"code":"import { Compile } from \"./compile\";\nimport EventEmitter from \"events\";\nimport fs from \"fs-extra\";\nimport net from \"net\";\nimport path from \"path\";\nclass Server extends EventEmitter {\n constructor(option, common) {\n super();\n this.debug = Boolean(option(\"debug\"));\n this.file = String(option(\"socket\", path.join(common.cacheDir(), \"socket\")));\n this.server = undefined;\n this.option = option;\n this._connections = {};\n this._connectionId = 0;\n }\n close() {\n if (this.debug) {\n console.log(\"Server::close\");\n }\n if (this.server) {\n this.server.close();\n }\n try {\n fs.unlinkSync(this.file);\n }\n catch (err) {\n /* */\n }\n }\n listen() {\n try {\n fs.unlinkSync(this.file); // this should be more\n // complicated with attempts to\n // cleanly shut down and whatnot\n }\n catch (err) {\n /* */\n }\n return new Promise((resolve) => {\n let connected = false;\n this.server = net.createServer(this._onConnection.bind(this)).listen(this.file, () => {\n fs.chmodSync(this.file, \"777\");\n connected = true;\n resolve();\n });\n this.server.on(\"error\", (err) => {\n if (!connected) {\n console.error(\"Got server error\", err);\n setTimeout(this.listen.bind(this), 1000);\n }\n });\n this.server.on(\"close\", (err) => {\n if (!connected) {\n console.error(\"Got server error\", err);\n setTimeout(this.listen.bind(this), 1000);\n }\n });\n });\n }\n _onConnection(conn) {\n const compile = new Compile(conn, ++this._connectionId, this.option);\n if (this.debug) {\n console.log(\"Server::_onConnection\", compile.id);\n }\n if (this._connectionId === Math.pow(2, 31) - 1) {\n this._connectionId = 0;\n }\n this._connections[compile.id] = conn;\n compile.on(\"end\", () => {\n if (this.debug) {\n console.log(\"Compile::end\");\n }\n delete this._connections[compile.id];\n });\n this.emit(\"compile\", compile);\n }\n}\nexport { Server };\n//# sourceMappingURL=server.js.map","references":["/home/abakken/dev/fisk/common/index.ts","/home/abakken/dev/fisk/daemon/compile.ts","/home/abakken/dev/fisk/node_modules/@jhanssen/options/index.d.ts","/home/abakken/dev/fisk/node_modules/@types/fs-extra/index.d.ts"],"map":"{\"version\":3,\"file\":\"server.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../daemon/server.ts\"],\"names\":[],\"mappings\":\"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,GAAe,MAAM,KAAK,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,MAAO,SAAQ,YAAY;IAS7B,YAAY,MAAsB,EAAE,MAAc;QAC9C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC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C,CAAC;aAC/B;YAED,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC;CACJ;AAED,OAAO,EAAE,MAAM,EAAE,CAAC\"}"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"code":"class ClientBuffer {\n constructor() {\n this.buffers = [];\n this.offset = 0;\n }\n write(buffer) {\n this.buffers.push(buffer);\n // console.log(\"write\", buffer.length, this.buffers.length, this.available);\n }\n peek() {\n if (!this.available) {\n throw new Error(\"No data available\");\n }\n return this.buffers[0][this.offset];\n }\n read(len) {\n if (!len) {\n throw new Error(\"Don't be a tool\");\n }\n if (len > this.available) {\n throw new Error(\"We don't have this many bytes available \" + len + \">\" + this.available);\n }\n // console.log(\"read\", len, this.available);\n let ret;\n if (this.buffers[0].length - this.offset >= len) {\n // buffers[0] is enough\n const buf = this.buffers[0];\n if (buf.length - this.offset === len) {\n ret = this.offset ? buf.slice(this.offset) : buf;\n this.offset = 0;\n this.buffers.splice(0, 1);\n return ret;\n }\n ret = buf.slice(this.offset, this.offset + len);\n this.offset += len;\n return ret;\n }\n ret = Buffer.allocUnsafe(len);\n let retOffset = 0;\n this.buffers[0].copy(ret, 0, this.offset);\n retOffset += this.buffers[0].length - this.offset;\n this.offset = 0;\n this.buffers.splice(0, 1);\n while (retOffset < len) {\n const needed = len - retOffset;\n const buf = this.buffers[0];\n if (buf.length <= needed) {\n this.buffers[0].copy(ret, retOffset);\n retOffset += this.buffers[0].length;\n this.buffers.splice(0, 1);\n }\n else {\n this.buffers[0].copy(ret, retOffset, 0, needed);\n retOffset += needed;\n this.offset = needed;\n }\n }\n return ret;\n }\n get available() {\n return this.buffers.reduce((total, buf) => total + buf.length, 0) - this.offset;\n }\n}\nexport { ClientBuffer };\n//# sourceMappingURL=clientbuffer.js.map","references":[],"map":"{\"version\":3,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AAI,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;gBAChD,SAAS,IAAI,MAAM,CAAC;gBACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;aACxB;SACJ;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;IACpF,CAAC;CACJ;AAED,OAAO,EAAE,YAAY,EAAE,CAAC\"}"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/README.md
CHANGED
package/builder/fisk-builder.js
CHANGED
|
@@ -464,9 +464,6 @@ client.on("getEnvironments", message => {
|
|
|
464
464
|
console.log("Got finish", env);
|
|
465
465
|
exec("tar xf '" + file + "'", { cwd: dir }).
|
|
466
466
|
then(() => {
|
|
467
|
-
console.log("Checking that the environment runs", path.join(dir, "bin", "true"));
|
|
468
|
-
return exec(`"${path.join(dir, "bin", "true")}"`, { cwd: dir });
|
|
469
|
-
}).then(() => {
|
|
470
467
|
const json = path.join(dir, "environment.json");
|
|
471
468
|
console.log("Writing json file", json);
|
|
472
469
|
return fs.writeFile(json, JSON.stringify({ hash: env, created: new Date().toString() }));
|