Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'make -n TARGET' is broken #33125

Open
mkoeppe opened this issue Jan 6, 2022 · 12 comments
Open

'make -n TARGET' is broken #33125

mkoeppe opened this issue Jan 6, 2022 · 12 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Jan 6, 2022

make -n sagelib should only print, not run, commands.

Likewise make -q sagelib should not run commands. As this is used in build/make/install with output suppressed, this sometimes leads to sage -b silently doing the rebuild and then reporting "Nothing to do".

Broken for normal packages already in Sage 9.0; broken for script packages by #32759 by using + in build/make/Makefile.in *-*-no-deps rules for script packages.

That + appears there is motivated by intended jobserver behavior; but unfortunately it also influences -n, -q, -t handling.

Depends on #33130

CC: @orlitzky

Component: build

Branch: u/mkoeppe/_make__n_target__is_broken

Issue created by migration from https://trac.sagemath.org/ticket/33125

@mkoeppe mkoeppe added this to the sage-9.5 milestone Jan 6, 2022
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 7, 2022

comment:5

A solution is to do a bit of MAKEFLAGS parsing - see e.g. https://stackoverflow.com/questions/19521438/how-to-access-make-options-in-makefile

@orlitzky
Copy link
Contributor

orlitzky commented Jan 7, 2022

comment:6

Isn't this just because invoking build/make/install interrupts the $MAKE and $MAKEFLAGS magic that normally gets applied to sub-makes?

For example, this fixes make -n sagelib for me:

diff --git a/Makefile b/Makefile
index 444e4f9e4a..9505152830 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,7 @@ sageruntime: base-toolchain
 	@if [ -x relocate-once.py ]; then ./relocate-once.py; fi
 	$(MAKE) build/make/Makefile --stop
 	+build/bin/sage-logger \
-		"cd build/make && ./install '$@'" logs/install.log
+		"cd build/make && MAKE=\"$(MAKE)\" MAKEFLAGS=\"$(MAKEFLAGS)\" ./install '$@'" logs/install.log
 
 # CONFIG_FILES lists all files that appear in AC_CONFIG_FILES in configure.ac;
 # except for build/make/Makefile-auto, which is unused by the build system

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 7, 2022

comment:7

Did you test this on top of #32759?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 7, 2022

comment:8

No, the problem is that we want to pass jobserver flags to something that is not make (and therefore does not handle -n etc.), namely the spkg-install script.

@orlitzky
Copy link
Contributor

orlitzky commented Jan 7, 2022

comment:9

Replying to @mkoeppe:

Did you test this on top of #32759?

No, but the problem with make -n sagelib already exists in beta9.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 8, 2022

comment:10

OK, you are right, there is broader breakage regarding -n etc. that has been around for a long time.

But there's a more specific problem (of blocker quality) caused by #32759. I've opened #33130 for it.

Let's address the broader problem in Sage 9.6.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 8, 2022

Changed dependencies from #32759 to #33130

@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Jan 8, 2022
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 9, 2022

Branch: u/mkoeppe/_make__n_target__is_broken

@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Mar 5, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Aug 31, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.8, sage-9.9 Jan 7, 2023
@mkoeppe mkoeppe removed this from the sage-10.0 milestone Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants