-
Notifications
You must be signed in to change notification settings - Fork 443
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
[IR Compiler] fix error when creating json file #1743
Conversation
… to /tmp instead of current to have access to
@@ -46,9 +46,12 @@ | |||
// represent ir plan as a chain of operators | |||
public class IrPlan implements Closeable { | |||
private static IrCoreLibrary irCoreLib = IrCoreLibrary.INSTANCE; | |||
private static String PLAN_JSON_FILE = "plan.json"; | |||
// write to '/tmp' which is accessible from common users | |||
private static String JSON_PLAN_DIR = "/tmp"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we obtain temporary folder from some environment variables. For example, Mac's temporary fold is not at "/tmp"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think /tmp
is ok in macOS, which is a link to /private/tmp
, Or maybe you can get the tmp directory by System.getProperty('java.io.tmpdir')
https://kodejava.org/how-do-i-get-operating-system-temporary-directory-folder/
package org.kodejava.lang;
public class TempDirExample {
public static void main(String[] args) {
// This is the property name for accessing OS temporary directory
// or folder.
String property = "java.io.tmpdir";
// Get the temporary directory and print it.
String tempDir = System.getProperty(property);
System.out.println("OS temporary directory is " + tempDir);
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Codecov Report
@@ Coverage Diff @@
## main #1743 +/- ##
===========================================
- Coverage 73.23% 40.22% -33.01%
===========================================
Files 89 89
Lines 9764 9764
===========================================
- Hits 7151 3928 -3223
- Misses 2613 5836 +3223
Continue to review full report at Codecov.
|
What do these changes do?
Related issue number
Fixes #1729