test-macos-app-sandbox uses the system-provided codesign binary
(/usr/bin/codesign) to apply entitlements to an app bundle. This fails
in the sandbox as /usr/bin/codesign is not accessible. Patch the test to
instead use the codesign binary from sigtool. The test was updated to
pass the executable path to codesign as sigtool can't handle the bundle
path.
this architecture mapping is used broadly in the node ecosystem.
an assortment of tools and hooks, like buildNpmPackage or
pnpm.configHook, will benefit from reusing these values. placing them in
stdenv makes sense because (1) several of these tools don't currently
depend on nodejs, and may even be available where nodejs is not and (2)
`stdenv.{build,host,target}Platform` seems to be less error-prone than
`pkgs*.nodejs.{os,arch}` -- especially for setup hooks where the offsets
are shifted.
They are not doing anything right now. This is in preparation for their
complete removal from the tree.
Note: several changes that affect the derivation inputs (e.g. removal of
references to stub paths in build instructions) were left out. They will
be cleaned up the next iteration and will require special care.
Note: this PR is a result of a mix of ugly regex (not AST) based
automation and some manual labor. For reference, the regex automation
part was hacked in: https://github.com/booxter/nix-clean-apple_sdk
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This was tested x86_64-linux -> x86_64-freebsd. It works by injecting
the tools that would otherwise be run at build time for the same
executables extracted from a native build.
Without this, there are multiple issues:
a) It will fail to start building since there are naming conflicts
between the "host" (build system) and "normal" (host system) object
files. This is resolved with a patch from buildroot.
b) It will then still fail to build since it will still try to build the
"host" objects, with a host compiler, but it will use the
configuration flags for the "target" OS. This is resolved by
importing the executables that would otherwise be run on the build
system from the intermediate stage of a native build, saved in a new
"dev" output. We also fake the "host" compiler as a tool which simply
touches its outputs.
c) Finally, there is a clang bug which causes a static assert that
something is trivially copyable to fire as a false positive. We
remove this check with a patch from rubyjs.
ce685a8422 added list of tests failing on sandbox, but for some reason
only for Darwin. We should skip those tests on all platforms otherwise
OfBorg builds are failing.
The v8 library supports only limited number of build platforms based on
the host architecture. The rule there is the bitness (the mixing of
32bit and 64bit architectures seems to be in most cases disallowed).
Thus this adds usage of the emulator of the host platform and builds
tools for that.
Co-authored-by: Ivan Trubach <mr.trubach@icloud.com>
Previously, the nodejs `passthru.pkgs` attribute refers to the package
fixed point derived in the current context, without considering
potential overrides to the main nodejs package.
This is fixed here with the `.finalPackage` attribute, which refers to
the final package fixed point, after potential overrides.
For example, previously, after overriding nodejs with `nodejs.override`,
`nodejs.pkgs` would still refer to the original package, instead of the
overridden one. After this fix, `nodejs.pkgs` would be correctly based
on the overridden `nodejs` package.