unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 52117@debbugs.gnu.org
Subject: [bug#52117] [core-updates-frozen] [PATCH 0/6] Fix Julia packages.
Date: Mon, 29 Nov 2021 15:10:01 +0100	[thread overview]
Message-ID: <87tufvqchy.fsf_-_@gmail.com> (raw)
In-Reply-To: <87tufx6l74.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 27 Nov 2021 21:57:51 -0500")

Hi Maxim,

On Sat, 27 Nov 2021 at 21:57, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

> No, it would invoke julia with the following argv list: "julia"
> "-depwarn=yes" "" [...];
>
> My point is that invoke is equivalent to doing an execlp system call;
> and the arguments get passed as a list (including that empty string
> argument when parallel-tests? is #f).  Whether this works or not is up
> to the application, so I'd suggest not relying on it.  Consider for
> example:
>
> (execlp "python" "python" "" "-c" "print('hello')")
> /gnu/store/cwqv4z5bvb5x6i0zvqgc1j1dnr6w9vp8-profile/bin/python: can't
> find '__main__' module in
> '/home/maxim/src/guix-core-updates-next/gnu/packages/'

Thanks for the explanations.


> It fails because it interprets the empty string argument as the current
> directory, apparently.  If that works with the above Julia invocation,
> that's great, but it doesn't make it cleaner in my opinion :-).

Indeed, and it is expected to fail because:

--8<---------------cut here---------------start------------->8---
def _get_main_module_details(error=ImportError):
    # Helper that gives a nicer error message when attempting to
    # execute a zipfile or directory by invoking __main__.py
    main_name = "__main__"
    try:
        return _get_module_details(main_name)
    except ImportError as exc:
        if main_name in str(exc):
            raise error("can't find %r module in %r" %
                              (main_name, sys.path[0]))
        raise
--8<---------------cut here---------------end--------------->8---

It allows to do:

        $ mkdir /tmp/foo
        $ echo print(42) > /tmp/foo/__main__.py
        $ python /tmp/foo

Therefore, this

        $ python '' -c '0'

just fails.  Contrary to,

        $ cd /tmp/foo
        $ python '' -c '0'

which just passes.  To me, it is an oddity of the Python command-line
which silently accepts a path; it is not documented by “python -h”.

Anyway, I agree that the behaviour when passing "" is up to the
application, therefore it should be avoided.


Cheers,
simon




  reply	other threads:[~2021-11-29 14:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 23:32 [bug#52117] [core-updates-frozen] [PATCH 0/6] Fix Julia packages zimoun
2021-11-25 23:35 ` [bug#52117] [PATCH 1/6] gnu: julia: Test correctly '#:parallel-tests?' zimoun
2021-11-25 23:35   ` [bug#52117] [PATCH 2/6] build: julia-build-system: Correctly disable parallel tests zimoun
2021-11-27  3:17     ` [bug#52117] [core-updates-frozen] [PATCH 0/6] Fix Julia packages Maxim Cournoyer
2021-11-27 12:38       ` zimoun
2021-11-27 18:59         ` zimoun
2021-11-28  2:57         ` Maxim Cournoyer
2021-11-29 14:10           ` zimoun [this message]
2021-11-25 23:35   ` [bug#52117] [PATCH 3/6] gnu: julia-aqua: Disable parallel tests zimoun
2021-11-25 23:35   ` [bug#52117] [PATCH 4/6] gnu: julia-interpolations: " zimoun
2021-11-25 23:35   ` [bug#52117] [PATCH 5/6] gnu: julia-requires: " zimoun
2021-11-25 23:35   ` [bug#52117] [PATCH 6/6] gnu: julia-unitful: " zimoun
2021-11-27  2:26   ` [bug#52117] [core-updates-frozen] [PATCH 0/6] Fix Julia packages Maxim Cournoyer
2021-11-27  6:31 ` bug#52117: " Maxim Cournoyer

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87tufvqchy.fsf_-_@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=52117@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /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/guix.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).