* [PR PATCH] meson: fix build with rust proc-macro
@ 2024-05-09 12:55 Calandracas606
2024-05-10 17:54 ` [PR PATCH] [Merged]: " classabbyamp
0 siblings, 1 reply; 2+ messages in thread
From: Calandracas606 @ 2024-05-09 12:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1499 bytes --]
There is a new pull request by Calandracas606 against master on the void-packages repository
https://github.com/Calandracas606/void-packages meson-rust-proc
https://github.com/void-linux/void-packages/pull/50262
meson: fix build with rust proc-macro
Fixes an issue causing mesa to fail when cross-compiling
https://github.com/mesonbuild/meson/issues/12973
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- x86_64-musl
- i686
- aarch64 (cross)
- aarch64-musl (cross)
- armv7l (cross)
- armv7l-musl (cross)
- armv6l (cross)
- armv6l-musl (cross)
A patch file from https://github.com/void-linux/void-packages/pull/50262.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-meson-rust-proc-50262.patch --]
[-- Type: text/x-diff, Size: 3634 bytes --]
From ca29344ce8609b1ebd3b3a2f1f86f85eded87b8c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 9 May 2024 08:51:47 -0400
Subject: [PATCH] meson: fix build with rust proc-macro
Fixes an issue causing mesa to fail when cross-compiling
https://github.com/mesonbuild/meson/issues/12973
---
srcpkgs/meson/patches/rust-proc-macro.patch | 74 +++++++++++++++++++++
srcpkgs/meson/template | 2 +-
2 files changed, 75 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/meson/patches/rust-proc-macro.patch
diff --git a/srcpkgs/meson/patches/rust-proc-macro.patch b/srcpkgs/meson/patches/rust-proc-macro.patch
new file mode 100644
index 00000000000000..a5fa1b49d50b43
--- /dev/null
+++ b/srcpkgs/meson/patches/rust-proc-macro.patch
@@ -0,0 +1,74 @@
+commit 4f0b3c650baacf02c1ca82b7cce97665dd4fefea
+Author: Daniel Martinez <danielmartinez@cock.li>
+Date: Thu May 9 08:31:57 2024 -0400
+
+ Revert "rust: recursively pull proc-macro dependencies as well"
+
+ This reverts commit aee941559c4b88a062e88186819a820c69c200ae.
+
+diff --git a/mesonbuild/build.py b/mesonbuild/build.py
+index da4c4373d..1d5bf7bd6 100644
+--- a/mesonbuild/build.py
++++ b/mesonbuild/build.py
+@@ -1295,6 +1295,8 @@ class BuildTarget(Target):
+ for t in self.link_targets:
+ if t in result:
+ continue
++ if t.rust_crate_type == 'proc-macro':
++ continue
+ if include_internals or not t.is_internal():
+ result.add(t)
+ if isinstance(t, StaticLibrary):
+diff --git a/test cases/rust/18 proc-macro/lib.rs b/test cases/rust/18 proc-macro/lib.rs
+deleted file mode 100644
+index 5242886cc..000000000
+--- a/test cases/rust/18 proc-macro/lib.rs
++++ /dev/null
+@@ -1,8 +0,0 @@
+-extern crate proc_macro_examples;
+-use proc_macro_examples::make_answer;
+-
+-make_answer!();
+-
+-pub fn func() -> u32 {
+- answer()
+-}
+diff --git a/test cases/rust/18 proc-macro/meson.build b/test cases/rust/18 proc-macro/meson.build
+index e8b28eda1..c5f0dfc82 100644
+--- a/test cases/rust/18 proc-macro/meson.build
++++ b/test cases/rust/18 proc-macro/meson.build
+@@ -31,14 +31,3 @@ main = executable(
+ )
+
+ test('main_test2', main)
+-
+-subdir('subdir')
+-
+-staticlib = static_library('staticlib', 'lib.rs',
+- link_with: pm_in_subdir,
+- rust_dependency_map : {'proc_macro_examples3' : 'proc_macro_examples'}
+-)
+-
+-executable('transitive-proc-macro', 'transitive-proc-macro.rs',
+- link_with: staticlib,
+-)
+diff --git a/test cases/rust/18 proc-macro/subdir/meson.build b/test cases/rust/18 proc-macro/subdir/meson.build
+deleted file mode 100644
+index 04842c431..000000000
+--- a/test cases/rust/18 proc-macro/subdir/meson.build
++++ /dev/null
+@@ -1 +0,0 @@
+-pm_in_subdir = rust.proc_macro('proc_macro_examples3', '../proc.rs')
+diff --git a/test cases/rust/18 proc-macro/transitive-proc-macro.rs b/test cases/rust/18 proc-macro/transitive-proc-macro.rs
+deleted file mode 100644
+index 4c804b3b6..000000000
+--- a/test cases/rust/18 proc-macro/transitive-proc-macro.rs
++++ /dev/null
+@@ -1,7 +0,0 @@
+-extern crate staticlib;
+-use staticlib::func;
+-
+-
+-fn main() {
+- assert_eq!(42, func());
+-}
diff --git a/srcpkgs/meson/template b/srcpkgs/meson/template
index ca1e11187a43d0..82faf4a8371117 100644
--- a/srcpkgs/meson/template
+++ b/srcpkgs/meson/template
@@ -1,7 +1,7 @@
# Template file for 'meson'
pkgname=meson
version=1.4.0
-revision=1
+revision=2
build_style=python3-module
hostmakedepends="python3-devel python3-setuptools"
depends="ninja python3-setuptools"
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PR PATCH] [Merged]: meson: fix build with rust proc-macro
2024-05-09 12:55 [PR PATCH] meson: fix build with rust proc-macro Calandracas606
@ 2024-05-10 17:54 ` classabbyamp
0 siblings, 0 replies; 2+ messages in thread
From: classabbyamp @ 2024-05-10 17:54 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]
There's a merged pull request on the void-packages repository
meson: fix build with rust proc-macro
https://github.com/void-linux/void-packages/pull/50262
Description:
Fixes an issue causing mesa to fail when cross-compiling
https://github.com/mesonbuild/meson/issues/12973
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- x86_64-musl
- i686
- aarch64 (cross)
- aarch64-musl (cross)
- armv7l (cross)
- armv7l-musl (cross)
- armv6l (cross)
- armv6l-musl (cross)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-10 17:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-09 12:55 [PR PATCH] meson: fix build with rust proc-macro Calandracas606
2024-05-10 17:54 ` [PR PATCH] [Merged]: " classabbyamp
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 NNTP newsgroup(s).