unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 07/14] xap_helper_cxx: decouple from Inline::C
Date: Wed, 13 Dec 2023 00:50:12 +0000	[thread overview]
Message-ID: <20231213005019.26912-8-e@80x24.org> (raw)
In-Reply-To: <20231213005019.26912-1-e@80x24.org>

We don't actually need Inline::C support to build a standalone
executable implemented in C++.
---
 lib/PublicInbox/XapHelperCxx.pm | 11 ++++++-----
 t/xap_helper.t                  |  6 ++++--
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/lib/PublicInbox/XapHelperCxx.pm b/lib/PublicInbox/XapHelperCxx.pm
index 17f988ee..8e95ff42 100644
--- a/lib/PublicInbox/XapHelperCxx.pm
+++ b/lib/PublicInbox/XapHelperCxx.pm
@@ -16,8 +16,9 @@ use autodie;
 my $cxx = which($ENV{CXX} // 'c++');
 my $dir = substr("$cxx-$Config{archname}", 1); # drop leading '/'
 $dir =~ tr!/!-!;
-$ENV{PERL_INLINE_DIRECTORY} // die('BUG: PERL_INLINE_DIRECTORY unset');
-substr($dir, 0, 0) = "$ENV{PERL_INLINE_DIRECTORY}/";
+my $idir = ($ENV{XDG_CACHE_HOME} //
+	(($ENV{HOME} // die('HOME unset')).'/.cache')).'/public-inbox/jaot';
+substr($dir, 0, 0) = "$idir/";
 my $bin = "$dir/xap_helper";
 my ($srcpfx) = (__FILE__ =~ m!\A(.+/)[^/]+\z!);
 my @srcs = map { $srcpfx.$_ } qw(xh_mset.h xh_cidx.h xap_helper.h);
@@ -54,9 +55,9 @@ sub needs_rebuild () {
 }
 
 sub build () {
-	if (!-d $dir && !CORE::mkdir($dir)) {
-		my $err = $!;
-		die "mkdir($dir): $err" if !-d $dir;
+	if (!-d $dir) {
+		require File::Path;
+		File::Path::make_path($dir);
 	}
 	require PublicInbox::CodeSearch;
 	require PublicInbox::Lock;
diff --git a/t/xap_helper.t b/t/xap_helper.t
index be010c75..0f474608 100644
--- a/t/xap_helper.t
+++ b/t/xap_helper.t
@@ -149,8 +149,10 @@ unless ($ENV{TEST_XH_CXX_ONLY}) {
 	no_pollerfd($ar->{pid});
 }
 SKIP: {
-	require PublicInbox::XapHelperCxx;
-	my $cmd = eval { PublicInbox::XapHelperCxx::cmd() };
+	my $cmd = eval {
+		require PublicInbox::XapHelperCxx;
+		PublicInbox::XapHelperCxx::cmd();
+	};
 	skip "XapHelperCxx build: $@", 1 if $@;
 
 	@NO_CXX = $ENV{TEST_XH_CXX_ONLY} ? (0) : (0, 1);

  parent reply	other threads:[~2023-12-13  0:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  0:50 [PATCH 00/14] Alpine Linux support Eric Wong
2023-12-13  0:50 ` [PATCH 01/14] t/io: strace is optional on Linux Eric Wong
2023-12-13  0:50 ` [PATCH 02/14] tests: account for missing git-http-backend Eric Wong
2023-12-13  0:50 ` [PATCH 03/14] t/cindex*: skip --join when join(1) is missing Eric Wong
2023-12-13  0:50 ` [PATCH 04/14] tests: attempt compatibility w/ busybox lsof Eric Wong
2023-12-13  0:50 ` [PATCH 05/14] lei inspect: drop unneeded strftime import Eric Wong
2023-12-13  0:50 ` [PATCH 06/14] treewide: avoid strftime %k for portability Eric Wong
2023-12-13  0:50 ` Eric Wong [this message]
2023-12-13  0:50 ` [PATCH 08/14] xap_helper_cxx: support clang w/o `c++' executable Eric Wong
2023-12-13  0:50 ` [PATCH 09/14] install: updates for Alpine Linux and apk Eric Wong
2023-12-13  0:50 ` [PATCH 10/14] test_common: extract oct_is from search.t Eric Wong
2023-12-13  0:50 ` [PATCH 11/14] t/convert-compact: allow S_ISGID bit Eric Wong
2023-12-13  0:50 ` [PATCH 12/14] www_coderepo: fix read buffering Eric Wong
2023-12-13  0:50 ` [PATCH 13/14] gzip_filter: use OO ->zflush dispatch Eric Wong
2023-12-13  0:50 ` [PATCH 14/14] t/lei-import: relax EIO regexp Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231213005019.26912-8-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).