Commit Graph

261 Commits

Author SHA1 Message Date
Niels Sascha Reedijk 2284eb4875 Add ALLPERMS and DEFFILEMODE to enable building on hosts with the musl c library 2018-04-30 11:11:11 +00:00
Augustin Cavalier 648f0d5f08 libroot_build: Properly remap fs_attr_* functions.
This was done using macros before, which isn't the way we have things set up.
In theory that method should work, however if not all consumers include the
libroot_build headers properly, then it breaks in subtle but confusing ways,
which is not what we want at all.

Thanks to Jessica for advice.

Change-Id: Idd45df5547daecf8239932957088da03ddfccf87
2018-04-29 17:25:18 +00:00
Augustin Cavalier 61206a24c9 build: Cleanup of libgnuregex usage.
John's revert of my removal commit dragged back a bunch of cygwin/sunos
cruft, as well as re-adding RegExp.cpp to the host libshared, that we don't
need.

Instead, remove this and add libgnuregex_build to just the tools/keymap
link alongside the FreeBSD gnuregex case.
2018-03-07 18:04:31 -05:00
John Scipione 940a3a2322 Revert "build/libgnuregex: Remove."
This reverts commit ca087b0532.

Mac OS X requires libgnuregex for Keymap
2018-02-16 16:45:11 -08:00
Augustin Cavalier 03544bf000 libroot_build: Full passthrough to system attributes.
As it turns out, using the xattr emulation layer plus "libgnu"
causes some strange mixups at package build time, and so packages
built with it were winding up with no attributes at all.

So I've just bitten the bullet and written a full passthrough layer
to the system attributes. Verified using a full build of haiku.hpkg
this time ... after a lot of painful debugging of symlink mixups.

Hopefully I am finally rid of this plague...
2017-12-30 16:35:51 -05:00
Augustin Cavalier 699b4bbab9 libroot_build: *Actually* fix attribute usage on Haiku.
To quote jscipione (from 95e8362c52),
"Let me tell you a story about a bug" -- though this tale spans a much
lesser time than that one did.

In 5e19679ea3, I enabled libroot_build for
Haiku, instead of using the system libroot as we had before. There were
a number of bugs introduced along with this that I hadn't fixed (and there
may be more after this), but most of the obvious ones (crashes on x86_64...)
were fixed shortly enough.

Attribute usage, though, was a different story. Unlike most of the POSIX
calls in libroot, which were aliasing system functions no matter what the
platform, the attribute calls were not, as they are specific to Haiku.

Initially I had completely forgot about them, and it wasn't until a few days
later when I noticed that I had an "attributes" directory in my generated
that I realized that the "generic" attribute layer was being used on Haiku.
I attempted a fix for this in 5e19679ea3,
thinking that would clear the problem up, but I didn't actually run a test
beyond seeing that my BuildConfig had been updated properly. In fact,
BuildSetup was hard-wired to not even pass that definition through on
Haiku, and so that commit had in effect caused nothing.

My initial "fix" of just changing BuildSetup then caused a build failure,
as while libroot_build itself compiled, it ran into errors whenever attributes
were used, because in letting the real libroot's attribute calls shine
through, I had bypassed libroot_build's FD emulation/shim layer.

Then I tried and failed at three separate attempts to solve this with code:
 - a version of the "fs_attr_...h" interface for Haiku. This proved possible
   in theory, but in practice I would need to reimplement a lot of attribute
   handling code in it, because all I had access to from there was syscalls.

 - a version of "fs_attr_untyped" that bypassed its reimplementations of
   the "fs*attr" functions for the libroot ones, only using the FD shim layer.
   This proved possibly not even theoretically possible because it would have
   caused preprocessor hell in some of the build headers, and also assumptions
   about how attributes are read were totally different.

 - a completely new "fs_attr_haiku" that was a completely new interface to
   the fs*attr functions. This proved practically impossible because of the
   need to include structures from the system libroot to call out to readdir,
   etc. that attempts to solve would also have caused preprocessor hell.

Then I realized that the Linux xattr emulation library, which I'd used
as a reference when attempting the first solution, was shipped by default
as a system library in all builds of Haiku ... and so I could just tell
fs_attr_untyped to use the Linux xattr handler, and then link against libgnu.

So that is how I arrived at this strange and decidedly unorthodox solution
to a problem of my own creation.
2017-12-29 21:26:00 -05:00
Augustin Cavalier ca087b0532 build/libgnuregex: Remove.
It was needed on macOS for a time when BUrl used regexes for parsing.
Now it does not, and so we can remove libshared's RegExp from build
libshared, and thus also libgnuregex.
2017-12-24 12:27:47 -05:00
Augustin Cavalier 1465ec71a0 build/kernel: Properly shadow syscall functions.
I didn't notice this in the previous commit because apparently GCC2
just links against libroot's versions of them. On GCC5, however,
the version from libroot_build was used even for calls from libroot itself,
which led to infinite loops and then stack overflows.

So instead we must have the "syscall" functions in libroot_build shadow
the real ones by being named differently, which I did by changing their
prefix from "_kern" to "_kernbuild" via preprocessor macros.

Since the build syscalls.h is now substantially different than the non-
build one (and has not been synchronized in nearly a decade anyway),
I've just stripped out all the syscall defns except for the ones actually used
in the build.

Thanks to kallisti5 for helping me debug and test.
2017-12-13 23:40:05 -05:00
Augustin Cavalier 5e19679ea3 build: Use libroot_build on Haiku.
Previously we just used the system libroot, which of course meant
that when libroot's ABI changed, the build broke. Now we use the full
libroot_build that we do on non-Haiku platforms. The logic for "BeOS-compatible
but not Haiku" does not really apply anymore, so it has been gutted where
appropriate (and libhaikucompat has been decoupled from the build.)

The only caveat here is the change to Errors.h -- we really should be using
the system's one where I included the one from the tree, but for whatever
reason, GCC2 refused to handle the #include_next properly.

Fixes the build breakage of Haiku-on-Haiku by my prior commits (sorry).
2017-12-13 19:47:39 -05:00
Augustin Cavalier 0d020b8298 headers/build: Use the system's types.h on Haiku.
Technically a "hack" (but then again most of the config/build stuff is);
as we need to use the system's config/types.h in order to get stdint
definitions and the like.

Previously there was a config_build directory which allowed the existence
of two types.h -- the system one, and the headers/build one, but seeing
as we only need this to provide Haiku-specific core types on other platforms,
using the system's one should be fine.

Our core type definitions have not changed in some time (and it's unclear
when they would change aside from potential new platforms), breakage of the
Haiku-on-Haiku build due to this should not happen often (if ever.)
2017-12-12 18:51:13 -05:00
Augustin Cavalier 82bffcc3a7 headers/build: Reunify BeBuild.h and related cleanup.
Now that we do not target BeOS and also do not include the main headers
directory when building "build" binaries, we can drop the separate
config_build directory and thus also the separate BeBuild.h, and just
..-include the regular one.

The build BeBuild.h defined empty _IMPEXP_ROOT and _IMPEXP_BE preprocessor
macros that the regular one does not; so I also re-synchronized
headers which used these as needed.
2017-12-11 19:15:47 -05:00
Augustin Cavalier 06b79f5509 build/Errors.h: Synchronize with the non-build one.
This file was apparenly based off the BeOS one (as is evidenced
by the "Be Incorporated" copyright ... which is problematic.)
Now it's directly based off of the non-build one.
2017-12-05 18:36:11 -05:00
Jérôme Duval 6ac3a280f4 Add ZstdCompressionAlgorithm.
* kernel lib is decompress only (like zlib).
* expand compression_test for zstd.
2017-11-24 21:35:49 +01:00
Augustin Cavalier 581cd2a22d Nuke COMPILE_FOR_R5.
Not used in $long_time, almost certainly broken, so it's just cruft.
2017-11-15 17:52:27 +01:00
Augustin Cavalier 6aff37d1c7 Move SHA256 class to libroot instead of linking libshared into libroot.
Discussed with PulkoMandy and on the haiku-commits mailing list.

Thanks to @jessicah for compile-testing and fixing 2 small issues I missed.
2017-10-03 20:18:26 -04:00
Alexander von Gluck IV f806447f52 aarch64: Add aarch64 build host support
* Maybe it will be a target someday.
* 64-bit ARMv8 for those not in the know.
2017-07-27 18:45:54 -05:00
Augustin Cavalier 39efd913c1 Switch to a 64-bit time_t everywhere except 32-bit x86.
Thus, BeOS compatibility is preserved (and there is no risk of
breaking GCC5<->GCC2 interoperation on hybrid builds.)

This commit only makes the actual change, the build fixes are
in the next commit.
2017-06-06 17:38:17 -04:00
Jérôme Duval 133e4131fe Added some support for GCC 8. 2017-05-13 11:37:22 +02:00
PulkoMandy 100775b790 Fix build on Linux
Stub out some translation macros for host build, so the now localized
package solver can be built there.
2017-02-11 14:15:38 +01:00
Augustin Cavalier b6f76ebe71 s/OpenBeOS License/MIT License/ universally, as they're the same thing.
Fixes #8681.
2017-02-09 22:09:56 -05:00
PulkoMandy 7056e542b7 Add forwarding header for BUrl. 2016-12-29 18:18:21 +01:00
Jessica Hamilton 4419d699ec partitioning: pass along reference to parent when uninitializing.
* Fixes problems with setting the partition name after uninitializing
  a partition in DriveSetup. Previously, UninitializeJob() was
  followed by SetStringJob(), but the kernel was updating the
  change counter for the parent partition when uninitializing a
  partition, leading to SetStringJob() having an incorrect change
  counter for the parent partition. Now the parent change counter
  will be correct when SetStringJob() runs.
2016-12-23 18:53:15 +13:00
John Scipione 129626b593 Fix warnings building on newer OS X
Apple has gotten around to updating their POSIX support so these
constants are now defined. Add some #ifndef guards to prevent warnings
during compile.
2016-12-03 00:01:51 -08:00
Jérôme Duval c9dba74273 Added some support for GCC 7. 2016-05-05 18:20:26 +02:00
Alexander von Gluck IV cc8f1d2ffd headers/os: Add gcc 5 to BeBuild.h
* While we still use gcc 4, the host tools won't
  build on gcc 5 systems without this.
* x86_64 compiles under gcc 5.10 successfully
2015-06-24 23:06:23 -05:00
Axel Dörfler e711e6e42f Moved BJob, and JobQueue into the support kit.
* Put it in the BSupportKit namespace, following the style introduced
  with the package kit for now.
* The BSupportKit::BJob class no longer knows about the package kit's
  Context class. However, the BPackageKit::BJob class does.
* Due to the namespace juggling, a lot of files had to be touched.
* The JobQueue class remains private.
* Due to the way Haiku is built on itself, you cannot build this change
  under Haiku with an older release.
2015-05-21 21:37:01 +02:00
Axel Dörfler 5ce80a78c9 BMessage: implemented KMessage reply.
* When you receive a message from a KMessage, and reply to it,
  it will automatically reply as KMessage, too.
* This allows to communicate with BLoopers from within the kernel
  or libroot.so.
2015-05-13 23:06:51 +02:00
Axel Dörfler 1aaa0c2142 Package Kit: FetchFileJob now contains package size.
* So that you know how much already was, and still has to be downloaded.
* Automatic whitespace cleanup.
* The link in FetchFileJob.h did not fetch the correct header under
  Haiku anymore (since the addition of the private headers to the
  image).
2015-03-31 13:40:42 +02:00
Adrien Destugues 00640ac82e Forgot to fix LDBL_MIN... 2014-10-15 13:08:10 +02:00
Adrien Destugues 1f792e1852 gcc2 float.h: use decimal floats. 2014-10-15 11:29:54 +02:00
Adrien Destugues 7f6fdce3c1 Update haiku copy of gcc2 float.h
Shouldn't be needed, but we may as well use the correct version here
too.
2014-10-14 22:11:27 +02:00
Adrien Destugues 9e616c6b9e Fix HaikuBuildCompatibility to not define atmics anymore.
This reverts commit 34dbbb65fd.
Instead, we can remove thos from HaikuBuildCompatibility and things will work fine, unless one try t build Haiku on BeOS (this isn't
supported anymore) or a very old Haiku which esdon't have those.
2014-08-29 09:37:44 +02:00
Ingo Weinhold 05b565f4f2 Add private BDataPositionIOWrapper
Implements the BPositionIO interface on top of a BDataIO, requiring the
{Read,Write}At() accesses to be sequential.
2014-07-13 17:57:56 +02:00
Ingo Weinhold c55a06055f Add private class BFdIO
Simple BPositionIO implementation using the POSIX API on a FD. In effect
similar to BFile, but more easily ported to kernel and boot loader (and
the FD is reusable).
2014-07-12 15:40:21 +02:00
Ingo Weinhold b3263ad3e1 Switch package kit to BZlibCompressionAlgorithm
... and remove the Zlib{Compressor,Decompressor} API.
2014-06-30 21:55:41 +02:00
Ingo Weinhold dcdc33b0af Add B[Zlib]CompressionAlgorithm
* BCompressionAlgorithm is a base class for classes that provide
  compression/decompression functionality. There are methods for
  compressing/decompressing a single buffer and factory methods for
  a compressing/decompressing input/output BDataIO.
* BZlibCompressionAlgorithm is a BCompressionAlgorithm implementation
  using zlib.
2014-06-30 21:55:41 +02:00
Ingo Weinhold 6a89a36aa0 Move package kit Zlib* classes to support kit
Also move to B* namespace and no longer expose the zlib dependency in
the headers.
2014-06-30 21:55:41 +02:00
Adrien Destugues eef22dfb75 Revert "Remove haiku_host/Errors.h"
This reverts commit f105756e27.

The host header gets included if this file is missing , rather than the
one in the build tree. Fix the build again.
2014-06-26 08:01:00 +02:00
Adrien Destugues f105756e27 Remove haiku_host/Errors.h
The only purpose of this was to use the installed version of Errors.h,
which isn't strictly needed and create some annoyance when new error
codes are added.
2014-06-25 23:01:13 +02:00
Adrien Destugues 6bcbdcc3c0 Use current Errors.h when building libbe_build
This allows adding new error codes to the libbe_build without breaking
the build on older Haiku versions.

Fixes the build for the newly introduced B_PARTIAL_READ and
B_PARTIAL_WRITE.
2014-06-25 08:59:14 +02:00
Ingo Weinhold 84297881bb Remove BPackageKit::[...]::AbstractDataWriter and friends
* FDDataWriter and ZlibDataWriter weren't used anymore.
* AbstractDataWriter was implemented only by PackageFileHeapWriter,
  which was only used by WriterImplBase.
* Add a PackageFileHeapWriter::AddDataThrows() which has semantics
  equivalent to the previously inherited WriteDataThrows().
2014-06-23 22:58:15 +02:00
Ingo Weinhold 32832cbe47 Remove BPackageKit::BDataOutput
Use BDataIO instead.
2014-06-23 22:58:15 +02:00
Ingo Weinhold dec78bb27c Add new error codes B_PARTIAL_{READ,WRITE} 2014-06-23 22:58:15 +02:00
Ingo Weinhold d2d1af830b Revert "Move ZlibDecompressor to libshared"
This reverts commit 9af2105d36.

Conflicts:
	src/kits/package/Jamfile
2014-06-18 22:13:39 +02:00
Ingo Weinhold 707f60f4e9 Revert "Fix build."
This reverts commit 00dfae0bce.
2014-06-18 22:13:39 +02:00
Ingo Weinhold 0de3219e33 package daemon: Rework error and issue propagation to client
* BDaemonClient: Move inner class BCommitTransactionResult to top level
  and make it public.
* BCommitTransactionResult:
  - Add a whole bunch of specific error code enum values. Such an error
    code is now the primary error, as opposed to before where we would
    mix status_t and enum value errors. There's a systemError property
    of type status_t which may provide additional information, though
    (depending on the primary error type).
  - Remove the errorMessage property. Due to mapping all errors to the
    specific error codes this is no longer necessary. Mixing such a
    message with another error description is also not very helpful when
    it comes to localization (still not supported, though).
  - Add several properties (paths, strings, error codes) that serve as
    arguments to the primary error and are used by FullErrorMessage().
  - Add issues property, a list of instances of new class
    BTransactionIssue. Those describe non-critical issues (e.g. failed
    update of a settings file) that occurred in the process of
    committing the transaction. Those issues should be presented to the
    user by the package management program.
* Exception: Adjust to transport the BCommitTransactionResult
  properties.
* CommitTransactionHandler, FsTransactions, Root, Volume: Adjust to
  BCommitTransactionResult/Exception changes.
* CommitTransactionHandler: Now requires a BCommitTransactionResult to
  which it adds the issues it encounters. The reply BMessage is no
  longer needed, though.
* Volume: Refactor common code from the three methods that use
  CommitTransactionHandler into new method _CommitTransaction.
2014-06-15 17:21:01 +02:00
Adrien Destugues bec7cb1006 Also move the build version of BReferenceable.
* Should fix the build, but results in an internal compiler error here
(with a gcc2 haiku host). Let's see what the buildbots think...
2014-06-11 17:53:41 +02:00
Jessica Hamilton 1e31468302 ByteOrder.h: separate host & Haiku versions.
* This avoids polluting the Haiku headers with host issues,
  as pointed out by Axel.
* Should also resolve build issues for various versions of
  host compilers that were introduced in previous commits.
2014-05-30 20:39:43 +12:00
Oliver Tappe 94089b909d Revert 6f68e52 and fix the gcc2 build via template.
* Instead of forcing the hash-table to use a copy of the key,
  introduce and use TypeOperation template to avoid taking a
  reference of a reference type (which gcc2 doesn't allow).
2014-04-20 00:26:29 +02:00
Stephan Aßmus e883b3c9ff Fixed multi-line #ifdef
I definitely compiled last night, but how in the world
was that possible?
2014-03-18 20:40:02 +01:00