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

build-pkg: build a package second time in tree with all packages #1243

Merged
merged 12 commits into from
Apr 30, 2016

Conversation

starius
Copy link
Member

@starius starius commented Mar 2, 2016

This pull request implements second and third passes of #1111. In original proposal, the second pass builds a package in a tree with all packages except itself and its followers and the third pass rebuilds a package in a tree with all packages built. The third pass seems to be more strict than second, so it was implemented here.

Build log: https://gist.github.com/starius/a165cbb474f4d9c1dd7e
(It is based on commit 62467d9.)

Package fontconfig breaks on the seconds pass.

@tonytheodore
Copy link
Member

Thanks, this is looking good! I've done some testing on OS X and it's surfacing some new ordering errors log. It fails with a lua error during the second pass:

[134/419] The build is expected to complete in 10.8 hours, on Sun Apr 17 17:03:41 2016
lua: ./tools/build-pkg.lua:603: bad argument #1 to 'ipairs' (table expected, got nil)
stack traceback:
    [C]: in function 'ipairs'
    ./tools/build-pkg.lua:603: in upvalue 'prepareTree'
    ./tools/build-pkg.lua:651: in upvalue 'buildItem'
    ./tools/build-pkg.lua:895: in upvalue 'buildPackages'
    ./tools/build-pkg.lua:1066: in local 'main'
    ./tools/build-pkg.lua:1080: in main chunk
    [C]: in ?

I'm not sure how to investigate further (only building one target at the moment):

$ lua -v
Lua 5.3.1  Copyright (C) 1994-2015 Lua.org, PUC-Rio

It will be used in buildItem()
The second pass is done after the first one. During the second pass,
an item is built in tree of files from all other items. It checks that:

  * packages can be built in any order satisfying dependencies;
  * a package can be rebuilt after its dependee.

For both cases, not only build status is checked but also two sets of
files are compared. Currently content of files is not checked, only
their existance in both passes.

See mxe#1111
From the warning produced by "git add ." after removing a file with "rm":

> warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal',
> whose behaviour will change in Git 2.0 with respect to paths you removed.
> Paths like 'foo.txt' that are
> removed from your working tree are ignored with this version of Git.
>
> * 'git add --ignore-removal <pathspec>', which is the current default,
>   ignores paths you removed from your working tree.
>
> * 'git add --all <pathspec>' will let you also record the removals.
>
> Run 'git status' to check the paths you removed from your working tree.

$ git status --porcelain
 D foo.txt

$ git add --all .

$ git status --porcelain
D  foo.txt

$ git --version
git version 1.9.1
If a package is found to be broken on the first pass, then
prev_files = nil, because this structure is filled only
for non-broken packages.

See mxe#1243 (comment)
@starius
Copy link
Member Author

starius commented Apr 20, 2016

I fixed bad argument #1 to 'ipairs' error. It used to occur only if some package is broken on the first pass.

Rebased.

@tonytheodore, can you rerun it on OSX, please?

@tonytheodore
Copy link
Member

Thanks, rerun on OSX succeeds:
https://gist.github.com/tonytheodore/ab636c3b1078bc8f4b4179af4a8b5ac8

The third pass seems to be more strict than second, so it was implemented here.

I can't see any reference to a third pass, did you mean "wasn't implemented here"?

@starius
Copy link
Member Author

starius commented Apr 22, 2016

The third pass seems to be more strict than second, so it was implemented here.

I can't see any reference to a third pass, did you mean "wasn't implemented here"?

Sorry for this confusion.

I implemented third pass (in #1111 notation), but it is called "second" in this pull request, because #1111's "second" pass was not implemented.

According to #1111,

  • first pass is initial build of a package in tree with its dependencies,
  • second pass is build of a package in tree with all packages except packages depending on the package,
  • third pass is re-build of a package in tree with all packages except itself.

Third pass includes more packages in the tree, than second pass (namely packages depending on the package being built). That is why I said that the third pass seemed to be more strict than second.

@starius
Copy link
Member Author

starius commented Apr 22, 2016

$ make clean && MXE_NO_DEBS=1 MXE_DIR=pwd./tools/build-pkg.lua

By the way, MXE_DIR is not needed after 8ec0d4d

@tonytheodore
Copy link
Member

Thanks for clarifying - this is a great addition to the overall QA already offered by build-pkg, nice work!

P.S. existing users of build-pkg (yourself ;) will be surprised by the default second pass.

@tonytheodore tonytheodore merged commit ab6b7d9 into mxe:master Apr 30, 2016
@starius starius deleted the build-pkg-second-pass branch April 30, 2016 11:07
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.

None yet

2 participants