[Midnightbsd-cvs] [MidnightBSD/mports] 008f43: devel/electron41: fix the build, Electron now comp...

Lucas Holt noreply at github.com
Tue Aug 4 09:22:54 EDT 2026


  Branch: refs/heads/devel/electron41-buildfix
  Home:   https://github.com/MidnightBSD/mports
  Commit: 008f43050817affca5a87d2f0874b1bea9054163
      https://github.com/MidnightBSD/mports/commit/008f43050817affca5a87d2f0874b1bea9054163
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M devel/electron41/Makefile
    A devel/electron41/files/patch-build_landmine__utils.py
    M devel/electron41/files/patch-third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py

  Log Message:
  -----------
  devel/electron41: fix the build, Electron now compiles and packages

Follow-up to the initial import, which was validated only through configure.
Building it end to end turned up six further problems.

Port infrastructure:

- pre-build copied the rollup native binding from ${CARGO_TARGET_DIR}/*/, but
  mports' cargo.mk always sets CARGO_BUILD_TARGET, so cargo writes to
  ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/<profile>/ instead. FreeBSD's glob
  only works when no target triple is passed.

- The build silently used base clang rather than devel/llvm21. GN's
  clang_toolchain template hardcodes cc/c++ from PATH and ignores
  clang_base_path, so BINARY_ALIAS is the only way to select a compiler;
  setting CC/CXX alone only affects the GN bootstrap. Base clang 19 is too old
  for Chromium 146 -- its bundled libc++ requires clang 20+, and clang 19
  crashes in Sema on the C++20 defaulted comparison operators.

  The cc/c++ aliases were presumably dropped because Chromium builds with
  -no-canonical-prefixes, which makes clang derive its resource directory from
  argv[0]; through the alias symlink that resolves to a path which does not
  exist, so intrinsics headers go missing. Restore the aliases and pass
  -resource-dir explicitly instead.

- GN_ARGS had lost use_allocator_shim=false, use_partition_alloc=true,
  use_partition_alloc_as_malloc=false and enable_backup_ref_ptr_support=false.
  Without them the allocator shim is compiled, and it does not build on
  MidnightBSD: /usr/include/stdlib.h declares malloc/free/realloc without
  __THROW, so the shim's redeclarations conflict.

- do-install used FreeBSD's ${STAGEDIR}${PREFIX}. In mports ${PREFIX} already
  has FAKE_DESTDIR prepended during do-install, so every path was staged twice
  over. Drop ${STAGEDIR} throughout.

Two more MidnightBSD portability fixes, both in Python, both the same shape as
the ones in the import:

- third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py raised
  "AssertionError: Unknown platform: midnightbsd4" when generating the V8
  bindings
- build/landmine_utils.py IsLinux() returned False (found by sweeping the tree
  for scripts accepting freebsd but not midnightbsd, rather than waiting for it
  to fail)

The C and C++ sources needed no changes at all across roughly 30000 objects,
which confirms that defining __FreeBSD__ alongside __MidnightBSD__ carries that
layer on its own.

Verified: builds from a clean tree, stages, and packages
(electron41-41.10.2_1.mport). The installed binary reports v41.10.2. The
FreeBSD pkg-plist matched the staged tree with no changes. bmake test was not
run, and the DIST and DRIVER options are off by default and untested.

AI-Assisted-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
Signed-off-by: Lucas Holt <luke at foolishgames.com>



To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/mports/settings/notifications


More information about the Midnightbsd-cvs mailing list