unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Serghei <egrep@protonmail.ch>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: GNU Emacs Developers <emacs-devel@gnu.org>
Subject: Re: Install bnf-mode from the tar archive
Date: Mon, 20 Jan 2020 17:31:57 +0000	[thread overview]
Message-ID: <633e0139-91d7-544b-fd10-64d37b4a4ec5@protonmail.ch> (raw)
In-Reply-To: <jwvy2u3twl5.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 4913 bytes --]

Hello Stefan,

Should a file an issue in the particular bug tracker (I don't know
in which one)?  Or we can just cc `tar-mode' maintainer?

As I realized the main problem is the tar format.  Using bsdtar with
`--format=ustar' flag (which is POSIX-standard) does the trick.
However bsdtar uses “pax interchange” format by default and this is
not implemented properly in the `tar-mode'.

On 1/19/20 3:18 PM, Stefan Monnier wrote:
>> I have managed to fix the issue just by replacing bsdtar by GNU tar.
> I guess that deserves a bug report (the bug is not in
> the package manager but in tar-mode.el which seems not to support some
> of the formats used by bsdtar).
>
>
>         Stefan
>
>
>> For the full list of changes refer to:
>> https://github.com/sergeyklay/bnf-mode/commit/309f05a781dc05999e8f0530f23089f38dd0fde6
>>
>> On 1/18/20 5:08 PM, Serghei wrote:
>>> Hello,
>>>
>>> I am the bnf-mode[1] creator.  I am trying to figure out what
>>> happens when I install the mode from the tar archive.  Frankly
>>> speaking, I get a strange error message.
>>>
>>> You can see the fresh Makefile I use to create tar archive at GitHub
>>> repo[2].  All I need to create a tar archive is a command
>>> `make package'.  And it seems it works as expected.  However, after
>>> creating the archive, I was failed to install it.  After changing
>>> this line[3] as follows:
>>>
>>> diff --git a/Makefile b/Makefile
>>> index c04c01c..d11ac3d 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -122,7 +122,8 @@ package: $(PACKAGE_NAME).tar
>>>
>>>  .PHONY: install
>>>  install: $(PACKAGE_NAME).tar
>>> -       $(EMACS) --batch -l package -f package-initialize --eval
>>> "(package-install-file \"$(PWD)/$(PACKAGE_NAME).tar\")"
>>> +       $(EMACS) --batch -l package -f package-initialize --eval \
>>> +               "(let ((debug-on-error t))(package-install-file
>>> \"$(PWD)/$(PACKAGE_NAME).tar\"))"
>>>
>>>  .PHONY: help
>>>  help: .title
>>>
>>> I got the following debug trace:
>>>
>>> $ make install
>>> Parsing tar file...
>>> Parsing tar file...done
>>> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
>>>   tar--describe-as-link(nil)
>>>   tar--check-descriptor(nil)
>>>   tar-get-file-descriptor("bnf-mode-0.4.3/PaxHeader/PaxHeader-pkg.el")
>>>   package-tar-file-info()
>>>   package-install-from-buffer()
>>>   package-install-file("/home/klay/work/bnf-mode/bnf-mode-0.4.3.tar")
>>>   (let ((debug-on-error t)) (package-install-file
>>> "/home/klay/work/bnf-mode/bnf-mode-0.4.3.tar"))
>>>   eval((let ((debug-on-error t)) (package-install-file
>>> "/home/klay/work/bnf-mode/bnf-mode-0.4.3.tar")))
>>>   command-line-1(("-l" "package" "-f" "package-initialize" "--eval"
>>> "(let ((debug-on-error t))(package-install-file
>>> \"/home/klay/work/bnf-mode/bnf-mode-0.4.3.tar\"))"))
>>>   command-line()
>>>   normal-top-level()
>>>
>>> make: *** [Makefile:125: install] Error 255
>>>
>>> I have no idea what is PaxHeader/PaxHeader-pkg.el and even stranger
>>> that after inspecting `tar-mode' I found this:
>>>
>>> (defun tar-get-file-descriptor (file)
>>>   ;; Used by package.el.
>>>   (let ((desc ()))
>>>     (dolist (hdr tar-parse-info)
>>>       (when (equal file (tar-header-name hdr))
>>>         (setq desc hdr)))
>>>     (tar--check-descriptor desc)
>>>     desc))
>>>
>>> As you can see without any validation `desc' was passed to
>>> `tar--check-descriptor` defun.  The `tar--check-descriptor` is just
>>> calls `tar--describe-as-link`:
>>>
>>> (defun tar--check-descriptor (descriptor)
>>>   (let ((link-desc (tar--describe-as-link descriptor)))
>>>     (when link-desc
>>>       (error "This is %s, not a real file" link-desc))))
>>>
>>> And finally it calls `tar-header-link-type':
>>>
>>> (defun tar--describe-as-link (descriptor)
>>>   (let ((link-p (tar-header-link-type descriptor)))
>>>     (if link-p
>>> 	(cond ((eq link-p 5) "a directory")
>>>               ((eq link-p 20) "a tar directory header")
>>>               ((eq link-p 28) "a next has longname")
>>>               ((eq link-p 29) "a multivolume-continuation")
>>>               ((eq link-p 35) "a sparse entry")
>>>               ((eq link-p 38) "a volume header")
>>>               ((eq link-p 55) "a pax global extended header")
>>>               ((eq link-p 72) "a pax extended header")
>>>               (t "a link")))))
>>>
>>> I will be happy for any help and tips in the right direction.
>>>
>>> N.B. My GNU Emacs version is 26.3 on Debian/GNU Linux 10.
>>>
>>>
>>> [1]: https://elpa.gnu.org/packages/bnf-mode.html
>>> [2]:
>>> https://github.com/sergeyklay/bnf-mode/blob/87c779851e44aab6639cdf2ab699aa9cd41f97c7/Makefile
>>> [3]:
>>> https://github.com/sergeyklay/bnf-mode/blob/87c779851e44aab6639cdf2ab699aa9cd41f97c7/Makefile#L125
>>>
>>> --
>>> Serghei
>>>
>>>
>



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-01-20 17:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-18 15:08 Install bnf-mode from the tar archive Serghei
2020-01-18 23:47 ` Serghei
2020-01-19 13:18   ` Stefan Monnier
2020-01-20 17:31     ` Serghei [this message]
2020-01-20 17:47       ` Stefan Monnier
2020-01-20 17:47       ` Noam Postavsky
2020-01-20 17:58         ` Serghei

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=633e0139-91d7-544b-fd10-64d37b4a4ec5@protonmail.ch \
    --to=egrep@protonmail.ch \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).