Bug 226695 - Malformed conditional error while configuring www/firefox in poudriere
Summary: Malformed conditional error while configuring www/firefox in poudriere
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.2-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-18 14:08 UTC by serpent7776
Modified: 2022-06-22 07:56 UTC (History)
1 user (show)

See Also:
jbeich: maintainer-feedback+


Attachments
make -d d config in /usr/ports (23.95 KB, text/plain)
2018-03-18 14:08 UTC, serpent7776
no flags Details
make -d d config in poudriere ports (16.33 KB, text/plain)
2018-03-18 14:09 UTC, serpent7776
no flags Details
`truss make -C config` output when bmake is not installed (29.82 KB, text/plain)
2018-11-01 15:51 UTC, serpent7776
no flags Details
`truss make -C config` output when bmake is installed (36.64 KB, text/plain)
2018-11-01 15:52 UTC, serpent7776
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description serpent7776 2018-03-18 14:08:43 UTC
Created attachment 191597 [details]
make -d d config in /usr/ports

When I try to configure www/firefox in poudriere I get

make: "/usr/local/poudriere/ports/local/Mk/bsd.gecko.mk" line 392: Malformed conditional (${MOZILLA_VER:R:R} >= 56 && (${ARCH:Maarch64} || ${MACHINE_CPU:Msse2}))
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/local/poudriere/ports/local/www/firefox

This error doesn't occur when doing `make config` directly in /usr/ports

Here's my investigation:
- MACHINE_CPU is empty
- MACHINE_CPU is set inside bsd.cpu.mk based on MACHINE_CPUARCH
- MACHINE_CPUARCH is empty
- `make -C /usr/local/poudriere/ports/local/www/firefox config` does not include bsd.cpu.mk
- `make -C /usr/ports/www/firefox config` does include bsd.cpu.mk
- poudriere config loads *.mk from `/usr/local/share/mk` instead of `/usr/share/mk` (I have bmake installed)

I attach logs from executing make -d d config locally and in poudriere
Comment 1 serpent7776 2018-03-18 14:09:44 UTC
Created attachment 191598 [details]
make -d d config in poudriere ports
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2018-03-18 20:36:07 UTC
Which ARCH and which OSVERSION ?
Comment 3 serpent7776 2018-03-18 21:58:21 UTC
OSVERSION: 1101001
ARCH: amd64
for both local system and poudriere jail
Comment 4 serpent7776 2018-06-18 19:44:09 UTC
Is there any progress in solving this issue?
Comment 5 Jan Beich freebsd_committer freebsd_triage 2018-06-19 00:29:49 UTC
(In reply to serpent7776 from comment #0)
> - MACHINE_CPUARCH is empty
[...]
> - poudriere config loads *.mk from `/usr/local/share/mk` instead of `/usr/share/mk` (I have bmake installed)

I can't reproduce. Handing over to poudriere maintainer to investigate.
Comment 6 Bryan Drewery freebsd_committer freebsd_triage 2018-06-19 15:41:34 UTC
Please clarify what 'make config in poudriere' means?
Are you talking about 'poudriere options', or 'poudriere testport -i', or 'poudriere jail -s' and jexecing into the jail first?

Does your host have a /usr/bin/bmake? Is that a copy of the port version from /usr/local/bin/bmake? That may cause the problem.
Comment 7 serpent7776 2018-06-19 17:40:20 UTC
by `make -d d config` in poudriere I mean `poudriere jail -s` and then jexecing into the jail.

I have no /usr/bin/bmake on my system.
I had /usr/local/bin/bmake instaled from 'devel/bmake' port and this casused this error - when I deleted bmake port everything worked as should.
Comment 8 Bryan Drewery freebsd_committer freebsd_triage 2018-06-19 18:34:51 UTC
(In reply to serpent7776 from comment #7)
> by `make -d d config` in poudriere I mean `poudriere jail -s` and then
> jexecing into the jail.
> 
> I have no /usr/bin/bmake on my system.
> I had /usr/local/bin/bmake instaled from 'devel/bmake' port and this casused
> this error - when I deleted bmake port everything worked as should.

Try 'which make'...

The only way this happens for me is if I run 'bmake'.

# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
# which make
/usr/bin/make
# which bmake
/usr/local/bin/bmake

Either way this is not a firefox nor a poudriere problem. You're installing
packages and doing things in a poudriere jail that are outside of the intended
use. You likely have a modified PATH or alias or symlink.
Comment 9 serpent7776 2018-06-21 19:06:46 UTC
`which make` tells /usr/bin/make as expected.

I don't think anything I did was outside of the intended use: all I did was:
- install bmake (on the host)
- run poudriere options www/firefox

And that failed, because incorrect file being loaded. jexecing into jail was only to try to investigate the issue. Have also not found anything in PATH or an alias that could cause this.
Anyway I will try to investigate this further.
Comment 10 serpent7776 2018-07-24 18:07:49 UTC
I can reproduce this error on clean virtualbox images for 11.1-RELEASE and 11.2-RELEASE

steps to reproduce:

- bootstrap pkg
- `pkg install poudriere`
- `poudriere ports -c`
- `poudriere jail -c -j test -v 11.1-RELEASE` for 11.1-RELEASE image
  `poudriere jail -c -j test -v 11.2-RELEASE` for 11.2-RELEASE image
- `poudriere options www/firefox` - this works fine - shows firefox options
- Ctrl-C to cancel options
- `pkg install bmake`
- `poudriere options www/firefox` - this fails
Comment 11 serpent7776 2018-10-23 19:56:38 UTC
I can reproduce this issue outside of poudriere jail on 11.2-RELEASE:

- install bmake package
- `ln -s /usr/ports /usr/local/ports`
- `make -C /usr/local/ports/www/firefox config`

make: "/usr/ports/Mk/bsd.gecko.mk" line 405: Malformed conditional (${MOZILLA_VER:R:R} >= 56 && (${ARCH:Maarch64} || ${MACHINE_CPU:Msse2}))
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/local/ports/www/firefox

This error does not occur when calling
`make -C /usr/ports/www/firefox config`

I assumme this is a `/usr/bin/make` issue - for some reason when executing Makefile that lives under `/usr/local` bmake's `*.mk` files are sourced instead of `*.mk` from `/usr/share/mk`.
Comment 12 serpent7776 2018-11-01 15:51:38 UTC
Created attachment 198861 [details]
`truss  make -C config` output when bmake is not installed
Comment 13 serpent7776 2018-11-01 15:52:20 UTC
Created attachment 198862 [details]
`truss  make -C config` output when bmake is installed
Comment 14 serpent7776 2018-11-01 16:04:46 UTC
I've found cause of this behaviour comparing `truss make -C /usr/local/ports/www/firefox config` output.
When `make` searches for `sys.mk` file, it starts in current directory and tries in parents if failed. So it searches for sys.mk in the following directories:

/usr/local/ports/www/firefox/share/mk
/usr/local/ports/www/share/mk
/usr/local/ports/share/mk
/usr/local/share/mk
/usr/share/mk

If bmake is not installed `sys.mk` exists only in `/usr/share/mk` so it gets loaded and everuthing is ok.
If bmake is installed however `/usr/local/share/mk` contains bmake's sys.mk and this gets loaded instead of `/usr/share/mk/sys.mk`.

So is this searching for `sys.mk` is required at all?