Bug 281674 - Mk/bsd.port.mk: Add MACHINE_ARCH to WRK_ENV
Summary: Mk/bsd.port.mk: Add MACHINE_ARCH to WRK_ENV
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tijl Coosemans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-23 20:10 UTC by Tijl Coosemans
Modified: 2024-10-18 08:14 UTC (History)
3 users (show)

See Also:
antoine: exp-run+


Attachments
patch (1.01 KB, patch)
2024-09-23 20:10 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tijl Coosemans freebsd_committer freebsd_triage 2024-09-23 20:10:55 UTC
Created attachment 253787 [details]
patch

make(1) has a built-in variable MACHINE_ARCH that defaults to the value of sysctl hw.machine_arch.  This is not correct when building packages under qemu.  In that case poudriere sets MACHINE_ARCH in its make.conf.  Since ports d7511b9d0074 make.conf is not picked up by make during build so pass MACHINE_ARCH through the environment.

This affects building kmod ports under qemu.

Reported by: jrtc27 (https://reviews.freebsd.org/D46502)
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2024-10-08 17:33:51 UTC
Exp-run seems fine
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-10-11 09:12:38 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3154506a168d8188fe06f252e070b394b6581db3

commit 3154506a168d8188fe06f252e070b394b6581db3
Author:     Tijl Coosemans <tijl@FreeBSD.org>
AuthorDate: 2024-09-07 22:06:27 +0000
Commit:     Tijl Coosemans <tijl@FreeBSD.org>
CommitDate: 2024-10-11 09:04:54 +0000

    Mk/bsd.port.mk: Add MACHINE_ARCH to WRK_ENV

    make(1) has a built-in variable MACHINE_ARCH that defaults to the value
    of sysctl hw.machine_arch.  This is not correct when building packages
    under qemu.  In that case poudriere sets MACHINE_ARCH in its make.conf.
    Since commit d7511b9d0074 make.conf is not picked up by make during
    build so pass MACHINE_ARCH through the environment.

    This affects building kmod ports under qemu.

    This is a workaround for make not looking at UNAME_p when setting
    MACHINE_ARCH.  It does look at UNAME_m when setting MACHINE.

    PR:             281674
    Reported by:    jrtc27
    Exp-run by:     antoine
    Approved by:    portmgr (antoine)

 Mk/bsd.port.mk | 1 +
 1 file changed, 1 insertion(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-10-11 11:48:02 UTC
A commit in branch 2024Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=613a30bc56776e1d6156d15de51e4f827e97118d

commit 613a30bc56776e1d6156d15de51e4f827e97118d
Author:     Tijl Coosemans <tijl@FreeBSD.org>
AuthorDate: 2024-09-07 22:06:27 +0000
Commit:     Tijl Coosemans <tijl@FreeBSD.org>
CommitDate: 2024-10-11 11:45:16 +0000

    Mk/bsd.port.mk: Add MACHINE_ARCH to WRK_ENV

    make(1) has a built-in variable MACHINE_ARCH that defaults to the value
    of sysctl hw.machine_arch.  This is not correct when building packages
    under qemu.  In that case poudriere sets MACHINE_ARCH in its make.conf.
    Since commit d7511b9d0074 make.conf is not picked up by make during
    build so pass MACHINE_ARCH through the environment.

    This affects building kmod ports under qemu.

    This is a workaround for make not looking at UNAME_p when setting
    MACHINE_ARCH.  It does look at UNAME_m when setting MACHINE.

    PR:             281674
    Reported by:    jrtc27
    Exp-run by:     antoine
    Approved by:    portmgr (antoine)

    (cherry picked from commit 3154506a168d8188fe06f252e070b394b6581db3)

 Mk/bsd.port.mk | 1 +
 1 file changed, 1 insertion(+)
Comment 4 Jesse Phelps 2024-10-18 08:14:14 UTC
A commit in branch 2024Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=613a30bc56776e1d6156d15de51e4f827e97118d https://geometry-dashworld.co/

commit 613a30bc56776e1d6156d15de51e4f827e97118d
Author:     Tijl Coosemans <tijl@FreeBSD.org>
AuthorDate: 2024-09-07 22:06:27 +0000
Commit:     Tijl Coosemans <tijl@FreeBSD.org>
CommitDate: 2024-10-11 11:45:16 +0000

    Mk/bsd.port.mk: Add MACHINE_ARCH to WRK_ENV

    make(1) has a built-in variable MACHINE_ARCH that defaults to the value
    of sysctl hw.machine_arch.  This is not correct when building packages
    under qemu.  In that case poudriere sets MACHINE_ARCH in its make.conf.
    Since commit d7511b9d0074 make.conf is not picked up by make during
    build so pass MACHINE_ARCH through the environment.

    This affects building kmod ports under qemu.

    This is a workaround for make not looking at UNAME_p when setting
    MACHINE_ARCH.  It does look at UNAME_m when setting MACHINE.

    PR:             281674
    Reported by:    jrtc27
    Exp-run by:     antoine
    Approved by:    portmgr (antoine)

    (cherry picked from commit 3154506a168d8188fe06f252e070b394b6581db3)

 Mk/bsd.port.mk | 1 +
 1 file changed, 1 insertion(+)

THANK YOU!!!