Opened 11 years ago

Closed 11 years ago

#10028 closed bug (fixed)

Make master build on Mac OS X again after PM-merge

Reported by: nielx Owned by: bonefish
Priority: normal Milestone: R1
Component: Build System Version: R1/alpha4.1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

There are several build problems on Mac OS X 10.8. I will try to resolve those and add patches as I go along.

Change History (26)

comment:1 by nielx, 11 years ago

patch: 01

comment:2 by bonefish, 11 years ago

0001, 0003, and 0005 look and can be applied.

Regarding 0002:

  • typo: "HOST_PATFORM"
  • In the "if" the "[" and "]" need to be separated by whitespace from the enclosed condition.
  • I'd prefer a HOST_EXTENDED_REGEX_SED (= "sed -r" / "sed -E") build variable provided by "configure", so there that platform checks can be avoided in the actions.

Regarding 0004:

  • A similar change is missing in LibsolvSolver.cpp:41.
  • Since half the build platforms don't support the "#else" implementation anyway and all support the "#if", I'd rather remove the "#else" altogether and make the "#if" unconditional.
Version 0, edited 11 years ago by bonefish (next)

comment:3 by nielx, 11 years ago

Thanks for the review. I will work on 0002 and 0004 a bit more. In the mean time I get another build error. Do you have any pointers for me?

The error is:

BuildHaikuPackage1 /Volumes/Haiku_Build/build-gcc2/objects/haiku/x86_gcc2/packaging/packages/haiku.hpkg 
haiku.hpkg: Removing and re-creating package contents dir ...
haiku.hpkg: Collecting package contents ...
haiku.hpkg: mimeset'ing package contents ...
haiku.hpkg: Creating the package ...
Failed to stat attribute "BEOS:TYPE" of file "data/mime_db/audio/ac3": Unknown error: -2147459062

/Volumes/Haiku_Build/haiku-trunk/build/scripts/build_haiku_package "/Volumes/Haiku_Build/build-gcc2/objects/haiku/x86_gcc2/packaging/packages/haiku.hpkg" "/Volumes/Haiku_Build/build-gcc2/objects/haiku/x86_gcc2/packaging/packages_build/hpkg_-haiku.hpkg/haiku-package-info" /Volumes/Haiku_Build/build-gcc2/objects/haiku/x86_gcc2/packaging/packages_build/hpkg_-haiku.hpkg/scripts/haiku.package-init-vars /Volumes/Haiku_Build/build-gcc2/objects/haiku/x86_gcc2/packaging/packages_build/hpkg_-haiku.hpkg/scripts/haiku.package-make-dirs /Volumes/Haiku_Build/build-gcc2/objects/haiku/x86_gcc2/packaging/packages_build/hpkg_-haiku.hpkg/scripts/haiku.package-copy-files /Volumes/Haiku_Build/build-gcc2/objects/haiku/x86_gcc2/packaging/packages_build/hpkg_-haiku.hpkg/scripts/haiku.package-extract-files

comment:4 by nielx, 11 years ago

Regarding 0004

Interestingly though that one does not produce any errors during build. Any guess on why that may be?

in reply to:  3 ; comment:5 by bonefish, 11 years ago

Replying to nielx:

Failed to stat attribute "BEOS:TYPE" of file "data/mime_db/audio/ac3": Unknown error: -2147459062

The error code translates to B_NO_MORE_FDS. Maybe we're leaking FDs somewhere. Which attribute emulation do you use?

Replying to nielx:

Regarding 0004

Interestingly though that one does not produce any errors during build. Any guess on why that may be?

It would fail later in the build_haiku_image script when the package dependencies are resolved. That's the first time the code is executed.

in reply to:  5 comment:6 by nielx, 11 years ago

Replying to bonefish:

Replying to nielx:

Failed to stat attribute "BEOS:TYPE" of file "data/mime_db/audio/ac3": Unknown error: -2147459062

The error code translates to B_NO_MORE_FDS. Maybe we're leaking FDs somewhere. Which attribute emulation do you use?

The default (not xattr). I will try a build with xattr now.

comment:7 by nielx, 11 years ago

Definitively leaking. The output with xattr is:

Failed to open entry "data/mime_db/message/rfc822": Unknown error: -1

I will dive into dtrace and the source to see what happens.

Last edited 11 years ago by nielx (previous) (diff)

comment:8 by bonefish, 11 years ago

I had a quick look with strace on Linux and could see anything suspicious in this respect.

Assuming the issue still occurs when building "haiku.hpkg", you can just do a jam -q haiku.hpkg. The actual invocation of the package command happens at the end of "build/scripts/build_haiku_package".

comment:9 by nielx, 11 years ago

I did a check and it seems like there are a large number of DIR fds open. See the log.

I also checked the ulimit -Sn, which is set to 256. Increasing the limit to 1024 has worked and Haiku is building.

So the question is:

  1. Is the limit on OS X too small and should the user change this?
  2. Should package anticipate this and under certain conditions raise the soft limit?
  3. Or is package too careless about the resources?

by nielx, 11 years ago

Attachment: lsof.txt added

The lsof output during the package command

comment:10 by nielx, 11 years ago

patch: 10

comment:11 by nielx, 11 years ago

patch: 01

comment:12 by nielx, 11 years ago

I added three patches; two are improvements over the previous added patches, one is another fix later on in the build process.

About 0003: The line in FileRules exceeds the maximum amount of characters. I am unsure how to properly break that line, I could not find any examples in the rest of the file. Any suggestions? Also, could you please look closely at the configure changes? I am not experienced in shell scripting.

comment:13 by bonefish, 11 years ago

Regarding the many open directory file descriptors, I think I found the leak in our libroot_build fdopendir() emulation. I've attached a patch. Please give it a try.

The patches look good. In 0003 I would break the line before the "|" (and escape the line break with "\").

comment:14 by nielx, 11 years ago

I tested it and it works indeed. Mind if I push all four patches (including the cleaned up 0003)?

comment:15 by bonefish, 11 years ago

Sure, please go ahead.

comment:16 by nielx, 11 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev46150

Note: See TracTickets for help on using tickets.