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

Move os module under the devices. #28

Merged

Conversation

robertsipka
Copy link
Contributor

It is unnecessary to supports several OS for each device.
We should support only NuttX-stm32f4, Linux-rpi2, TizenRT-artik053, etc. pairs.

JSRemoteTest-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com

@robertsipka
Copy link
Contributor Author

I couldn't try out on artik053 device.
@hs0225: Could you please check this patch on artik053 device?

build_flags.append('--target-board=artik05x')
build_flags.append('--sysroot=%s' % paths.TIZENRT_OS_PATH)

else:
console.fail('Non-minimal IoT.js build failed, unsupported '
'device-os (%s-%s) combination!' %
(self.device.get_type(), self.os))
'device (%s)!' % device.get_type())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was created to throw an error when a not supported device - os combination was defined by the user (e.g. rpi2 - nuttx). Since this patch hides the os selection from the user, we can remove the else case fully.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep this case. It is a remainder for us which ensures to set the appropriate build flags when adding a new device.


# prebuild the OS
os = device.get_os()
os.prebuild(self)
Copy link
Contributor

@rtakacs rtakacs Sep 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that we need to prebuild the os in the app's build method? (I think they are two different things, so the app should not build the os in order to be they independent.)

I think it would be clearer if the os.prebuild could happen in the device's __init__ method (after the os instantiation), because the os is the part of the device right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some function calls in the os.prebuild method which depends on the application. This is a bigger change compared to the previous state where these functions were called from the os module's __init__ method. That solution was depend on both of the application and the device (which I think is worse).
But I'am agree with you, I will thinking on a proper solution to eliminate these dependencies.


# Run the buildscript.
utils.execute(paths.IOTJS_PATH, 'tools/build.py', build_flags)

os.build(self, self.buildtype, 'all')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this can be moved to the device.flash method to be the app and the os builds independent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would not be a right approach to call the os.build function in the device.flash. It must be independent from that. It seems that there are still some unresolved dependencies. We should talk about it offline and implements a better solution.


# prebuild the OS
os = device.get_os()
os.prebuild(self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as in case of iotjs. (above)

build_flags = [
'-f',
'targets/tizenrt-artik053/Makefile.tizenrt',
'LIBTARGET_DIR=' + paths.TIZENRT_BUILD_LIBRARIES_PATH
]
utils.execute(paths.JERRY_PATH, 'make', build_flags)

def skip_test(self, test):
os.build(self, self.buildtype, 'all')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as in case of iotjs. (above)

@hs0225
Copy link
Contributor

hs0225 commented Sep 14, 2017

@robertsipka There will be a change in the artik053 build. You don't have to worry about it. I will update it later.

@yichoi
Copy link

yichoi commented Sep 29, 2017

@robertsipka rebase please

@rtakacs
Copy link
Contributor

rtakacs commented Sep 29, 2017

LGTM after rebasing the commit. The dependency elimination (commented above) could be an other independent PR.

It is unnecessary to supports several OS for each device.
We should support only NuttX-stm32f4, Linux-rpi2, TizenRT-artik053, etc. pairs.

JSRemoteTest-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
@robertsipka
Copy link
Contributor Author

I've rebased it with master.

@bzsolt
Copy link
Member

bzsolt commented Sep 29, 2017

LGTM

@rtakacs rtakacs merged commit a305923 into jerryscript-project:master Sep 29, 2017
@rtakacs rtakacs mentioned this pull request Oct 12, 2017
7 tasks
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

Successfully merging this pull request may close these issues.

5 participants