You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
When schematic viewer calls runYosysGhdl(), it doesn't call remove_file() on the .teroshdl_${random_id} file that it generates with createTempFileInHome(). This results in temporary schematic descriptions needlessly cluttering the user home directory.
Solution
In src/colibri/yosys/yosys.ts add remove_file(outputPathFilename); on line 175:
exportfunctionrunYosysGhdl(config: e_config,topTevel: string,sources: t_file[],callback: (result: e_schematic_result)=>void): any{// ...constexec_i=p.exec(cmd,opt_exec,(result: p_result)=>{// ...remove_file(outputPathFilename);// add this line herecallback(schematicResult);});returnexec_i;}
I've tested this on my machine (see additional context) with a couple of vhdl files, and it works as expected.
Alternatives I've considered
If there is a reason you want the file to exist after the schematic viewer call, consider replacing calls to createTempFileInHome() with calls to something like this (appended to src/colibri/process/utils.ts):
/** * Get the OS temporary directory path * @returns Temporary directory path**/exportfunctionget_temp_directory(): string{constos_temp_dir=os_lib.tempdir();returnos_temp_dir;}/** * Create a random file in the dedicated OS temporary directory * @returns Path to created random file in temp dir **/exportfunctioncreateTempFileInTmpdir(content: string): string{constos_temp_dir=get_temp_directory();constrandom_id=makeid(5);constfilePath=path_lib.join(os_temp_dir,`.teroshdl_${random_id}`);file_utils.save_file_sync(filePath,content);returnfilePath;}
This way files keep existing in the tempdir, without cluttering home directory.
Additional context
OS: Ubuntu 24.04 via WSL (x64)
VS Code ver: 1.95.2
TerosHDL ver: 6.0.14
The text was updated successfully, but these errors were encountered:
Problem
When schematic viewer calls
runYosysGhdl()
, it doesn't callremove_file()
on the.teroshdl_${random_id}
file that it generates withcreateTempFileInHome()
. This results in temporary schematic descriptions needlessly cluttering the user home directory.Solution
In
src/colibri/yosys/yosys.ts
addremove_file(outputPathFilename);
on line 175:I've tested this on my machine (see additional context) with a couple of vhdl files, and it works as expected.
Alternatives I've considered
If there is a reason you want the file to exist after the schematic viewer call, consider replacing calls to
createTempFileInHome()
with calls to something like this (appended tosrc/colibri/process/utils.ts
):This way files keep existing in the tempdir, without cluttering home directory.
Additional context
OS: Ubuntu 24.04 via WSL (x64)
VS Code ver: 1.95.2
TerosHDL ver: 6.0.14
The text was updated successfully, but these errors were encountered: