Skip to content

Re-thinking the build system to bring it more into line with the conv… #1192

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

Merged

Conversation

robertsipka
Copy link
Contributor

…entions.

We removed that implementation where the build directory isn't set up to build with exactly one
configuration of the project but potentially several variants: the same build directory
can/must be used for debug and release builds, for full or compact profile versions, etc.
So we reworked the CMakeLists, and now one build dir deal with exactly one configuration
of the project's libraries and tools.

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected]
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka [email protected]

@robertsipka
Copy link
Contributor Author

This patch is not a final version, the python scripts have to be developed and update is needed for the Makefiles of the external targets after these changes.

@zherczeg
Copy link
Member

zherczeg commented Jul 8, 2016

But people can give their feedback earlier.

@robertsipka robertsipka force-pushed the rethinking_buildsystem branch from 6c2c267 to b1c6e02 Compare July 8, 2016 10:08
@LaszloLango LaszloLango added enhancement An improvement tools Related to the tooling scripts labels Jul 8, 2016
@LaszloLango LaszloLango added this to the Release v1.0 milestone Jul 8, 2016
# Compile/link flags
# build mode specific compile/link flags

if(CMAKE_BUILD_TYPE STREQUAL "Release")
Copy link
Member

Choose a reason for hiding this comment

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

No need for the if.
CMAKE_C_FLAGS_RELEASE will only be used when the build type is Release.

@LaszloLango
Copy link
Contributor

docs/01.GETTING-STARTED.md should be updated after this patch

@robertsipka robertsipka force-pushed the rethinking_buildsystem branch from b1c6e02 to dc2aeaf Compare July 18, 2016 14:13
@robertsipka
Copy link
Contributor Author

We updated this patch based on the comments and we finished the missing tool scripts.
Makefiles of the external targets will be updated in the follow-up patches.

set(DEFINES_JERRY
${DEFINES_JERRY}
JERRY_ENABLE_SNAPSHOT_SAVE
JERRY_ENABLE_SNAPSHOT_EXEC
Copy link
Member

Choose a reason for hiding this comment

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

Does snapshot always set?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it does. This behaviour is similiar to the current one.
But this is unnecessary, so we made this defines optionally.
If both of them are disabled, then the size of Thumb-2 binary on RPi2 is reduced by ~3.5Kbyte.

@zherczeg
Copy link
Member

zherczeg commented Jul 19, 2016

I like this python based master script far more than the make based.

@LaszloLango
Copy link
Contributor

@robertsipka, the PR has conflicts. Please rebase to the current master.

@robertsipka robertsipka force-pushed the rethinking_buildsystem branch from dc2aeaf to 77378b7 Compare July 20, 2016 12:31
@robertsipka
Copy link
Contributor Author

I've rebased this patch with master and updated it based on your comments.

@LaszloLango
Copy link
Contributor

Is this still a WIP patch?

@robertsipka robertsipka changed the title WIP: Re-thinking the build system to bring it more into line with the conv… Re-thinking the build system to bring it more into line with the conv… Jul 21, 2016

# Setup directories
# Project binary dir
set(PROJECT_BINARY_DIR ${CMAKE_BINARY_DIR})
Copy link
Contributor

Choose a reason for hiding this comment

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

CMake variables should be quoted. See also: #472
"${CMAKE_BINARY_DIR}"

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/)

# Executable output directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/)
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@LaszloLango
Copy link
Contributor

Please check the CMake variables and use quote chars, if they can contain space character (like storing path).

@robertsipka robertsipka force-pushed the rethinking_buildsystem branch from 77378b7 to cf27a0f Compare July 27, 2016 07:51
@zherczeg
Copy link
Member

Thank you for the hard work. LGTM

@tilmannOSG
Copy link

Wow nice, I really like this patch. I just gave this a try and did a "python tools/build.py" and a couple seconds later I have my JerryScript binary. That's exactly the "works out of the box" experience we want to have :)

@@ -11,20 +11,20 @@ before_install:

install:

script: "make -j VERBOSE=1 NINJA=1 $TARGET"
script: "python tools/run-tests.py $OPTS"

Choose a reason for hiding this comment

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

Not sure whether it makes much of a difference given our small project size but it would be great if Travis CI could still use Ninja for the build :)

@tilmannOSG
Copy link

Great patch! LGTM from my side.
The only larger thing I noticed is that this patch effectively drops support for the STM32F3/4 MCU targets. We should definitely add that back in with instructions on downloading the respective files from the ST page or alternatively we put our own headers/startup code in the repository to support those boards. I don't think this is a blocker preventing this patch from going in though. Support for the STM32F3/4 can be added in a separate patch.

@zherczeg
Copy link
Member

The difficulty with STM32 is the board support package cannot be downloaded without human intervention (accepting license) anymore, and it is unnecessary for those who does not target those systems. So we will add it back as a port, and those who wish to use it requires to perform some steps. I think this is a balanced approach.

@tilmannOSG
Copy link

Yes, expecting the users to download the files manually is perfectly fine.
An even better approach would be to not rely on the ST firmware package in the first place (I'm sure we're only using very few of the files anyway) and allow the JerryScript binary to be built and flashed to the device solely with open source tools like OpenOCD. E.g. the same way RIOT is doing it: https://github.com/RIOT-OS/RIOT/wiki/Board%3A-STM32F4discovery

@dbatyai
Copy link
Member

dbatyai commented Jul 28, 2016

Nice Patch! LGTM

…entions.

We removed that implementation where the build directory isn't set up to build with exactly one
configuration of the project but potentially several variants: the same build directory
can/must be used for debug and release builds, for full or compact profile versions, etc.
So we reworked the CMakeLists, and now one build dir deal with exactly one configuration
of the project's libraries and tools.

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected]
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka [email protected]
@robertsipka robertsipka force-pushed the rethinking_buildsystem branch from cf27a0f to ddab1d8 Compare July 28, 2016 10:31
@robertsipka
Copy link
Contributor Author

robertsipka commented Jul 28, 2016

Thanks, I've updated this patch based on your comments.

@tilmannOSG
Copy link

@robertsipka Thanks! I think the patch is now ready to go in :)

@zherczeg zherczeg merged commit ddab1d8 into jerryscript-project:master Jul 28, 2016
@robertsipka robertsipka deleted the rethinking_buildsystem branch November 24, 2016 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement tools Related to the tooling scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants