Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit 1/5] build: preserve the original build system
Date: Wed, 10 Feb 2021 12:35:09 +0300	[thread overview]
Message-ID: <20210210093509.GB9361@root> (raw)
In-Reply-To: <20210209152845.GK5448@tarantool.org>

Igor,

LGTM. Just some side notes below.

On 09.02.21, Igor Munkin wrote:
> Sergey,
> 
> On 09.02.21, Sergey Kaplun wrote:
> > Igor,
> > 
> > On 09.02.21, Igor Munkin wrote:
> > > Sergey,
> > > 
> > > Thanks for your review!
> > > 
> > > On 09.02.21, Sergey Kaplun wrote:
> > > > Hi, Igor!
> > > > 
> > > > Thanks for the patch!
> > > > LGTM, except 4 comments about memory profiler parser below.
> 
> Added your tag:
> | Reviewed-by: Sergey Kaplun <skaplun@tarantool.org>

Thanks!

> 
> > > 
> > > I have several questions, so postponed your Ack a bit.
> > 
> > No problem.
> > 
> > > 
> > > > 
> > > > On 02.02.21, Igor Munkin wrote:
> > > > > Since the build machinery is going to be ported to CMake there would be
> > > > > Makefile names clashing. This change renames the original build system
> > > > > (and a couple of auxiliary files requiring configuring) to keep all this
> > > > > machinery working.
> > > > > 
> > > > > As a result of these changes one need to explicitly specify the Makefile
> > > > > in the build command:
> > > > > | make -f Makefile.original <options>
> > > > > 
> > > > > Needed for tarantool/tarantool#4862
> > > > > 
> > > > > Signed-off-by: Igor Munkin <imun@tarantool.org>
> > > > > ---
> > > > >  Makefile => Makefile.original               | 44 +++++++++++++--------
> > > > >  etc/{luajit.pc => luajit.pc.in}             |  4 +-
> > > > >  src/{Makefile.dep => Makefile.dep.original} |  0
> > > > >  src/{Makefile => Makefile.original}         |  4 +-
> > > > >  tools/luajit-parse-memprof                  |  9 -----
> > > > >  tools/luajit-parse-memprof.in               |  6 +++
> > > > >  6 files changed, 38 insertions(+), 29 deletions(-)
> > > > >  rename Makefile => Makefile.original (85%)
> > > > >  rename etc/{luajit.pc => luajit.pc.in} (91%)
> > > > >  rename src/{Makefile.dep => Makefile.dep.original} (100%)
> > > > >  rename src/{Makefile => Makefile.original} (99%)
> > > > >  delete mode 100755 tools/luajit-parse-memprof
> > > > >  create mode 100644 tools/luajit-parse-memprof.in
> > > > > 
> > > > > diff --git a/Makefile b/Makefile.original
> > > > > similarity index 85%
> > > > > rename from Makefile
> > > > > rename to Makefile.original
> > > > > index 61967df..b85d4bf 100644
> > > > > --- a/Makefile
> > > > > +++ b/Makefile.original
> 
> <snipped>
> 
> > > > > +# in scope of https://github.com/tarantool/tarantool/issues/5688.
> > > > > +tools/$(FILE_TMEMPROF):
> > > > > +	@sed -e "s|@LUAJIT_TOOLS_DIR@|$(realpath tools)|" \
> > > > > +	     -e "s|@LUAJIT_TOOLS_BIN@|$(realpath src/luajit)|" \
> > > > 
> > > > 2. @LUAJIT_BIN@ looks more convenient, doesn't it?
> > > 
> > > It doesn't for me. Why does the current naming look inconvenient to you?
> > 
> > What does LUAJIT_TOOLS_BIN mean? I confused by TOOLS part.
> 
> It means a LuaJIT binary used for tools, so one can distinct them if
> necessary. As an additional bonus, the commands are well-aligned :)

Really nice :)

> 

<snipped>

> > > > > diff --git a/tools/luajit-parse-memprof.in b/tools/luajit-parse-memprof.in
> > > > > new file mode 100644
> > > > > index 0000000..8867202
> > > > > --- /dev/null
> > > > > +++ b/tools/luajit-parse-memprof.in
> > > > > @@ -0,0 +1,6 @@
> > > > > +#!/bin/bash
> > > > > +#
> > > > > +# Launcher for memprof parser.
> > > > > +
> > > > > +LUA_PATH="@LUAJIT_TOOLS_DIR@/?.lua;;" \
> > > > > +	@LUAJIT_TOOLS_BIN@ @LUAJIT_TOOLS_DIR@/memprof.lua $@
> > > > 
> > > > 3. Unfortunately, your solution doesn't work for me:
> > > 
> > > Crap, I believe I've fixed this.
> > > 
> > > > 
> > > > | $ git log --oneline -n1
> > > > | 7badb7e (HEAD) build: preserve the original build system
> > > > | $ make -f Makefile.original  -j
> > > > | ==== Building LuaJIT 2.1.0-beta3 ====
> > > > | ...
> > > > | ==== Successfully built LuaJIT 2.1.0-beta3 ====
> > > > 
> > > > Side note: I suppose it is nothing bad to add corresponding lines about
> > > > tools building. At least it simplifies build debugging.
> > > > Feel free to ignore.
> > > 
> > > One can adjust this for debugging. Otherwise there is no need to see
> > > this output. We can use those hacks with Q/E, but I hope this part will
> > > have gone in the nearest future.
> > 
> > OK, never mind.
> > 
> > > 
> > > > 
> > > > | $ tools/luajit-parse-memprof /tmp/memprof_memleak.bin; echo -e "\n"; cat tools/luajit-parse-memprof
> > > > | tools/luajit-parse-memprof: line 5: /home/burii/reviews/luajit/cmake/tools/memprof.lua: Permission denied
> > > > |
> > > > | #!/bin/bash
> > > > | #
> > > > | # Launcher for memprof parser.
> > > > |
> > > > | LUA_PATH="/home/burii/reviews/luajit/cmake/tools/?.lua;;" \
> > > > |          /home/burii/reviews/luajit/cmake/tools/memprof.lua $@
> > > > 
> > > > This patch is working for me. But I am not bash|make guru :).
> > > 
> > > Heh, try your patch on a clean repo: unfortunately it works neither. The
> > > root cause is the lack of <src/luajit> on configuration phase. I added
> > 
> > Hmm, it's weird. `realpath` manual declares:
> > | all but the last component must exist
> > To be honest, I don't understand why it fails even in the first version
> > -- obviously, <src> exists.
> 
> But <src/luajit> does not -- that's the point.

I thought so too at the beginning, but when test it:

| $ realpath reviews/blabla && ls $_
| /home/burii/reviews/blabla
| ls: cannot access 'reviews/blabla': No such file or directory

Like manual declares.
Anyway, we can discuss it offline :)

> 
> > Anyway, LGTM.
> > 
> > > the corresponding dependency for this rule. Fixed, squashed,
> > > force-pushed to the branch. Diff is below:
> > > 
> > > ================================================================================
> > > 
> > > diff --git a/Makefile.original b/Makefile.original
> > > index c3172f0..33dc2ed 100644
> > > --- a/Makefile.original
> > > +++ b/Makefile.original
> > > @@ -198,7 +198,7 @@ tools: tools/$(FILE_TMEMPROF)
> > >  # FIXME: This is an ugly hack to manually configure an auxiliary
> > >  # tools/luajit-parse-memprof. This file should go away in scope of
> > >  # https://github.com/tarantool/tarantool/issues/5688.
> > > -tools/$(FILE_TMEMPROF):
> > > +tools/$(FILE_TMEMPROF): src/luajit
> > >  	@sed -e "s|@LUAJIT_TOOLS_DIR@|$(realpath tools)|" \
> > >  	     -e "s|@LUAJIT_TOOLS_BIN@|$(realpath src/luajit)|" \
> > >  	     $@.in > $@
> > > 
> > > ================================================================================
> > > 
> > > After this patch everything is fine.
> > > 
> > > > 
> > > > | diff --git a/Makefile.original b/Makefile.original
> > > > | index b85d4bf..877398a 100644
> > > > | --- a/Makefile.original
> > > > | +++ b/Makefile.original
> > > > | @@ -199,8 +199,8 @@ tools: tools/$(FILE_TMEMPROF)
> > > > |  # tools/luajit-parse-memprof. I hope this file will have gone away
> > > > |  # in scope of https://github.com/tarantool/tarantool/issues/5688.
> > > > |  tools/$(FILE_TMEMPROF):
> > > > | -        @sed -e "s|@LUAJIT_TOOLS_DIR@|$(realpath tools)|" \
> > > > | -             -e "s|@LUAJIT_TOOLS_BIN@|$(realpath src/luajit)|" \
> > > > | +        @sed -e "s|@LUAJIT_TOOLS_DIR@|`realpath tools`|" \
> > > > | +             -e "s|@LUAJIT_TOOLS_BIN@|`realpath src/luajit`|" \
> > > > |               $@.in > $@
> > > > |          @chmod +x $@
> > > > |  
> > > > 
> > > > 4. Please, create separate commit to tools-related changes.
> > > 
> > > For what?
> > 
> > I don't understand existing of these changes (but I like them :))
> > from commit message. Is it mentioned in the following part?
> 
> Yes.
> 
> > 
> > | (and a couple of auxiliary files requiring configuring)
> > 
> > Is it better to mention directly tools files here instead "auxiliary"?
> 
> No, since luajit.pc is also adjusted. I guess changes are mostly minimal
> (but a bit hacky) to move them to a separate patch.

OK.

> 
> > 
> > > 
> > > > Also, I suppose, it would be nice to add <tools/luajit-parse-memprof>
> > > > to <.gitignore> as far as it's generated. These lines may be confusing:
> > > 
> > > This is added in the next patch, but I'm not against moving it to this
> > > one. Fixed, squashed, force-pushed to the branch. Diff is below:
> > 
> > Thanks! But one nitpick, feel free to ignore.
> > 
> > > 
> > > ================================================================================
> > > 
> > > diff --git a/.gitignore b/.gitignore
> > > index 1a07bf7..fc9c31e 100644
> > > --- a/.gitignore
> > > +++ b/.gitignore
> > > @@ -9,3 +9,6 @@
> > >  *.dmp
> > >  *.swp
> > >  .tags
> > > +
> > > +# Configured runner for LuaJIT memprof parser
> > 
> > Nit: s/parser/parser./
> > Feel free to ignore.
> 
> Thanks, fixed.
> 
> > 
> > > +tools/luajit-parse-memprof
> > > 
> > > ================================================================================
> > > 
> > > > 
> > > > | $ git status
> > > > | HEAD detached at 7badb7e
> > > > | Untracked files:
> > > > |   (use "git add <file>..." to include in what will be committed)
> > > > |         tools/luajit-parse-memprof
> > > > 
> > > > > -- 
> > > > > 2.25.0
> > > > > 
> > > > 
> > > > -- 
> > > > Best regards,
> > > > Sergey Kaplun
> > > 
> > > -- 
> > > Best regards,
> > > IM
> > 
> > -- 
> > Best regards,
> > Sergey Kaplun
> 
> -- 
> Best regards,
> IM

-- 
Best regards,
Sergey Kaplun

  reply	other threads:[~2021-02-10  9:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 20:57 [Tarantool-patches] [PATCH luajit 0/5] Self-sufficient LuaJIT testing environment Igor Munkin via Tarantool-patches
2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 1/5] build: preserve the original build system Igor Munkin via Tarantool-patches
2021-02-04 22:53   ` Timur Safin via Tarantool-patches
2021-02-08 15:56     ` Igor Munkin via Tarantool-patches
2021-02-09 11:38   ` Sergey Kaplun via Tarantool-patches
2021-02-09 12:47     ` Igor Munkin via Tarantool-patches
2021-02-09 14:45       ` Sergey Kaplun via Tarantool-patches
2021-02-09 15:28         ` Igor Munkin via Tarantool-patches
2021-02-10  9:35           ` Sergey Kaplun via Tarantool-patches [this message]
2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 2/5] build: replace GNU Make with CMake Igor Munkin via Tarantool-patches
2021-02-04 22:53   ` Timur Safin via Tarantool-patches
2021-02-08 15:56     ` Igor Munkin via Tarantool-patches
2021-02-09 13:55       ` Timur Safin via Tarantool-patches
2021-02-09 15:09         ` Igor Munkin via Tarantool-patches
2021-02-11 19:23   ` Sergey Kaplun via Tarantool-patches
2021-02-16 15:28     ` Igor Munkin via Tarantool-patches
2021-02-18  9:56       ` Sergey Kaplun via Tarantool-patches
2021-02-20 19:18         ` Igor Munkin via Tarantool-patches
2021-02-27 10:48           ` Sergey Kaplun via Tarantool-patches
2021-02-28 18:18             ` Igor Munkin via Tarantool-patches
2021-02-13  3:47   ` Sergey Kaplun via Tarantool-patches
2021-02-16 15:32     ` Igor Munkin via Tarantool-patches
2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 3/5] test: run LuaJIT tests via CMake Igor Munkin via Tarantool-patches
2021-02-08 15:05   ` Timur Safin via Tarantool-patches
2021-02-08 16:29     ` Igor Munkin via Tarantool-patches
2021-02-09  8:16       ` Timur Safin via Tarantool-patches
2021-02-09  8:43         ` Igor Munkin via Tarantool-patches
2021-02-09 13:59           ` Timur Safin via Tarantool-patches
2021-02-09 15:10             ` Igor Munkin via Tarantool-patches
2021-02-14 18:48   ` Sergey Kaplun via Tarantool-patches
2021-02-19 19:04     ` Igor Munkin via Tarantool-patches
2021-02-27 13:50       ` Sergey Kaplun via Tarantool-patches
2021-02-28 18:18         ` Igor Munkin via Tarantool-patches
2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 4/5] test: fix warnings found with luacheck in misclib* Igor Munkin via Tarantool-patches
     [not found]   ` <012f01d6fe1a$a2aa6890$e7ff39b0$@tarantool.org>
2021-02-08 15:57     ` Igor Munkin via Tarantool-patches
     [not found]     ` <2c495492-50f4-acfd-ad66-2cb44abb5fa1@tarantool.org>
2021-02-08 15:40       ` Sergey Bronnikov via Tarantool-patches
2021-02-08 15:58       ` Igor Munkin via Tarantool-patches
2021-02-14 19:16   ` Sergey Kaplun via Tarantool-patches
2021-02-16 15:29     ` Igor Munkin via Tarantool-patches
2021-02-16 16:36       ` Sergey Kaplun via Tarantool-patches
2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 5/5] test: run luacheck static analysis via CMake Igor Munkin via Tarantool-patches
2021-02-04 22:52   ` Timur Safin via Tarantool-patches
2021-02-08 15:57     ` Igor Munkin via Tarantool-patches
2021-02-14 19:32   ` Sergey Kaplun via Tarantool-patches
2021-02-19 19:14     ` Igor Munkin via Tarantool-patches
2021-02-28 22:04 ` [Tarantool-patches] [PATCH luajit 0/5] Self-sufficient LuaJIT testing environment Igor Munkin via Tarantool-patches

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

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

  git send-email \
    --in-reply-to=20210210093509.GB9361@root \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 1/5] build: preserve the original build system' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox