Skip to content

pkg/jerryscript: build into '$(BINDIR)' and cleanups#9824

Merged
aabadie merged 6 commits intoRIOT-OS:masterfrom
cladmi:pr/make/jerryscript/clean
Dec 19, 2018
Merged

pkg/jerryscript: build into '$(BINDIR)' and cleanups#9824
aabadie merged 6 commits intoRIOT-OS:masterfrom
cladmi:pr/make/jerryscript/clean

Conversation

@cladmi
Copy link
Copy Markdown
Contributor

@cladmi cladmi commented Aug 22, 2018

Contribution description

Build into the BINDIR directory instead of the source repository.
This makes 'clean' work as expected without other intervention.

Also it goes in the direction of having the package source repository
board independent.

I also included cleanup for jerryscript makefiles self described in the commits messages.

Testing procedure

Clean actually now cleans.

rm -rf bin; make; make clean
# Then check
ls bin; git -C bin/pkg/native/jerryscript/ status --porcelain
pkg
?? .git-downloaded

In master we had

ls bin; git -C bin/pkg/native/jerryscript/ status --porcelain
pkg
?? .git-downloaded
?? riot/

Where riot contained all the build files.

Issues/PRs references

Part of #9820

@cladmi cladmi added Area: build system Area: Build system Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 22, 2018
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Aug 22, 2018

@cgundogan any idea why changing this -H to an absolute directory is required ?

@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Aug 23, 2018

It does not fail on my computer and with docker with a relative path so will retry without the absolute one.

@cladmi cladmi added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 23, 2018
@cladmi cladmi added this to the Release 2018.10 milestone Aug 23, 2018
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Aug 23, 2018

Non parallel build works

BOARDS="slstk3402a" make -C examples/javascript/ TOOLCHAIN=llvm buildtest 'BUILDTEST_MAKE_REDIRECT=>/dev/null'  NPROC=1

Parallel does not

BOARDS="slstk3402a" make -C examples/javascript/ TOOLCHAIN=llvm buildtest 'BUILDTEST_MAKE_REDIRECT=>/dev/null'  NPROC=

Now it is reproducible I can investigate.

@cladmi cladmi added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 24, 2018
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Aug 24, 2018

Found that it is because I replaced the default target by all to correctly use what was in Makefile.base. But that is actually causing problems as it overwrites jerryscript.a.

I think it should not even include Makefile.base as it is not used.

@cladmi cladmi added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 11, 2018
@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 11, 2018
miri64 added a commit to miri64/RIOT that referenced this pull request Sep 11, 2018
@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 11, 2018
@@ -1,15 +1,14 @@
BUILD_DIR ?= $(CURDIR)/riot
BUILD_DIR ?= $(BINDIR)/jerryscript
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why not use BUILD_DIR ?= $(PKG_BUILDDIR) instead?

Copy link
Copy Markdown
Contributor Author

@cladmi cladmi Sep 25, 2018

Choose a reason for hiding this comment

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

First it is not defined there, and also it is the directory where the package is cloned.

As described in the commit message and the title of this PR. It is the goal of this one to move toward out of source build, and all normal modules in RIOT build in $(BINDIR)/module_name.

With out of source build, the package could be cloned only once for all platforms (20M * 120 boards == a lot).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok, then we definitely need to work on the naming of RIOT directories. Because if PKG_BUILDDIR is the directory where the package is cloned and not build, its very confusing - the name is why I suggested to use that for BUILD_DIR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Some of the packages are still build into there when they use their own build system.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Dec 19, 2018

@cladmi, what is the status of this PR ? It would at least require a rebase

Do not include Makefile.base as 'DIRS' are not used here.
Also if 'all' target was to be used, there would be two rules creating
`$(BINDIR)/jerryscript.a`.

By default `Makefile.jerryscript` executes `libjerry` as it is the first
target.
Remove unknown rules from .PHONY.
Make 'all' be the default target for jerryscript and execute `all` target.
This way no definition order issue could happen in the future.
Build into the BINDIR directory instead of the source repository.
This makes 'clean' work as expected without other intervention.

Also it goes in the direction of having the package source repository
board independent.
@cladmi cladmi force-pushed the pr/make/jerryscript/clean branch from babed28 to 3a125b6 Compare December 19, 2018 13:33
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Dec 19, 2018

I squashed to remove the commits that were more on the finding what to do path.

There are now the 5 first commits (check the order locally and not from github as it uses author date) that are for cleaning up and style changes.
And the 6th commit that changes the build directory to BINDIR/jerryscript.

I could split if wanted.

The test command using llvm in the comment does not work anymore as llvm is blacklisted, so just remove the toolchain for now in this command.

Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Changes are OK and tested locally on Arduino-Zero with success.

All commit messages contains the right explanation for the changes, this helps understanding the changes.

ACK

@aabadie aabadie merged commit 8e4b6ed into RIOT-OS:master Dec 19, 2018
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Dec 19, 2018

Thank you for the review.

@cladmi cladmi deleted the pr/make/jerryscript/clean branch December 19, 2018 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants