-
Notifications
You must be signed in to change notification settings - Fork 10
Platform specific file copying #145
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
Conversation
add Jira link to PR desciption? |
why py3 fails? |
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.
something wrong with python3:
test_run_with_file_with_all (hardware.test_flash.FlashTestCaseHW) ... After 10s process did not stop
there was also transfer timeout. I'll re-trig test job to see if there is something unstable..
mbed_flasher/flashers/FlasherMbed.py
Outdated
self.logger.exception("File couldn't be copied") | ||
raise FlashError(message="File couldn't be copied", | ||
return_code=EXIT_CODE_OS_ERROR) | ||
|
||
def _copy_file_windows(self, source, destination): | ||
command = "copy \"{}\" \"{}\"".format(os.path.abspath(source), destination) |
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.
why this os.path.abspath()
?
def _copy_file_windows(self, source, destination): | ||
command = "copy \"{}\" \"{}\"".format(os.path.abspath(source), destination) | ||
self.logger.debug("Copying with command: {}".format(command)) | ||
subprocess.check_call(command) |
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.
this is still an problem, need some change
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.
Why is it a problem?
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 you figured out it already 👍
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 don't understand the purpose to start a new command interpreter, would mind explain a bit?
C:\>cmd /?
Starts a new instance of the Windows XP command interpreter
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.
It is one way to avoid using shell=True, which we do not want to use for security reasons.
5ee7a7f
to
a8d2aa6
Compare
Once this change is in, what is the plan to measure whether the system is more robust.. less robust.. same robust? |
That comment is targeted to #143, which does not pass acceptance. The changes this PR brings compared to v0.9.1 are described in description. |
10e1455
to
1f38517
Compare
Status
READY
Description
Revert back to platform specific file copying as the current implementation is not robust.
In non windows platforms file is now created with flags:
os.O_CREAT | os.O_TRUNC | os.O_RDWR | os.O_SYNC
with the exception of arm machines which stay:
os.O_CREAT | os.O_TRUNC | os.O_RDWR | os.O_DIRECT
http://man7.org/linux/man-pages/man2/open.2.html
https://jira.arm.com/browse/IOTSYSTOOL-1290