From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Nicolas_B=C3=A9rtolo?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] [WIP] Port feature/native-comp to Windows. Date: Mon, 11 May 2020 12:20:36 -0300 Message-ID: References: <5eb5b953.1c69fb81.a67ce.a764@mx.google.com> <83lfm1hc91.fsf@gnu.org> <83wo5lds87.fsf@gnu.org> <83lflzd8es.fsf@gnu.org> <83ftc7d4zu.fsf@gnu.org> <83blmvd2if.fsf@gnu.org> <833686d08r.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="11772"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Andrea Corallo To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 11 17:21:48 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYAFY-0002yF-2e for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 17:21:48 +0200 Original-Received: from localhost ([::1]:54778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYAFW-0007fW-Kz for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 11:21:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYAEc-0006hI-Se for emacs-devel@gnu.org; Mon, 11 May 2020 11:20:50 -0400 Original-Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]:40933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYAEb-0000XN-Tw; Mon, 11 May 2020 11:20:50 -0400 Original-Received: by mail-oi1-x22c.google.com with SMTP id t199so15430024oif.7; Mon, 11 May 2020 08:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fDyYO3xDIZBJk6xxdZFaW+yYhUw33EpXf/HfEgF2Ev4=; b=N8/Ta3u2nUvCS+UkNqtCXJsWQ6XJIwQZR9K9NOoGAukbpMpcN36UeNDrm52dm1DjP/ zaUzoRGyipZ11ijycTY8mzncQ8kZUEajOF52mg69zkWuQHLQTXoH/qGtmPdnBHRNgbNQ pJm2OCFMjCn6PebWmU3BrDTiqBTdwJsed1Tg6D23lpX/07PxJREG6fd6tsvyNY9uG0eH pZQgQipM1riJ8Owx5lRlOtfU4aOE++607WXUGfoMhFfx2BHsCEaIv6xnlZsaJhi/BkVK ZrOdtkdq2x0s+/zGdBsoAtKROhjZjlRKYCHPHRTY76+vCgoeKKpkGZbeOi+/jpmrxcqe ZOiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fDyYO3xDIZBJk6xxdZFaW+yYhUw33EpXf/HfEgF2Ev4=; b=ddHiaU7Kmz5Hr6gCLW1N+MaeRQto7yZsYHyawdRQDRci3haFpHHjNev5W0NyXexgpO FCzEZiiECSykdFHf8o3ZRBFafxgj4Wo0lPvePgxhQJ3CE1jS5YVfRE2N4jH0dd7Vwgnu M/omBkFe1RgwGTsL3htgCJWpr34IxznSKG5uwe9AuaUUMIBMGA7KuzpaIhZ5khQYK/7e ewjnHEcieJkm0N6LNe1k4uYqHIxixN+LP3aoAMEB/V6lJtvXiKouET4DltNlvenmab8i qxAHvu6YolUgRG1S1EukeQ9zh6iQ4aenwe5JVq2uNm/f6TR7bavF+gsmtunALX7XWdCY VdjA== X-Gm-Message-State: AGi0PubVthoAqrEc1qLELTVz2qslyZexsGy9TQuVATrK1g+a8aF2tPQZ /1EvVTR9tvKnsW1qRO6wtZQ4Oof21Dq/SYqrW6ARmtKS7AASRA== X-Google-Smtp-Source: APiQypKMSjjIMkfGjOMs5ZrOXkP2/RcTyhBNdiMPRR2DcDJVQkbud/xynEsJ9jvXuSdSegKKBq2KinjNonVQUmj4Sbw= X-Received: by 2002:aca:c68b:: with SMTP id w133mr20379041oif.175.1589210447745; Mon, 11 May 2020 08:20:47 -0700 (PDT) In-Reply-To: <833686d08r.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::22c; envelope-from=nicolasbertolo@gmail.com; helo=mail-oi1-x22c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:249801 Archived-At: > I don't think it would be wise for us to distribute libgccjit, because > then we'd need to distribute the GCC sources, and the user will be > unable to reliably use the shipped libgccjit with their local GCC > installation (due to possible version mismatch). IMHO that is really inconvenient from the point of view of a user that just wants to install Emacs and use all its features. Installing Mingw is not a simple process (at least in my experience). And adding it to PATH will also add many other unrelated utilities. This pollutes the PATH variable and may cause trouble. I haven't done in my machine because I fear it may interact with badly with the rest of the system. I can think of two ways: - The whole system will have the mingw libraries available in the LoadLibrary() search path. - The mingw distribution comes with many utilities that the user may not want in PATH. I haven't explicitly installed any of these, but they are in the same folder as `gcc`: ImageMagick, Python, sqlite, TCL. Overall I don't think it is a good idea to make the user install a whole Mingw distribution when they only need 10 files. I can think of a middle-ground solution. Let's have a `comp-gcc-path` variable that is prepended to PATH in `process-environment` when launching the compilation subprocess. This will variable should point to the path where `gcc` lives. In my system it would be "C:/msys64/mingw64/bin". This would set up the environment libgccjit expects (no "-B" flag necessary), but it would not require adding that directory to PATH. It separates what is necessary for Emacs to work, from the environment the user setup to work. As an example: imagine the user prepends a "C:/myproject/custom-gcc/bin" to PATH and then starts Emacs because they need a customized GCC to work on a certain project. Let's say they need a custom libgccjit for that project too. Emacs would load that version because it is first in PATH, and then what may happen is unpredictable. It may have different function signatures and when Emacs calls them through dlsym() we would get a hard-to-find crash. > Right, I think at least on MS-Windows we need to do that. On Posix > platforms, Emacs will be able to start if there's no libgccjit (and > will crash if it attempts to call any of its functions), so it might > be a good idea to use dlopen/dlsym there as well. But on Windows it > is IMO critical. I will do this. Nicolas