From patchwork Wed Jun 4 09:53:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 894081 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8243428C5A1 for ; Wed, 4 Jun 2025 09:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749030848; cv=none; b=U3Oi1jLrLhtxuv6p+OsQKvqV87JJmaK+ueDGeSwc5vtHu6DPLdqSKwZvFdk1giMlAFWLNW7V6avSGqvN2oMzligMkvkH226no363nW6aLSrwuMOZLqydYPDKRYcTXBLhkVc+FP35o7JtWwr1qUauxagDuiFJ66w/XxwDJsWJvSc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749030848; c=relaxed/simple; bh=7/Oha6Eo5reH/Z0/Jyw/NK0zfRkA124IU42KP6Bsq5M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NWx304rPLmRx9zvmydVTBnkmQCeP5EuRsheeVRPEeUF4v28/aCIr0O6HfZT8eCM0v0UnVkGNrjuTIfoW93Jm02Alo+TwVxR+xjNMQ8+BDzmN1ypKXqhjTvGCGaB1CQiTEYiOXLi6RdY4zHm1RS+s9LO8eXg90QEom0RpcAaWZR0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=m/+OAtlN; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="m/+OAtlN" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-3a4fd1ba177so541809f8f.0 for ; Wed, 04 Jun 2025 02:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1749030845; x=1749635645; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=So+7bY5B94Wz+9+ULUTh8P6IFbxeLILw2vz+4Ibi8P0=; b=m/+OAtlNIjDah2GWUtaaIB/671lGfIcAE9+tlx+IHiUqCc3+Oyn/kCobCh6wUadpAl OsEH2K/2EAQ3mDACN/xBpvBflHU0d9QsRPJjBr000Fh6GucMeH1iivWrs6r32q1wr5iJ lIH6VAxcC3IUM7f1hVnra2y3LySShHMkTo8cYFR/yJx64cegB02or2UtnJ8zT8M84zB5 Z5zvnbOMR6WueZHEmv1c6SXGoqdnrrXPk+bAGNqh1lXuZidVj80UYp5+CnDudhAEl6Ze 9A6ucQfnKVoZAOp4jsOYGzD2p5087KD4x0a45z8Io9ONwujTxFWfj4DiPCw3x79YJtSY u22w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749030845; x=1749635645; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=So+7bY5B94Wz+9+ULUTh8P6IFbxeLILw2vz+4Ibi8P0=; b=eWMMN8+JAlIt3W3zluX+708YuUjET6VtpjF4ae4scuLfhKCdfX95lBrcmcoZLN5FPF K8XPQOUflTj12lsqpR4se8F7Lp42LIG6pwNBcVlOJj1X17ZTPh3jN2fmrxwhKaGrgwdA ebDU0EDEvx5ugOactKU8LyFZ5qJn8ewonEJy7jpTGLkgzSbxEIS1n6qoH0FADpWwhPB9 E+Up/dchcexxBm8eYXvnmkhEupJo/Rnvkg2aX9JrQMO2Mu0PqR154JvgWXzPIT3u19LO Axx2N9jlWdPDjc0vYxp1DHmcJWRxXL97Q6HUBkNERgsr8xCHhjXVjNdXPOe9MNGfiUmI A4pg== X-Gm-Message-State: AOJu0YwvIeOCAlh5vNJDAkF5KQg1Fvwcv6o0D7OpIwdF07s8cd+We1WL 9LCSTW7ueJdJ1M6haeyAupFyEWM4XUJlmDfpuIiJ95BQUOwa4TNGdsTg6K4O1fkDswM= X-Gm-Gg: ASbGncvZkEhtNyHuA2Wy59yBOQx0lb0LxQWpgmW1vI4H/2fsfBg0KJQet1N7uFR40Uv EIUINscIjSOozwBPm5ftMhXcT+I+8eJR0VYxeMYCnvFuAcU1JGpDkSMm1J4VZKJCeFEmYv947DM ZljL01lMf+tIOPWg20jg9vGOVhRn2W9GPAXJfg2KJ+HQjCKJig2WxHE0BJePbVbAq5TsfWDWpyl nBqEJppLHhziAmUNb45tHLuOfISsEc0iG5KnLMh1cjONthCeWZiFajBMW/DV/9lJ8H1jfOeMYjk hfYFUmGMpGiv7V981Aoel0RQk4AQvSuDSHIUSzvlz45b7Q== X-Google-Smtp-Source: AGHT+IGVnnTGFaab0DoGGUha9sYF8F3VVer5gWeJ8Iep3h0nlD4X+FC/xKBZrJoQ7I6a/j/fqc/uxg== X-Received: by 2002:a5d:588a:0:b0:3a4:d367:c586 with SMTP id ffacd0b85a97d-3a51d551389mr1654755f8f.13.1749030844742; Wed, 04 Jun 2025 02:54:04 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:e8d2:e71d:f170:23e7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f00971e4sm21525640f8f.65.2025.06.04.02.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jun 2025 02:54:04 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 04 Jun 2025 11:53:55 +0200 Subject: [PATCH libgpiod 1/3] doc: reformat conf.py with black Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250604-rust-docs-v1-1-8ff23924a917@linaro.org> References: <20250604-rust-docs-v1-0-8ff23924a917@linaro.org> In-Reply-To: <20250604-rust-docs-v1-0-8ff23924a917@linaro.org> To: Vincent Fazio , Kent Gibson , Linus Walleij , Erik Schilling , Viresh Kumar Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=683; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=duFNkABcyruA/b+8Fi1QG2o9TAeLhkObsX0mFxW/AYs=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBoQBe6vNAAKYLJPvZbO+GU7YUA8PgRz7T6ujFPX pzgruJNSrqJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaEAXugAKCRARpy6gFHHX ciX3EAC5oqLdE9AikX0DthHmFT39nSQVmL6BPdG2NdHcKtrE+3qPjo5/TZIHgE1wWNmR1sxh4ng UpJ7LSHMVb9tRB8QHeJ+wL5GP4tJS81457Sr1s1tk11CJTPrnArCLWYYdUzs0ZMdrWE4is7Q5UR 6losUn4HKn+pdeNtzpQWoORJrEvFeQioiNG87aSG3t5Xi/qyoSgcQVDJoLVB1SpdBBzZ34XGj/P B6/aMjgGQOW4mtAUN6ViNIGdP2BIdjZBnONmnRedkJ9Ds5f5j1EQdi1xogEUbwsy+4kfhmKZfI7 KV9ekonAWJ1XPHSEheeLqgvWaq6qI3cFRXmiDXFPQ6gDdVJp24DuFaKdSh+syjod3W73hA3C/RX 4ZU9JXQF+4Yisk0Lc82PndDH7qLSH+qUrCRtwb70w2zUK6/G3VvV7HNi8MArsDqiQUkTXqBO/5a Q43HAn2nJOccYGwdwn1/hTVw62n47lqmz5uZj8QySf+FFNFryu9nwPEB0KVCcUMo9Zx//4YWmr/ 65Ntukjk3jVI/rwGqXh3eqvEuO7INBpcGK+HpcAkc6DMRucZL7hfQDz2tAfCsh2Y/w+sAfcqArl UKdEBUZcdDlSDoqeFtky+SDAzbz9W3gzIH+qID+se2jx4HpYHnU6sX6smaGezNUXTO5cFSaJZJg +ICMmDoLz7ogaRA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski There's one missing newline according to black so add it. Signed-off-by: Bartosz Golaszewski --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 6fb399dcf195bd01d1fa739de89f142672f3f16e..d89c13454baa8fbe9dab17b7c3fde6fc59b577f1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,6 +54,7 @@ except ImportError: html_theme = "sphinx_rtd_theme" if sphinx_rtd_theme else "default" + # We need to know where to put docs generated by gi-docgen but app.outdir is # only set once the builder is initialized. Let's delay running gi-docgen # until we're notified. From patchwork Wed Jun 4 09:53:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 894581 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8196528C5B4 for ; Wed, 4 Jun 2025 09:54:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749030849; cv=none; b=kBde2BGR6UQD3uEkco5Iy5uMWjkwA7A6t1/7OyNI+0NHSrIGwqU4uHBVislMJjRvitRT1FDlFK+pvV7Yg/9vsgxbUlioRVRyYVMigMpOzdu7MnjPcBWoE0A9uGgN99KiwJgLyPjv4ZytJgmqhY52ok+mIv86mlcPgAPk2oqbc5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749030849; c=relaxed/simple; bh=DRjhWrHQT4lgyqKM0TUzkIauvvSfSwAN+/c7Y/Dehrs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hJlisHB/Yq7DJ7d3aR0If6ArVM090gd63w0iXENuRvkZzdtTF4/mFdKgI5x3sG7rM96q73v+6kjRhY/4ciHF/Ep5GuKyK/F3OlA04fyYmRcQ/OlUTXQQlzGdeQ5aeux0S8lPbPu36PY3Wx5CAyeEkkjZMx2dfs52hFNagGVzNCU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=ZlvJgTOf; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="ZlvJgTOf" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3a4f72cba73so563961f8f.1 for ; Wed, 04 Jun 2025 02:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1749030846; x=1749635646; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XgNGBWUntlzsqlsrqfACQ9ak5SzabU4TyO+KeG66LBY=; b=ZlvJgTOfP0k/uBiqADK/jy4aGgvSZk0366N2RFh0xbaWxqi8p1TvEczWptMFCx72WP EiDv3zb7E9uHqfTJIPmUg7KYl0OX33AG8hkbCuCBfX7TWHW/JEbtNOopUSzuKceofCMz mzWWf6SXTRMHjUb/ifGyiCsdEuKlmkVb725ssdzaunP5Gn/wwGSmCPm8jEnPuMO+gvPP Jm1Gj/WpqiZhenN9NN55R/QEHhfB26aWUkCHoq1pQ8OSHXlsuLG/hGtSYBYv5y+LTDt0 SNHfKkxfgrmiH0rWVX1jjKpfVZraQBClvd8GBU3HUMhPgW9kFfsjVGhpnRtroWjAvz+G tk3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749030846; x=1749635646; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XgNGBWUntlzsqlsrqfACQ9ak5SzabU4TyO+KeG66LBY=; b=wcwI25zc0mCsY4oiauZgSL05FSvV0R49lWIknpZNO0MwNXsw6hNF1sm52x0AnuyuXN +ag2qKkfxJhVxOKR9wu8vbqtR8fv3Co8W3BUqHPnPPBsJ8AUx6+IZmlaDb/jWMPvjYN5 OnlbERVoz0BrYmert0ZoGo3BUJR/i2wAte3lg1L+hByqDbQN4aoR4KFEA3alvjkZH4rU 03B+JKXuUApuD0P9SjtP4w2JnA3A3PMQfdAocmG/IKYd/EH0DGL5FMRInV3x0QMiazrb 078i/FuHP27rLpLKBBrwuIuL5ln62q1bJPurgYeD3jc7aBzhYVk6/G67siB/svJxTsaj 5Mlg== X-Gm-Message-State: AOJu0YxXNiPD6NIXeHWESUh83vtrM2bceK938IAggLiChwLU5RiOnhKW PyG71ptYpjZwbAdu6Eb7702MpmlyfRgkwgBm5zb0piAJG7/COrNVZUEWRWGO/u2ny7I= X-Gm-Gg: ASbGncvAQMhnCGrdagyVGsyi7U9fcMsnZDsd2RkNYWPMEKRdRrEbVtESA3C+ThZG0UL g7PLYZZWBQgY3/wVxUacXmwfVAduInXT7moVpbEcdu26SICuUzRVy/pn9gPsI3RYpYdPhMToi2d y0huiabGgGUed/uSSwFfvCMuGu2iXbx7eWUWry6mDocDkefIJZAfDxntrt+T4ot+PxbPZx5Rhir VWhd893sCZGziXFAQnFY0nvak5bvfdBYMV3Id0ePvGGT+ZjHW2AFXRGanPLIvn0pBwQIEqvOoXp IxBGbwDxYTaKhki+4Q8WIS3j01KSrfcOYVNIM8kWyzYL4W9R+ZSY7yTj X-Google-Smtp-Source: AGHT+IF8cunlmPLHXlWtrV0jDQhPLzgxujIarE8vN3fwiMQU+h6rIJEYGDvVFzklHpQSPgZKPv/kAg== X-Received: by 2002:a05:6000:2204:b0:3a4:e624:4ec9 with SMTP id ffacd0b85a97d-3a51d507a12mr1775046f8f.3.1749030845667; Wed, 04 Jun 2025 02:54:05 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:e8d2:e71d:f170:23e7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f00971e4sm21525640f8f.65.2025.06.04.02.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jun 2025 02:54:05 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 04 Jun 2025 11:53:56 +0200 Subject: [PATCH libgpiod 2/3] doc: improve the readability of the prefix variable Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250604-rust-docs-v1-2-8ff23924a917@linaro.org> References: <20250604-rust-docs-v1-0-8ff23924a917@linaro.org> In-Reply-To: <20250604-rust-docs-v1-0-8ff23924a917@linaro.org> To: Vincent Fazio , Kent Gibson , Linus Walleij , Erik Schilling , Viresh Kumar Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1477; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=77ZEdBx/18Yxsz12amBf5rGcXRRQHt5qzyrxRovOAi0=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBoQBe75hYhR+Ej1eqReK9N+veo3Qq26A9Q0gRxz yyzcD3oG/WJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaEAXuwAKCRARpy6gFHHX cqOvEADTkCjrt0VQEwqC8Km+Ea32HgALa0PLh0Nr7DYhyHmePaBvMerlrS640vDm9rpzE3uxI7n HpvscfXxXKE3w8HBnZVJGamJxbtDe6n3QrSzUjJNkeNaUmwdSn8pfF+d2Fn4lLFzetGWDfE5P2G r5GY9cJCujX14SgtlbILGwY7NzjDB1YSYU+O2poCzEwkUeOJmot97cltXTTlM3dV+aJ1p1HFnDA 0r3O8s0NkiBqBlhiHoq+Ivp8w6Hxai5N9MXxFojNbNsZzZGMDJMaDTRyupK1/z8518Jx9gNXr91 7X9z6aFdi2iTh4UCz+vFVfBSahX7+Smwr/pTh5CF6OelWgKFPOvunqm4B/YPg0+czbK0sehYuEX icYtLwdrSDX5lS9r2T36uvvyhFRx0y1EE3NxOLbqRXqwFYm1+4IAOp8nTe2DGIUb5+WMhaksbym PE266Q+iGOvJ9/kgVsMSOB7tyiFMiUEijQZG7qiFqYU3doRxAUfK+7ufmJ5VLBwwYpjpjY5rwMz Ew7hbZt4T/bz1mnFF8i5nqK6iJI/hUPg5prwn9QtmaS2rU91BCyK1zahXNhEjt4HBfYQ/8xI+Wg nXrDkiitKJHhHlk3iScGui5Za98UeEEegv7iyQ8fvVsbOXP2L+ooYhTZGY9LP34lXR9ZyyPNTmp sjrM6ypxADuhs0A== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Currently the default value for prefix - indicating the current directory - is an empty string. This means that if we do "{prefix}/foo", we may end up pointing to the root directory which is not what we want. Make "./" be the default value so that the example becomes valid and add "/" where we couldn't do it before. Signed-off-by: Bartosz Golaszewski --- docs/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index d89c13454baa8fbe9dab17b7c3fde6fc59b577f1..04d1cea2a2175166555993c3e936e7cf1ebd0fe6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -61,15 +61,15 @@ html_theme = "sphinx_rtd_theme" if sphinx_rtd_theme else "default" def make_glib_docs(app): # For some reason on RTD we're in the docs/ directory while during a local # build, we're still in the top source directory. - prefix = "../" if os.getenv("READTHEDOCS") == "True" else "" + prefix = "../" if os.getenv("READTHEDOCS") == "True" else "./" subprocess.run( [ "gi-docgen", "generate", "--config", - f"{prefix}bindings/glib/gi-docgen.toml", - f"{prefix}bindings/glib/Gpiodglib-1.0.gir", + f"{prefix}/bindings/glib/gi-docgen.toml", + f"{prefix}/bindings/glib/Gpiodglib-1.0.gir", "--output-dir", f"{app.outdir}", ], From patchwork Wed Jun 4 09:53:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 894080 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 792E828C87F for ; Wed, 4 Jun 2025 09:54:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749030850; cv=none; b=uzyYUS0X6XtuOSUuu0wVLxehmR4BbIxUDfwTLdso5aW/0cBa5xa72kDKyVvGEF8ZYvn4IRg07NY8phrTXQG2AmFpGgItsSbsGfkU4h/WU6lDHzG8Yg5R2REaT9qAZVlyMilBUjmCgwN6aypGXLLGQkL9KiW6fg/eAXwRZE9OkkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749030850; c=relaxed/simple; bh=QPmBf/rmYabTeJ+x+CP9CQ0fkWpbA+VdNDiaXuVeh0k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BnhRS5KSzMap7eRMu3p7hIAypdi0yATCWOH/ydvKpmyHcfTx+950t7yCkg6oFNSHT9BUe21J8bQ5vjgL6zf1uPLzpiKIoDR/uyfQDjjKvOj6ln1pL9kG+anGWOKZ4jZTl7Jbd7Avi3jHifq0gCEu0mSH81sMW6JYIypvqvUofpo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=RG0bXh2G; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="RG0bXh2G" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3a374f727dbso5760707f8f.0 for ; Wed, 04 Jun 2025 02:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1749030847; x=1749635647; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ivI4PcXajN57DzYDf/UqWKt6D2FPI4jGGNO7JE5WEbQ=; b=RG0bXh2G5z2O+vdikV4hZS3OaJBHiWpdRdFbPEL4pwkjIj5RkGpaxJ3AJVnkZu5QDH wSn618Ow9EeWZsf2CrUO+GDOcx+HaJQAPjQpqF2MxzR0cequrE6hoxN26J6bwkYbPrx9 oMlqKuDii+cscCXjHwaqptY2B+Fn9R9MYDkWBXbKuZZTXgUI25mSzUlpQT7RXoICsW/Q 8x2xLTTx9K+ksSAOQaXNEW9N+OrktVKD47jnfQPPZZvCcKbzm38RyIlbwMEkw2p1VA+v Z/ATsz5ZyMrpyNZYF+6s5yUzFNu0l9BaZoq8txrkWqgqFi9FOU5ijJMdO7yqrZzIPpJ3 pNDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749030847; x=1749635647; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ivI4PcXajN57DzYDf/UqWKt6D2FPI4jGGNO7JE5WEbQ=; b=oVoAUCV1hRa6jAUHYJZ/WVe/6wh6S8zmbPg5bBeTaxVopsDmTEPs4XSHvhG5TaihwV WRZfdLG0i3xsLYqF4G40y0VyjxmL/afuh9a//bqJUojFmOXUM8q6xbj1XJf5lYUCDb7z OSOwpRanlkkiqwwsDG7bLsTL3B3ZnxQyt63zBMnB8uHdD6Y+n/iAAN4tMjKwH+zQdYUS CJZs1fRhxpr7hXssoB2Potxl1U+6BcXO3zf0PJ8YUn7wnXe6/35mPI3J5DrwqNwdlpDV id3UbkXxtFTzHRyBGPbcGwCwi1heuIi2XTUrEy9rtw69UXAZ11HngJQAjtnfo+fG6Om+ 5RfA== X-Gm-Message-State: AOJu0YymT0nQr0YMp3RJQS6KHVpJuURhlcRYxaHWbPpNz4YR1dVSWz3n 7J5PYav2ulGj5EXAS4KGCM3qq9OBCQTECkqaEw4TsMVgiEk3NgHMka0Yh/sl4+Qd82M= X-Gm-Gg: ASbGncvsUvWrq36tzVqjPbttvR8J+MbjHG2iJIEYJSMc0p6kSHu0uwnrQqS3Z8EYofi lwryzBmqmoqsSEl5ZRa74f6KlGWUN4VxxGOs1eDH0xp1IgGoT+wGlDzr3Ws8VWHT+/rgDXDeocA xizQW4U99IbR3pUxiwne6JR4gr8C0DQwRHZzTXa+Z0/V99VSg2DzKy0y62jH3q1Z6JFfdF/AM3v saqWBHy4KWUoMO3dJCUHzz3rZjry/mW5GYweZIZb1IuYToNi/oPEKWDEnak3MaLmP4R/g+8XfRG H6mgHKTj8aT+gUnYXoEkKTvU1hjUV9yB6kNYq27oF9mcvb9TY/ek2IFi X-Google-Smtp-Source: AGHT+IF7czPSSLPdnm7XXMom2/pVpL5YEgh9LnPAoKDTYPjYRB/hPjaCqlq8Xrnju7kj3YeUUWp7pg== X-Received: by 2002:a05:6000:2507:b0:3a5:1240:6802 with SMTP id ffacd0b85a97d-3a51d97a9d8mr1721530f8f.57.1749030846672; Wed, 04 Jun 2025 02:54:06 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:e8d2:e71d:f170:23e7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f00971e4sm21525640f8f.65.2025.06.04.02.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jun 2025 02:54:06 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 04 Jun 2025 11:53:57 +0200 Subject: [PATCH libgpiod 3/3] doc: integrate rust docs into the sphinx build Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250604-rust-docs-v1-3-8ff23924a917@linaro.org> References: <20250604-rust-docs-v1-0-8ff23924a917@linaro.org> In-Reply-To: <20250604-rust-docs-v1-0-8ff23924a917@linaro.org> To: Vincent Fazio , Kent Gibson , Linus Walleij , Erik Schilling , Viresh Kumar Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4736; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=B5CthQ97xzMMWXpqHGvdfBcc3IUxvBGWzZtxhmDSiwU=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBoQBe7apMTmN6C9saHDe7euvcVvaXd+tsJaW2hM z6lZDiZZPOJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaEAXuwAKCRARpy6gFHHX cr2iD/9OXV4GnvcqwGX9ixBgjPFetTvYH5i82KmPzgpUlB8BQne+vzGkBcUEhES0/OdzcIZvEqX ado++VRv9G22H5txSCgLpywiiGL7RGIS3g4MQnkj5rq5Tiq2VeWDjACYjKED++QC4sFnn/XVpnM dMKBXAv4aQT6TsS6ys4qKGj46ibPPR13E24Va2pwYExUuES7sQ7+02s6bt/EJMYMAnK6HigAoTZ 2ppqsoIAjDFwY7PjDU6Ui4Lc8RbZvLq5RGE2+r3OQUAxJh2e63SEsbKIEEeAD+V/V1xColelznr AxPphvyvvw6L4YJSDJJRa26CLyo680kgTJagOsEl7Rzq/uZ+xFJPyPZc4TOlXfqK+KGOW7SUQJZ OeAeSm4qTKvz9NoU5gfblI+Oq1DC1VJ88cjikinqvCYXg9JF2HPr8xfJnItmjkH0I8AdHU5wHpF Wl0hfqR4VH4yGWI6OfqC8pAInDKzbnZ6IIY1rfFDihY39Gl79mKk+yJh15SzB3yX0e5nhUXSSrG TycGrFiQT+VQsCdvXmjeYfzR4rY8XaMD93hrbESJ51hdtmYnS+UFELJ8CBPnbnGhaug8m5jwtg/ tes5dl+93Cr8B3piVbCtZJCOMTvliCLVDGvJwsjiqpQDH4GSeBxKlEeIMbO/mQpQPNNT+sxddiv PytiOpHks/IU9lw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Follow the pattern we established with GLib bindings: generate a separate set of docs for the rust bindings, make them part of the generated doc bundle and point to the rust index.html from the dedicated sphinx page. Signed-off-by: Bartosz Golaszewski --- .readthedocs.yaml | 3 +++ docs/conf.py | 38 +++++++++++++++++++++++++++++++------- docs/rust_api.rst | 22 ++++++++++++++-------- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 5f4f5ac4954de70e060f1a7b2eafe3a731620c16..d81900c9ad9a60d8530b58e38add3a3a353da718 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,6 +14,7 @@ build: os: ubuntu-24.04 tools: python: "3.12" + rust: "1.86" apt_packages: - autoconf - autoconf-archive @@ -24,6 +25,8 @@ build: - gir1.2-glib-2.0-dev - gobject-introspection - graphviz + # Needed for stdbool.h in rust build + - libclang-dev - libglib2.0-dev-bin - libgudev-1.0-dev - libtool diff --git a/docs/conf.py b/docs/conf.py index 04d1cea2a2175166555993c3e936e7cf1ebd0fe6..8c7bed234c98990f01adaec6ca3d6db2c3171c65 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,15 +54,16 @@ except ImportError: html_theme = "sphinx_rtd_theme" if sphinx_rtd_theme else "default" +# We need to know where to put docs generated by gi-docgen and cargo but +# app.outdir is only set once the builder is initialized. Let's delay running +# gi-docgen until we're notified. +# +# For some reason on RTD we're in the docs/ directory while during a local +# build, we're still in the top source directory. +prefix = "../" if os.getenv("READTHEDOCS") == "True" else "./" + -# We need to know where to put docs generated by gi-docgen but app.outdir is -# only set once the builder is initialized. Let's delay running gi-docgen -# until we're notified. def make_glib_docs(app): - # For some reason on RTD we're in the docs/ directory while during a local - # build, we're still in the top source directory. - prefix = "../" if os.getenv("READTHEDOCS") == "True" else "./" - subprocess.run( [ "gi-docgen", @@ -77,8 +78,31 @@ def make_glib_docs(app): ) +def make_rust_docs(app): + subprocess.run( + [ + "cargo", + "doc", + "--manifest-path", + f"{prefix}/bindings/rust/libgpiod/Cargo.toml", + "--target-dir", + f"{app.outdir}/rust/", + ], + check=True, + env=dict( + os.environ, + LD_LIBRARY_PATH="../../../lib/.libs/", + SYSTEM_DEPS_LIBGPIOD_LIB="gpiod", + SYSTEM_DEPS_LIBGPIOD_NO_PKG_CONFIG="1", + SYSTEM_DEPS_LIBGPIOD_SEARCH_NATIVE="../../../lib/.libs/", + SYSTEM_DEPS_LIBGPIOD_INCLUDE="../../../include/", + ), + ) + + def setup(app): app.connect("builder-inited", make_glib_docs) + app.connect("builder-inited", make_rust_docs) subprocess.run(["doxygen", "Doxyfile"]) diff --git a/docs/rust_api.rst b/docs/rust_api.rst index 1408b5c2457309938e314d1c289b81d583d9cc09..dda20d0baadcf8d97832cd60a60a5d00f99affc9 100644 --- a/docs/rust_api.rst +++ b/docs/rust_api.rst @@ -5,19 +5,25 @@ .. This file is part of libgpiod. -Where are the Rust bindings? -============================= + libgpiod Rust bindings documentation -.. warning:: - There's currently no good way of integrating rust documentation with sphinx. - Rust bindings should be documented on https://docs.rs/ but due to a yet - unsolved build problem, this is currently not the case. Please refer to the - in-source comments for now. +libgpiod Rust bindings API +========================== -Rust bindings are available on https://crates.io/ as the ``libgpiod`` package. +Rust bindings for libgpiod aim to provide a memory-safe interface to the +low-level C API. They are available on https://crates.io/ as the ``libgpiod`` +package. .. note:: When building the Rust bindings along the C library using make, they will be automatically configured to build against the build results of the C library. Building rust bindings requires cargo to be available on the system. + +.. warning:: + The documentation for Rust bindings is generated using ``cargo doc`` and + cannot be easily integrated with sphinx documentation. Please navigate to + a separate section dedicated exclusively to the Rust part of the API. + + +`Navigate to Rust bindings documentation `_