From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nicolas Martyanoff Newsgroups: gmane.emacs.devel Subject: Dynamic module building and reloading Date: Tue, 13 Jun 2023 18:11:47 +0200 Message-ID: <87mt13tk8s.fsf@valhala.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22013"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 13 18:12:36 2023 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 1q96dI-0005WX-Aa for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Jun 2023 18:12:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q96cf-0007RN-1X; Tue, 13 Jun 2023 12:11:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q96cb-0007RA-W7 for emacs-devel@gnu.org; Tue, 13 Jun 2023 12:11:54 -0400 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q96ca-0005nK-2V for emacs-devel@gnu.org; Tue, 13 Jun 2023 12:11:53 -0400 Original-Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f62b512fe2so7379306e87.1 for ; Tue, 13 Jun 2023 09:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=n16f-net.20221208.gappssmtp.com; s=20221208; t=1686672709; x=1689264709; h=content-transfer-encoding:mime-version:user-agent:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=kc6xobmSaYzUEPYHM0BCECum+3rP2iT7di2TH+ByAmU=; b=ThB7mgja6bGW4f4p8Zc9DKOAgAg2xjvKTiao3rF8YRJgiD1J72DGNJ2KzVNhfoPl7p BwrpJc+LuAJ5EaLhwTinUF87Ohr7qc6v5In7Nrz+euyTdT3D4rX1tKGKJFmnYk3MfQFE bJcAhTE1nT3/GnHUIc6Q+f3ee+2xcfCV/ysdfvRaYvTfXh+PlQ/NDXmtVvllM1T764gp /1r+jHT+81nI3CuGZr4EA4T9ogzWKPRAM4seoDSVddkm/s9PIiADtGjFdRrjSo3qZ1uV x28PXoZq7PvTSPxOxHQCO9Fb75sEITG3G2wgRi/OYDyMQCc4zTJ05c+x9e9VeAc4FmI+ 8E3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686672709; x=1689264709; h=content-transfer-encoding:mime-version:user-agent:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kc6xobmSaYzUEPYHM0BCECum+3rP2iT7di2TH+ByAmU=; b=g8sF73mbecZZO85Bo0pFTAxEDsozC472MkE39/TXBn6wupJQUw+8sX/mkBQCWzhes4 ZakTdzx26bssiKWYJ9XGZmePDLkkX2NTz64oUiWDKqDTyRuwERS9MZzrlc088BfzVVx5 0GyNB6ydVA8H/kFyYeTGFTlsGZI86/uMvRbEeTpr0TxTzc039iZgeaVm5Eu/Rnfa7OCZ wuN0vTv6GXxpqtbsHMMdNaTKclMUv4el4qalIbNkEk7R8pVB31gTgFRJgsS25+bgYeop VvQ3GxcPlD13hKiQT85p5DZ+cV62CFBdoJdXf9dSXJuyRHebxFv1srnPydgnheWhjJo6 GLIQ== X-Gm-Message-State: AC+VfDxJHi8ZfWdiiP58w4gcm/Epgbal0H4r8PQQOCN0aSXST9cXqQWP xTkAsfIkyIjsvAfeZ3kgZxXZVBcIHtOjz2K+rrwP6A== X-Google-Smtp-Source: ACHHUZ7Wr96z0SMshYBisELwuDA28hdxfkSXuomysMRAD2CQNf8c3Knu6kRfD3hTUun9nGN+IBv9Cg== X-Received: by 2002:a19:7104:0:b0:4f6:3000:4d5a with SMTP id m4-20020a197104000000b004f630004d5amr5179870lfc.38.1686672708957; Tue, 13 Jun 2023 09:11:48 -0700 (PDT) Original-Received: from valhala (2a01cb04000943008cd04fe2c793033e.ipv6.abo.wanadoo.fr. [2a01:cb04:9:4300:8cd0:4fe2:c793:33e]) by smtp.gmail.com with ESMTPSA id y24-20020a05600c365800b003f735ba7736sm14795367wmq.46.2023.06.13.09.11.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 09:11:48 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=nicolas@n16f.net; helo=mail-lf1-x12f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306780 Archived-At: Hi, I was playing a bit with dynamic modules and found two issues. 1. There does not seem to be any builtin utilities to deal with the process of building and loading shared library. I ended up writing a couple elisp functions to find the location of the C file, spawn cc, load the shared library=E2=80=A6 Is this the expected method? In this state= , it would seem that every Emacs packages using dynamic modules has to write its own build/load code. 2. It seems that once a dynamic module has been loaded, it cannot be reloaded after the shared library has been rebuilt. A Google search seems to confirm it. Is there a workaround? If I pursue my little project, I'll have to write quite a lot of C code in the dynamic module; I *really* do not want to restart Emacs to test every single modification. Hopefully I'm not the only one with these issues! Regards, --=20 Nicolas Martyanoff https://n16f.net nicolas@n16f.net