user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 07/14] xap_helper_cxx: decouple from Inline::C
  2023-12-13  0:50  6% [PATCH 00/14] Alpine Linux support Eric Wong
@ 2023-12-13  0:50  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2023-12-13  0:50 UTC (permalink / raw)
  To: meta

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);

^ permalink raw reply related	[relevance 7%]

* [PATCH 00/14] Alpine Linux support
@ 2023-12-13  0:50  6% Eric Wong
  2023-12-13  0:50  7% ` [PATCH 07/14] xap_helper_cxx: decouple from Inline::C Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2023-12-13  0:50 UTC (permalink / raw)
  To: meta

I haven't tested every single possible package combination, but
I think this is enough to get started.

Patch 3 was a WTF moment for me.

Some of these are relevant for other platforms, as well, and
patch 7 decoupling from Inline::C is a good step towards making
our codebase more modular.

Patch 12 is a good fix regardless.

Eric Wong (14):
  t/io: strace is optional on Linux
  tests: account for missing git-http-backend
  t/cindex*: skip --join when join(1) is missing
  tests: attempt compatibility w/ busybox lsof
  lei inspect: drop unneeded strftime import
  treewide: avoid strftime %k for portability
  xap_helper_cxx: decouple from Inline::C
  xap_helper_cxx: support clang w/o `c++' executable
  install: updates for Alpine Linux and apk
  test_common: extract oct_is from search.t
  t/convert-compact: allow S_ISGID bit
  www_coderepo: fix read buffering
  gzip_filter: use OO ->zflush dispatch
  t/lei-import: relax EIO regexp

 install/deps.perl               | 38 +++++++++++++++++++++----
 install/os.perl                 | 12 ++++++--
 lib/PublicInbox/Admin.pm        | 10 ++++++-
 lib/PublicInbox/ExtSearchIdx.pm |  4 +--
 lib/PublicInbox/GzipFilter.pm   |  2 +-
 lib/PublicInbox/Hval.pm         |  6 +++-
 lib/PublicInbox/LeiInspect.pm   |  1 -
 lib/PublicInbox/LeiMirror.pm    |  4 +--
 lib/PublicInbox/LeiXSearch.pm   |  3 +-
 lib/PublicInbox/RepoAtom.pm     |  4 +--
 lib/PublicInbox/TestCommon.pm   | 50 +++++++++++++++++++++++++++++++--
 lib/PublicInbox/WwwCoderepo.pm  |  6 ++--
 lib/PublicInbox/WwwStatic.pm    |  5 ++--
 lib/PublicInbox/XapHelperCxx.pm | 26 +++++++++++------
 t/cindex-join.t                 |  1 +
 t/cindex.t                      | 11 ++++----
 t/clone-coderepo.t              |  1 +
 t/convert-compact.t             | 20 ++++++-------
 t/ds-leak.t                     |  5 +---
 t/httpd-corner.t                | 31 ++++++++------------
 t/httpd.t                       |  1 +
 t/lei-import.t                  |  5 ++--
 t/lei-mirror.t                  |  1 +
 t/nntpd.t                       | 16 +++++------
 t/search.t                      |  5 ----
 t/solver_git.t                  |  8 ++++--
 t/v2reindex.t                   |  5 ++--
 t/www_listing.t                 |  1 +
 t/xap_helper.t                  |  6 ++--
 xt/msgtime_cmp.t                |  2 +-
 30 files changed, 190 insertions(+), 100 deletions(-)

^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2023-12-13  0:50  6% [PATCH 00/14] Alpine Linux support Eric Wong
2023-12-13  0:50  7% ` [PATCH 07/14] xap_helper_cxx: decouple from Inline::C Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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).