Bug 272961 - devel/msbuild: Avoid MSBuild error MSB1008
Summary: devel/msbuild: Avoid MSBuild error MSB1008
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-06 00:08 UTC by Marcin Cieślak
Modified: 2023-08-10 10:41 UTC (History)
2 users (show)

See Also:


Attachments
0001-devel-msbuild-Avoid-MSB1008-build-error.patch (3.66 KB, patch)
2023-08-06 00:08 UTC, Marcin Cieślak
no flags Details | Diff
0001-devel-msbuild-Avoid-MSB1008-build-error.patch (4.54 KB, patch)
2023-08-06 20:45 UTC, Marcin Cieślak
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Cieślak 2023-08-06 00:08:06 UTC
It is not clear to me why this happens, but on my 14-CURRENT
machine I do not seem to be able to build MSBuild due to the following
error:

============= MSBuild command =============
/big/ports/usr/ports/devel/msbuild/work/msbuild-0.06/build/../artifacts/mono-msbuild/msbuild "/big/ports/usr/ports/devel/msbuild/work/msbuild-0.06/build/Toolset.proj" /t:restore /m /clp:Summary /warnaserror /v:minimal /bl:"/big/ports/usr/ports/devel/msbuild/work/msbuild-0.06/build/../artifacts/Release-MONO/log/Toolset.binlog"
===========================================
Microsoft (R) Build Engine version 15.8.38.37692 (xplat-master/3c930fa8 Tue May  8 12:36:23 EDT 2018) for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1008: Only one project can be specified.
Switch: /m

This can be fixed by making sure the /m is given the parameter
(number of CPUs to use in parallel).

MSBuild does not seem to parallelize builds currently, but
this fixes the error.
Comment 1 Marcin Cieślak 2023-08-06 00:08:58 UTC
Created attachment 243875 [details]
0001-devel-msbuild-Avoid-MSB1008-build-error.patch

Patch to pass the /m:${MAKE_JOBS_NUMBER} parameter
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2023-08-06 00:18:44 UTC
Thank you for your submission.
Would you be interested in taking up maintainership of this port?  It is quite a bit out of date and could benefit from some attention.

As for your patch, please do not use REINPLACE_CMD for static replacements as per Porter's Handbook.  I recommend having a patch file that adds something like

    /m:%%MAKE_JOBS_NUMBER%%

and to then just have

    ${REINPLACE_CMD} -e s/%%MAKE_JOBS_NUMBER%%/${MAKE_JOBS_NUMBER} ${WRKSRC}/build/build.sh

I also recommend doing this dynamic replacement in pre-configure so it's easy to run "make makepatch" after "make patch" (but not "make configure") to regenerate the patches.
Comment 3 Marcin Cieślak 2023-08-06 00:33:49 UTC
I am not sure I am competent enough to maintain such a port. Sadly, mono@FreeBSD.org seems to be dead.

For example, I do not fully understand why I seem to be the only one getting this error. Can you or anyone try to reproduce it on their own? (just try to "make" the port currently in the tree). I don't even know who to check build status on the port building cluster.

Thank you for having a look at it so fast, I'll apply your suggestions.
Comment 4 Marcin Cieślak 2023-08-06 20:45:01 UTC
Created attachment 243910 [details]
0001-devel-msbuild-Avoid-MSB1008-build-error.patch

Updated patch with %%MAKE_JOBS_NUMBER%%
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-08-09 13:05:40 UTC
A commit in branch main references this bug:

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

commit fed755e222a5c6fba13458265e0c0378de139046
Author:     Marcin Cieślak <saper@saper.info>
AuthorDate: 2023-08-05 23:55:13 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-08-09 13:01:14 +0000

    devel/msbuild: Avoid MSB1008 build error

    The following error:

    ============= MSBuild command =============
    /big/ports/usr/ports/devel/msbuild/work/msbuild-0.06/build/../artifacts/mono-msbuild/msbuild "/big/ports/usr/ports/devel/msbuild/work/msbuild-0.06/build/Toolset.proj" /t:restore /m /clp:Summary /warnaserror /v:minimal /bl:"/big/ports/usr/ports/devel/msbuild/work/msbuild-0.06/build/../artifacts/Release-MONO/log/Toolset.binlog"
    ===========================================
    Microsoft (R) Build Engine version 15.8.38.37692 (xplat-master/3c930fa8 Tue May  8 12:36:23 EDT 2018) for Mono
    Copyright (C) Microsoft Corporation. All rights reserved.

    MSBUILD : error MSB1008: Only one project can be specified.
    Switch: /m

    can be fixed by making sure the /m is given the parameter
    (number of CPUs to use in parallel).

    MSBuild does not seem to parallelize builds currently, but
    this fixes the error.

    PR:             272961
    Approved by:    portmgr (build fix blanket)

 devel/msbuild/Makefile (mode +x)                    |  9 +++++++--
 devel/msbuild/files/patch-Directory.Build.rsp (new) |  6 ++++++
 devel/msbuild/files/patch-build_build.sh            | 13 +++++++++++--
 3 files changed, 24 insertions(+), 4 deletions(-)
Comment 6 Robert Clausecker freebsd_committer freebsd_triage 2023-08-09 13:16:18 UTC
Thank you for your contribution.
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-08-10 10:41:41 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1e14213dcfa204b7b1fb26a3774a8b8574ac4960

commit 1e14213dcfa204b7b1fb26a3774a8b8574ac4960
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-08-10 10:03:09 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-08-10 10:39:09 +0000

    devel/msbuild: drop executable bit after fed755e222a5

    PR:             272961

 devel/msbuild/Makefile (mode -x) | 0
 1 file changed, 0 insertions(+), 0 deletions(-)