public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Marcel Vollweiler <marcel@codesourcery.com>,
	gcc-patches@gcc.gnu.org, Tobias Burnus <tobias@codesourcery.com>
Subject: Re: [PATCH] OpenMP, libgomp: Environment variable syntax extension.
Date: Mon, 4 Jul 2022 17:14:58 +0200	[thread overview]
Message-ID: <YsMD8g8SAcbfQGgO@tucnak> (raw)
In-Reply-To: <Yr2LqBtijydv7Q9V@tucnak>

On Thu, Jun 30, 2022 at 01:40:24PM +0200, Jakub Jelinek via Gcc-patches wrote:
> On Fri, Jun 10, 2022 at 03:59:37PM +0200, Marcel Vollweiler wrote:
> > > I'm not sure we can rely on execv on all targets that do support libgomp.
> > > Any reason why you actually need this, rather than using
> > > dg-set-target-env-var directive(s) and perhaps return 0; if getenv doesn't
> > > return the expected values?
> > 
> > Interesting topic. After some (internal) discussions I think the best way is to
> > set the environment variables explicitely instead using dg-set-target-env-var.
> > The reason is that dg-set-target-env-var does not work for remote testing (which
> > seems to be a common test environment). For remote testing dejagnu immediately
> > aborts the test case with UNSUPPORTED which is specified in the corresponding
> > extension and makes sence from my point of view as the test assumption cannot be
> > fulfilled (since the environment variables are not set on remote targets).
> > It also means that whenever dg-set-target-env-var is set in the test file, the
> > execution of the test case is not tested on remote targets.
> 
> The only reason why dg-set-target-env-var is supported on native only right
> now is that I'm never doing remote testing myself and so couldn't test that.
> There is no inherent reason why the env vars couldn't be propagated over to
> the remote and set in the environment there.
> So trying to work around that rather than at least trying to change
> dg-set-target-env-var so that it works with the remote testing you do looks
> wrong.
> If dg-set-target-env-var can be made to work remotely, it will magically
> improve those 130+ tests that use it already together with the newly added
> tests.
> 
> So, I'd suggest to just use dg-set-target-env-var and incrementally work on
> making it work for remote testing if that is important to whomever does
> that kind of testing.  Could be e.g. a matter of invoking remotely
> env VAR1=val1 VAR2=val2 program args
> instead of program args.  If env is missing on the remote side, it could
> be UNSUPPORTED then.

essentially where we now do:
        if { [info exists set_target_env_var] \
             && [llength $set_target_env_var] != 0 } {
            if { [is_remote target] } {
                return [list "unsupported" ""]
            }
            set-target-env-var
        }
in the is_remote case check (ideally cached) whether env program works on the
target using remote exec with the env vars temporarily disabled and trying
something like
env MYVAR=value
and if that succeeds and prints MYVAR=value in the output, don't
return [list "unsupported" ""] and instead continue without doing that
set-target-env-var/restore-target-env-var stuff
and after this big block wrap also call_remote and if it is exec and the
env vars are around (same stuff as how the intercepted ${tool}_load does
this), prepend env and the vars in VAR=value format before the rest of args.

	Jakub


  parent reply	other threads:[~2022-07-04 15:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18 15:22 Marcel Vollweiler
2022-01-18 16:10 ` [PATCH] " Marcel Vollweiler
2022-05-04 15:12   ` Jakub Jelinek
2022-05-04 15:52     ` Tobias Burnus
2022-06-10 13:59     ` Marcel Vollweiler
2022-06-30 11:40       ` Jakub Jelinek
2022-06-30 13:21         ` Jakub Jelinek
2022-06-30 17:13           ` Jakub Jelinek
2022-07-04 15:14         ` Jakub Jelinek [this message]
2022-07-25 13:38         ` Marcel Vollweiler
2022-08-02  7:52           ` Marcel Vollweiler
2022-08-22 15:35             ` Jakub Jelinek
2022-08-31 10:56               ` Marcel Vollweiler
2022-09-06 11:51                 ` Jakub Jelinek
2022-09-09 20:50                   ` Rainer Orth
2022-09-09 22:08                     ` Jakub Jelinek
2022-09-09 22:13                       ` Iain Sandoe
2022-09-09 22:17                         ` Jakub Jelinek
2022-09-10 13:17                           ` Iain Sandoe
2022-09-09 11:50                 ` [committed] libgomp: Fix up OMP_PROC_BIND handling [PR106894] Jakub Jelinek

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=YsMD8g8SAcbfQGgO@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=marcel@codesourcery.com \
    --cc=tobias@codesourcery.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.
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).