Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modelica source files outside of the directory of the parser are not found #225

Open
KarlWalther opened this issue Mar 20, 2024 · 3 comments
Assignees

Comments

@KarlWalther
Copy link

to recreate the issue place the Modelica source file (here multIn.mo) outside of the directory of the parser, for example:

node app.js -f ..\modelicaForTranslator\multIn.mo -o cxf

Absolute paths don't work either.

@anandkp92 anandkp92 self-assigned this Mar 20, 2024
@anandkp92
Copy link
Member

anandkp92 commented Mar 20, 2024

Attaching the stacktrace:

C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf>node app.js -f ..\modelicaForTranslator\multIn.mo -o cxf
Error: EINVAL: invalid argument, mkdir 'C:\Users\kwalther\AppData\Local\Temp\json3K0GaI\json\C:'
    at Object.mkdirSync (node:fs:1380:26)
    at C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\util.js:295:16
    at Array.reduce (<anonymous>)
    at createDir (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\util.js:292:10)
    at Object.writeFile (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\util.js:282:3)
    at getSimpleJson (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\parser.js:109:6)
    at Object.getJsons (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\parser.js:48:24)
    at C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\app.js:101:10
    at new Promise (<anonymous>)
    at Object.<anonymous> (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\app.js:97:35)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'mkdir',
  path: 'C:\\Users\\kwalther\\AppData\\Local\\Temp\\json3K0GaI\\json\\C:'
}
node:fs:581
  return binding.open(
                 ^

Error: ENOENT: no such file or directory, open 'C:\Users\kwalther\AppData\Local\Temp\json3K0GaI\json\C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelicaForTranslator\multIn.json'
    at Object.openSync (node:fs:581:18)
    at Object.writeFileSync (node:fs:2342:35)
    at Object.writeFile (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\util.js:283:6)
    at getSimpleJson (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\parser.js:109:6)
    at Object.getJsons (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\parser.js:48:24)
    at C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\app.js:101:10
    at new Promise (<anonymous>)
    at Object.<anonymous> (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\app.js:97:35)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\kwalther\\AppData\\Local\\Temp\\json3K0GaI\\json\\C:\\Users\\kwalther\\sciebo\\research_visits\\lbnl\\cdl\\cdl2plc\\modelica-json-issue214_cxf\\modelicaForTranslator\\multIn.json'
}

@anandkp92
Copy link
Member

@KarlWalther it seems that the error might be with creating a directory. Can you try this with a -d test_op? Just point the output directory to a folder within the modelica-json folder:

node app.js -f ..\modelicaForTranslator\multIn.mo -o cxf -d test_op

@KarlWalther
Copy link
Author

@anandkp92 you mean with an empty test_op folder? that does not work either. Here the stacktrace: (note: the file is called multiIn now instead of multIn)

C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf>node app.js -f ..\modelicaForTranslator\multiIn.mo -o cxf -d test_op
Error: EINVAL: invalid argument, mkdir 'C:\Users\kwalther\AppData\Local\Temp\jsonyVLJH2\json\C:'
    at Object.mkdirSync (node:fs:1380:26)
    at C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\util.js:295:16
    at Array.reduce (<anonymous>)
    at createDir (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\util.js:292:10)
    at Object.writeFile (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\util.js:282:3)
    at getSimpleJson (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\parser.js:109:6)
    at Object.getJsons (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\parser.js:48:24)
    at C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\app.js:101:10
    at new Promise (<anonymous>)
    at Object.<anonymous> (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\app.js:97:35)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'mkdir',
  path: 'C:\\Users\\kwalther\\AppData\\Local\\Temp\\jsonyVLJH2\\json\\C:'
}
node:fs:581
  return binding.open(
                 ^

Error: ENOENT: no such file or directory, open 'C:\Users\kwalther\AppData\Local\Temp\jsonyVLJH2\json\C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelicaForTranslator\multiIn.json'
    at Object.openSync (node:fs:581:18)
    at Object.writeFileSync (node:fs:2342:35)
    at Object.writeFile (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\util.js:283:6)
    at getSimpleJson (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\parser.js:109:6)
    at Object.getJsons (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\lib\parser.js:48:24)
    at C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\app.js:101:10
    at new Promise (<anonymous>)
    at Object.<anonymous> (C:\Users\kwalther\sciebo\research_visits\lbnl\cdl\cdl2plc\modelica-json-issue214_cxf\modelica-json-issue214_cxf\app.js:97:35)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\kwalther\\AppData\\Local\\Temp\\jsonyVLJH2\\json\\C:\\Users\\kwalther\\sciebo\\research_visits\\lbnl\\cdl\\cdl2plc\\modelica-json-issue214_cxf\\modelicaForTranslator\\multiIn.json'
}

Node.js v20.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants