[Midnightbsd-cvs] [MidnightBSD/mports] 06f09c: devel/electron40: make the port buildable on Midni...

Lucas Holt noreply at github.com
Tue Aug 4 23:05:47 EDT 2026


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

  Changed paths:
    M devel/electron40/Makefile
    M devel/electron40/files/patch-build_config_linux_pkg-config.py
    A devel/electron40/files/patch-build_landmine__utils.py
    M devel/electron40/files/patch-media_ffmpeg_scripts_robo__lib_config.py
    M devel/electron40/files/patch-third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py
    M devel/electron40/files/patch-third__party_node_node.py
    M devel/electron40/files/patch-tools_gn_build_gen.py

  Log Message:
  -----------
  devel/electron40: make the port buildable on MidnightBSD

The port has never been build-ported: it carried no midnightbsd patches at
all, and the fetch fix in the previous commit only got it as far as starting a
build. Configure failed immediately on the first Python platform check.

Six MidnightBSD portability patches, the same set devel/electron41 needs. Only
Python is affected; C and C++ are carried by the base compiler defining
__FreeBSD__ alongside __MidnightBSD__, and GN reports host_os=freebsd via
OS_FREEBSD:

- build/config/linux/pkg-config.py returned early on any platform not matching
  linux/openbsd/freebsd, so every pkg_config lookup in the build silently
  produced empty results
- tools/gn/build/gen.py raised KeyError: 'midnightbsd4' during GN bootstrap
- media/ffmpeg/scripts/robo_lib/config.py raised ValueError: Unsupported
  platform: MidnightBSD
- third_party/node/node.py raised KeyError looking up the node binary path
- third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py raised
  AssertionError: Unknown platform: midnightbsd4
- build/landmine_utils.py IsLinux() returned False (new patch)

Three port defects, all shared with the initial devel/electron41 import and
fixed there too:

- 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. The cc/c++ aliases were
  presumably dropped because Chromium builds with -no-canonical-prefixes,
  which makes clang derive its resource directory from argv[0] and resolve it
  through the alias symlink to a path that does not exist. 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.

Verified: configures from a clean tree, 28489 targets from 4367 files, using
clang 21.1.8 with the allocator arguments and -resource-dir confirmed present
in args.gn. All six patches were dry-run against the Chromium 144 sources
before use.

Not verified: the full build. devel/electron41 builds and packages with the
identical set of changes, but electron40 was not compiled end to end.

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