Skip to contentSkip to conversation

Remove errors building drivers/DRIVERNAME

PATCH In review Leonardo Brás 6 participants 23 messages Sep 28, 2018 – Oct 10, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v3 cover Remove errors building drivers/DRIVERNAME

Special thanks for the feedback from:
- Finn Thain (I fixed the build problem)
- Geert Uytterhoeven (The cross compilers were very useful)
- Rolf Eike Beer (Was unintentional, thanks for the help!)

This Patchset changes some driver's Makefile to allow them building using the command 'make drivers/DRIVERNAME', if compatible.

The changed drivers would return error if the above command was run on them, after an x86 allyesconfig.

The main reason of this patchset is to allow building lists of drivers looking for warnings and errors to be fixed.

I see this change as a new feature, not a bugfix. I understand the default bahavior may be building with a simple 'make', but I believe adding this new possibility will not be harmful.

My main objective is to allow developers with low processing power to do changes in the kernel and look bugs using free services like GiltabCI, before submitting to community.

If there is any interest helping/using this, I have a prototype in:
https://gitlab.com/LeoBras/linux-next

Leonardo Brás (7):
drivers: dio: Avoids building driver if CONFIG_DIO is disabled
drivers: nubus: Avoids building driver if CONFIG_NUBUS is disabled
drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled
drivers: zorro: Avoids building proc.o if CONFIG_ZORRO is disabled
drivers: s390: Avoids building drivers if ARCH is not s390.
drivers: oprofile: Avoids building driver from direct make command
drivers: hwtracing: Adds Makefile to enable building from directory.

 drivers/Makefile           | 4 +---
 drivers/dio/Makefile       | 2 +-
 drivers/hwtracing/Makefile | 3 +++
 drivers/nubus/Makefile     | 5 +++--
 drivers/oprofile/Makefile  | 1 +
 drivers/parisc/Makefile    | 2 +-
 drivers/s390/Makefile      | 8 ++++----
 drivers/zorro/Makefile     | 7 ++++---
 8 files changed, 18 insertions(+), 14 deletions(-)
 create mode 100644 drivers/hwtracing/Makefile
 create mode 100644 drivers/oprofile/Makefile
Signature · 1 line
2.19.0
#1 lore raw

PATCH v3 1/7 drivers: dio: Avoids building driver if CONFIG_DIO is disabled

Avoids building driver if 'make drivers/dio/' is called and CONFIG_DIO is disabled.

---
 drivers/dio/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dio/Makefile +1 -1
index ae92d17083f2..8fc80e805b90 100644
@@ -2,4 +2,4 @@
 # Makefile for the linux kernel.
 #
 
-obj-y := dio.o dio-driver.o dio-sysfs.o
+obj-$(CONFIG_DIO) := dio.o dio-driver.o dio-sysfs.o
Signature · 1 line
2.19.0
#2 lore raw

PATCH v3 2/7 drivers: nubus: Avoids building driver if CONFIG_NUBUS is disabled

In reply to Leonardo Brás

Avoids building driver if 'make drivers/nubus/' is called and CONFIG_NUBUS is disabled.
Avoids building proc.o if CONFIG_PROC_FS is enabled but CONFIG_NUBUS is disabled.

---
 drivers/nubus/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nubus/Makefile +3 -2
index 6d063cde39d1..1daa51217e95 100644
@@ -2,6 +2,7 @@
 # Makefile for the nubus specific drivers.
 #
 
-obj-y := nubus.o bus.o
+obj-$(CONFIG_NUBUS) := nubus_all.o
+nubus_all-y += bus.o nubus.o
 
-obj-$(CONFIG_PROC_FS) += proc.o
+nubus_all-$(CONFIG_PROC_FS) += proc.o
Signature · 1 line
2.19.0
#3 lore raw

PATCH v3 3/7 drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

In reply to Leonardo Brás

Avoids building driver if 'make drivers/parisc/' is called and CONFIG_PARISC is disabled.

---
 drivers/parisc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/Makefile +1 -1
index 3cd5e6cb8478..80049d763aa0 100644
@@ -24,5 +24,5 @@ obj-$(CONFIG_EISA)		+= eisa.o eisa_enumerator.o eisa_eeprom.o
 obj-$(CONFIG_SUPERIO)		+= superio.o
 obj-$(CONFIG_CHASSIS_LCD_LED)	+= led.o
 obj-$(CONFIG_PDC_STABLE)	+= pdc_stable.o
-obj-y				+= power.o
+obj-$(CONFIG_PARISC)		+= power.o
 
Signature · 1 line
2.19.0
#11 lore raw

PATCH v3 4/7 drivers: zorro: Avoids building proc.o if CONFIG_ZORRO is disabled

In reply to Leonardo Brás

Avoids building proc.o if 'make drivers/zorro/' is called and CONFIG_ZORRO is disabled, even if CONFIG_PROC_FS is enabled.

---
 drivers/zorro/Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/zorro/Makefile +4 -3
index b360ac4ea846..d580f9f08e0a 100644
@@ -3,9 +3,10 @@
 # Makefile for the Zorro bus specific drivers.
 #
 
-obj-$(CONFIG_ZORRO)	+= zorro.o zorro-driver.o zorro-sysfs.o
-obj-$(CONFIG_PROC_FS)	+= proc.o
-obj-$(CONFIG_ZORRO_NAMES) +=  names.o
+obj-$(CONFIG_ZORRO) 		:= zorro_all.o
+zorro_all-y			+= zorro.o zorro-driver.o zorro-sysfs.o
+zorro_all-$(CONFIG_ZORRO_NAMES) += names.o
+zorro_all-$(CONFIG_PROC_FS)	+= proc.o
 
 hostprogs-y 		:= gen-devlist
 
Signature · 1 line
2.19.0
#12 lore raw

PATCH v3 5/7 drivers: s390: Avoids building drivers if ARCH is not s390.

In reply to Leonardo Brás

Avoids building s390 drivers if 'make drivers/s390/' is called but ARCH is not s390.

---
 drivers/s390/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/s390/Makefile +4 -4
index a863b0462b43..0575f02dba45 100644
@@ -3,7 +3,7 @@
 # Makefile for the S/390 specific device drivers
 #
 
-obj-y += cio/ block/ char/ crypto/ net/ scsi/ virtio/
-
-drivers-y += drivers/s390/built-in.a
-
+ifeq ($(ARCH),s390)
+	obj-y += cio/ block/ char/ crypto/ net/ scsi/ virtio/
+	drivers-y += drivers/s390/built-in.a
+endif
Signature · 1 line
2.19.0
#15 lore raw

PATCH v3 6/7 drivers: oprofile: Avoids building driver from direct make command

In reply to Leonardo Brás

Creates new Makefile to avoid building driver if
'make drivers/oprofile/' is called directly.

This driver is usually built from arch/$ARCH and seems to have no meaning building alone.

---
 drivers/oprofile/Makefile | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 drivers/oprofile/Makefile
drivers/oprofile/Makefile new file +1 -0
new file mode 100644
index 000000000000..361867ec2338
@@ -0,0 +1 @@
+#Does nothing, since the source is called from arch/$ARCH/ tree.
Signature · 1 line
2.19.0
#16 lore raw

PATCH v3 7/7 drivers: hwtracing: Adds Makefile to enable building from directory.

In reply to Leonardo Brás

Adds Makefile to enable building the driver using
'make drivers/hwtracing/'.
Changes drivers/Makefile to call the new Makefile directly. It enables user building this driver without building the whole drivers/ subtree.

---
 drivers/Makefile           | 4 +---
 drivers/hwtracing/Makefile | 3 +++
 2 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 drivers/hwtracing/Makefile
drivers/Makefile +1 -3
index 578f469f72fb..a237be6b602f 100644
@@ -174,9 +174,7 @@ obj-$(CONFIG_MCB)		+= mcb/
 obj-$(CONFIG_PERF_EVENTS)	+= perf/
 obj-$(CONFIG_RAS)		+= ras/
 obj-$(CONFIG_THUNDERBOLT)	+= thunderbolt/
-obj-$(CONFIG_CORESIGHT)		+= hwtracing/coresight/
-obj-y				+= hwtracing/intel_th/
-obj-$(CONFIG_STM)		+= hwtracing/stm/
+obj-y				+= hwtracing/
 obj-$(CONFIG_ANDROID)		+= android/
 obj-$(CONFIG_NVMEM)		+= nvmem/
 obj-$(CONFIG_FPGA)		+= fpga/
drivers/hwtracing/Makefile new file +3 -0
new file mode 100644
index 000000000000..fe5773caec49
@@ -0,0 +1,3 @@
+obj-$(CONFIG_CORESIGHT)		+= coresight/
+obj-y				+= intel_th/
+obj-$(CONFIG_STM)		+= stm/
Signature · 1 line
2.19.0
maintainer
#4 lore raw

Re: [PATCH v3 3/7] drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

In reply to Leonardo Brás
Quoted 2 lines · Leonardo Brás

Avoids building driver if 'make drivers/parisc/' is called and CONFIG_PARISC is disabled.

Is that really a problem? The drivers/Makefile has this:

obj-$(CONFIG_PARISC) += parisc/
And you just overrode that by forcing the build. It's not even clear we should refuse the build in that case; how would we know you don't have a legitimate reason for the override?

Quoted 13 lines

---
 drivers/parisc/Makefile | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/Makefile +0 -0
index 3cd5e6cb8478..80049d763aa0 100644
@@ -24,5 +24,5 @@ obj-$(CONFIG_EISA)		+= eisa.o

eisa_enumerator.o eisa_eeprom.o
 obj-$(CONFIG_SUPERIO) += superio.o
 obj-$(CONFIG_CHASSIS_LCD_LED) += led.o
 obj-$(CONFIG_PDC_STABLE) += pdc_stable.o

drivers/parisc/Makefile obj-$(CONFIG_EISA) += eisa.o eisa_enumerator.o eisa_eeprom.o · line 27

Quoted 2 lines
drivers/parisc/Makefile +1 -1
-obj-y				+= power.o
+obj-$(CONFIG_PARISC)		+= power.o

If we conclude the use case is legitimate, that's not enough: the two inner symbols are PARISC only but CONFIG_EISA isn't.

James

#17 lore raw
In reply to Leonardo Brás
Quoted 5 lines · Leonardo Brás

This Patchset changes some driver's Makefile to allow them building using the command 'make drivers/DRIVERNAME', if compatible.

The changed drivers would return error if the above command was run on them, after an x86 allyesconfig.

I don't see what you are trying to achieve here. Why shouldn't the command fail if it is not the intended way to call it? There are a couple of use cases where drivers/ is used to share common code over different archs and it is not always the intention to build them in drivers/ directly.

Quoted 3 lines

The main reason of this patchset is to allow building lists of drivers looking for warnings and errors to be fixed.

If a list is the intention here, aren't there other ways to create it other than using drivers/*?

-Robert

Quoted 11 lines

I see this change as a new feature, not a bugfix. I understand the default bahavior may be building with a simple 'make', but I believe adding this new possibility will not be harmful.

My main objective is to allow developers with low processing power to do changes in the kernel and look bugs using free services like GiltabCI, before submitting to community.

If there is any interest helping/using this, I have a prototype in:
https://gitlab.com/LeoBras/linux-next

#13 lore raw

Re: [PATCH v3 5/7] drivers: s390: Avoids building drivers if ARCH is not s390.

In reply to Leonardo Brás
Quoted 14 lines · Leonardo Brás

Avoids building s390 drivers if 'make drivers/s390/' is called but ARCH is not s390.

---
 drivers/s390/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/s390/Makefile +0 -0
index a863b0462b43..0575f02dba45 100644
@@ -3,7 +3,7 @@
 # Makefile for the S/390 specific device drivers

drivers/s390/Makefile line 9

Quoted 10 lines
drivers/s390/Makefile +4 -4
 #
 
-obj-y += cio/ block/ char/ crypto/ net/ scsi/ virtio/
-
-drivers-y += drivers/s390/built-in.a
-
+ifeq ($(ARCH),s390)
+	obj-y += cio/ block/ char/ crypto/ net/ scsi/ virtio/
+	drivers-y += drivers/s390/built-in.a
+endif

And then somebody wants to build with e.g. "make drivers/s390/cio/" and it still doesn't work. So _if_ this should be supported then it should work with all directory levels and all configuration options. Otherwise this is going to be a never ending story.

#18 lore raw
In reply to Robert Richter
Quoted 5 lines · Robert Richter
Quoted 3 lines · On 27.09.18 23:08:09, Leonardo Br=C3=A1s wrote:

This Patchset changes some driver's Makefile to allow them building using the command 'make drivers/DRIVERNAME', if compatible.

Quoted 8 lines
Quoted 2 lines

The changed drivers would return error if the above command was run on them, after an x86 allyesconfig.

I don't see what you are trying to achieve here. Why shouldn't the command fail if it is not the intended way to call it? There are a couple of use cases where drivers/ is used to share common code over different archs and it is not always the intention to build them in drivers/ directly.

Sorry, I was not very clear at my reasons why this change is important, I will try to briefly explain the whole story.

Some weeks ago I was trying to solve a task that needed to change some compiling options, build the whole kernel (allyesconfig) and look for error= s.
The problem was: It would take a long time to build everything in my comput= er.
And many friends with slimmer laptops would take much longer.

So, I was looking for a service that could do that for me, in the cloud. I found out Gitlab.com offers free 50k minutes of CI for open source projec= ts,
and allows anyone get this CI time by only forking my project, adding their changes and pushing to Gitlab.

But Gitlab don't allow 'jobs' to take longer than 3 hours, after that the '= job'
is killed.

The kernel could not be built in 3h, not with allyesconfig. So, I created a 'job' for each directory in Linux kernel, and tried to build them separatel= y.
All went fine, except for drivers/, which took over 3 hours.

Most logical thing was to continue the division and create five 'jobs' that could divide the building time of drivers. To do that, each job took care o= f a
range of starting letters, as you can see in this link:
https://gitlab.com/LeoBras/linux-next/blob/build-ci/.gitlab-ci.yml

But then I found out some drivers were failing to build. Even if they were = not
enabled in my .config. After some work I found out some drivers selection i= s
done in drivers/Makefile, and incompatible drivers would break my build if tried to call them directly on drivers/DRIVERNAME.

This patchset intents to let the .config selection happen also in drivers/DRIVERNAME/Makefile, avoiding accidentally building drivers that are not in .config.

This would allow the kernel to be build on Gitlab CI, and would benefit man= y
people who wants to help in the kernel development, but have not much processing power in their machines.

I understand my changes may have mistakes, and I am trying to fix them all. I thank you any suggestion to make the code better.

Also, I would be happy to know of any other solution to remote build my cha= nges
and look for warnkings / errors.

Thank you for reading,
Leonardo Bras

#19 lore raw
Quoted 10 lines · Leonardo Bras

Sorry, I was not very clear at my reasons why this change is important, I will try to briefly explain the whole story.

Some weeks ago I was trying to solve a task that needed to change some compiling options, build the whole kernel (allyesconfig) and look for errors. The problem was: It would take a long time to build everything in my computer. And many friends with slimmer laptops would take much longer.

It seems to me that you shouldn't need expensive optimization for continuous integration. In theory that could make a big difference though I admit to no experience of build farms.

Have you looked at ccache? It will save you from having to recompile any files not changed.

You could also leverage all of your laptops together using distcc.

HTH.

#5 lore raw

Re: [PATCH v3 3/7] drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

In reply to James Bottomley
Quoted 5 lines · James Bottomley
Quoted 2 lines · On Thu, 2018-09-27 at 23:08 -0300, Leonardo Br=C3=A1s wrote:

Avoids building driver if 'make drivers/parisc/' is called and CONFIG_PARISC is disabled.

Quoted 7 lines

Is that really a problem? The drivers/Makefile has this:

obj-$(CONFIG_PARISC) +=3D parisc/
And you just overrode that by forcing the build. It's not even clear we should refuse the build in that case; how would we know you don't have a legitimate reason for the override?

Sorry I did not explained my reasons earlier. I sent everybody involved an e-mail explaining the full reason of this change.
(For reference it's here: https://lkml.org/lkml/2018/10/3/707)

Quoted 5 lines
Quoted 4 lines
---
 drivers/parisc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

drivers/parisc/Makefile

Quoted 11 lines
drivers/parisc/Makefile +0 -0
index 3cd5e6cb8478..80049d763aa0 100644
@@ -24,5 +24,5 @@ obj-$(CONFIG_EISA)          +=3D eisa.o

eisa_enumerator.o eisa_eeprom.o
obj-$(CONFIG_SUPERIO) +=3D superio.o
obj-$(CONFIG_CHASSIS_LCD_LED) +=3D led.o
obj-$(CONFIG_PDC_STABLE) +=3D pdc_stable.o

drivers/parisc/Makefile +1 -1
-obj-y                                +=3D power.o
+obj-$(CONFIG_PARISC)         +=3D power.o

If we conclude the use case is legitimate, that's not enough: the two inner symbols are PARISC only but CONFIG_EISA isn't.

You are right.
It worked for my needs because I am only building the drivers, and not linking them. But i believe doing something like I did in zorro/Makefile would fix this all. (For reference, https://lkml.org/lkml/2018/9/28/150 )

If you agree, I will send the next patchset with this change.

Thanks for your help!

Leonardo Bras

#14 lore raw

Re: [PATCH v3 5/7] drivers: s390: Avoids building drivers if ARCH is not s390.

In reply to Heiko Carstens

On Mon, Oct 1, 2018 at 9:46 AM Heiko Carstens <[email protected]> w= rote:

Quoted 18 lines · On Thu, Sep 27, 2018 at 11:08:14PM -0300, Leonardo Br=C3=A1s wrote:
Quoted 16 lines

Avoids building s390 drivers if 'make drivers/s390/' is called but ARCH is not s390.

---
 drivers/s390/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/s390/Makefile +0 -0
index a863b0462b43..0575f02dba45 100644
@@ -3,7 +3,7 @@
 # Makefile for the S/390 specific device drivers
 #
 
Quoted 10 lines

drivers/s390/Makefile line 9

Quoted 8 lines
drivers/s390/Makefile +4 -4
-obj-y +=3D cio/ block/ char/ crypto/ net/ scsi/ virtio/
-
-drivers-y +=3D drivers/s390/built-in.a
-
+ifeq ($(ARCH),s390)
+     obj-y +=3D cio/ block/ char/ crypto/ net/ scsi/ virtio/
+     drivers-y +=3D drivers/s390/built-in.a
+endif

And then somebody wants to build with e.g. "make drivers/s390/cio/" and i=

t

Quoted 2 lines

still doesn't work. So _if_ this should be supported then it should work with all directory levels and all configuration options. Otherwise this i=

s

Quoted 2 lines

going to be a never ending story.

It makes sense.
I proposed this change to help me solving a problem described here
(https://lkml.org/lkml/2018/10/3/707), and for this it was enough if it did= n't
build when "make drivers/s390/" was called.

Sorry I didn't send the e-mail with the reason earlier.

For solving my problem it was not necessary, but if you think it's interest= ing,
I could refactor all drivers/s390 Makefiles to make them all build only if we are dealing with the s390 architecture.

What do you think?

Thanks for the reply,

Leonardo Bras

#20 lore raw
In reply to Finn Thain
Quoted 18 lines · Finn Thain
Quoted 10 lines · Leonardo Bras

Sorry, I was not very clear at my reasons why this change is important, I will try to briefly explain the whole story.

Some weeks ago I was trying to solve a task that needed to change some compiling options, build the whole kernel (allyesconfig) and look for errors. The problem was: It would take a long time to build everything in my computer. And many friends with slimmer laptops would take much longer.

It seems to me that you shouldn't need expensive optimization for continuous integration. In theory that could make a big difference though I admit to no experience of build farms.

Quoted 8 lines

Have you looked at ccache? It will save you from having to recompile any files not changed.

You could also leverage all of your laptops together using distcc.

HTH.

--

Both ccache and distcc seem very interesting,
I will take my time to study them better as they can solve some situations I face. Thanks for sharing!

Still, I believe my patchset is relevant, as it would enable people to rebuild the whole kernel (with build flags changes, for example) at the cost of only git-pushing the changes to a fork of my Gitlab repo, and waiting 3 hours.

Thanks for helping!

#21 lore raw
Quoted 4 lines · Leonardo Bras

Both ccache and distcc seem very interesting, I will take my time to study them better as they can solve some situations I face. Thanks for sharing!

You might also want to check out 'gcc -O0', 'gcc -fopt-info' and 'gcc --help=optimizers' etc to see if you can reduce the compute cost.

To reduce IO cost, my build tests always use 'make O=/some/path' where /some/path is on a tmpfs mountpoint.

HTH.

maintainer
#6 lore raw

Re: [PATCH v3 3/7] drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

In reply to Leonardo Bras
Quoted 15 lines · Leonardo Bras
Quoted 5 lines · James Bottomley
Quoted 2 lines · Leonardo Brás

Avoids building driver if 'make drivers/parisc/' is called and CONFIG_PARISC is disabled.

Quoted 7 lines

Is that really a problem? The drivers/Makefile has this:

obj-$(CONFIG_PARISC)            += parisc/
And you just overrode that by forcing the build.  It's not even clear we should refuse the build in that case; how would we know you don't have a legitimate reason for the override?

Quoted 3 lines

Sorry I did not explained my reasons earlier. I sent everybody involved an e-mail explaining the full reason of this change. (For reference it's here: https://lkml.org/lkml/2018/10/3/707)

Well it's not really that persuasive. Most people simply let the build run to completion, but if you have a problem with a job control 3h timelimit, then create a job that kills itself at 2:59 and then resubmits itself. That will produce a complete build in 3h chunks without any need to call sub Makefiles.

All of our Makefiles are coded assuming the upper level can prevent descent into the lower ones. You're proposing to change that assumption, requiring a fairly large patch set, which doesn't really seem to provide a huge benefit.

James

Quoted 33 lines
Quoted 5 lines
Quoted 4 lines

---
 drivers/parisc/Makefile | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

drivers/parisc/Makefile obj-$(CONFIG_EISA) += eisa.o eisa_enumerator.o eisa_eeprom.o · line 27

Quoted 11 lines
drivers/parisc/Makefile +0 -0
index 3cd5e6cb8478..80049d763aa0 100644
@@ -24,5 +24,5 @@ obj-$(CONFIG_EISA)          += eisa.o

eisa_enumerator.o eisa_eeprom.o obj-$(CONFIG_SUPERIO)                += superio.o obj-$(CONFIG_CHASSIS_LCD_LED)        += led.o obj-$(CONFIG_PDC_STABLE)     += pdc_stable.o

drivers/parisc/Makefile +1 -1
-obj-y                                += power.o
+obj-$(CONFIG_PARISC)         += power.o

If we conclude the use case is legitimate, that's not enough: the two
inner symbols are PARISC only but CONFIG_EISA isn't.

You are right.
It worked for my needs because I am only building the drivers, and not linking them. But i believe doing something like I did in zorro/Makefile would fix this all. (For reference,
https://lkml.org/lkml/2018/9/28/150 )

If you agree, I will send the next patchset with this change.

Thanks for your help!

Leonardo Bras

#7 lore raw

Re: [PATCH v3 3/7] drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

Quoted 6 lines

Well it's not really that persuasive. Most people simply let the build run to completion, but if you have a problem with a job control 3h timelimit, then create a job that kills itself at 2:59 and then resubmits itself. That will produce a complete build in 3h chunks without any need to call sub Makefiles.

Humm, I probably should have explained better how GitlabCI works. It works creating a docker container that have a limited lifespan of 3h max. After that the time is over, this container ceases to exist, leaving no build objects, only the console log. So there is no way of 'resuming' the building from where it stopped. I used the 'job' term because it's how they call it, and I understand it's easily confused with bash jobs.

Quoted 6 lines

All of our Makefiles are coded assuming the upper level can prevent descent into the lower ones. You're proposing to change that assumption, requiring a fairly large patch set, which doesn't really seem to provide a huge benefit.

James

I understand your viewpoint.
But what I propose is not to change that assumption, but instead give some Makefiles the aditional ability to be called directly and still not build stuff if they were not enabled in .config.

But, why these chosen Makefiles, and not all of them? Granularity.
What I am trying to achieve with this patchset is the ability of building smaller sets of drivers without accidentally building what is not enabled on .config.
And, in my viewpoint, building a single drivers/DRIVERNAME is small enough to be fast in most situations.

This change is not supposed to bother the usual way of building the kernel, and it is not even supposed to add overhead to kernel compilation. And it would, at least, solve my problem with the 3h limit, and enable the tool I am building on GiltabCI to help other developers.

Thanks for reading,

Leonardo Bras

#8 lore raw

Re: [PATCH v3 3/7] drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

Quoted 2 lines · Leonardo Bras

...
But, why these chosen Makefiles, and not all of them?

I think that inconsistency is untenable. If nothing else, it means your changes will get broken by other people who also apply constraints inconsistently.

I think you need to consider what happens when you apply this regime tree-wide. Either that or explain why it would make sense to build e.g. drivers/s390 but not drivers/s390/net.

#9 lore raw

Re: [PATCH v3 3/7] drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

In reply to Leonardo Bras

Am 05.10.2018 um 15:16 schrieb Leonardo Bras:

Quoted 26 lines
Quoted 6 lines

Well it's not really that persuasive. Most people simply let the build run to completion, but if you have a problem with a job control 3h timelimit, then create a job that kills itself at 2:59 and then resubmits itself. That will produce a complete build in 3h chunks without any need to call sub Makefiles.

Humm, I probably should have explained better how GitlabCI works. It works creating a docker container that have a limited lifespan of 3h max. After that the time is over, this container ceases to exist, leaving no build objects, only the console log. So there is no way of 'resuming' the building from where it stopped. I used the 'job' term because it's how they call it, and I understand it's easily confused with bash jobs.

Quoted 6 lines

All of our Makefiles are coded assuming the upper level can prevent descent into the lower ones. You're proposing to change that assumption, requiring a fairly large patch set, which doesn't really seem to provide a huge benefit.

James

I understand your viewpoint.
But what I propose is not to change that assumption, but instead give some Makefiles the aditional ability to be called directly and still not build stuff if they were not enabled in .config.

Quoted 7 lines

But, why these chosen Makefiles, and not all of them? Granularity.
What I am trying to achieve with this patchset is the ability of building smaller sets of drivers without accidentally building what is not enabled on .config.
And, in my viewpoint, building a single drivers/DRIVERNAME is small enough to be fast in most situations.

That already works, doesn't it? So all that you'd need is an offline tool to precompute what drivers to actually build with a given config.

'make -n' with some suitable output mangling might do the job.

There may well be other ways to achieve your stated goal, without any need to make changes to the kernel build process (which is the result of many years of evolution and tuning, BTW).

Quoted 1 line

This change is not supposed to bother the usual way of building the kernel, and

Enough people have voiced their concern to warrant that you should back up that claim, IMO. Have you verified that your patchset does not change current behaviour when building the entire set of default configurations for each supported architecture? Does it reduce or increase overall complexity of the build process?

Quoted 3 lines

it is not even supposed to add overhead to kernel compilation. And it would, at least, solve my problem with the 3h limit, and enable the tool I am building on GiltabCI to help other developers.

(Apropos of nothing: Am I the only one who thinks gitlab might take a rather dim view of your creativity in dealing with their limit?)

Quoted 3 lines

Thanks for reading,

Leonardo Bras

Thanks for listening!

Cheers,

Michael

#10 lore raw

Re: [PATCH v3 3/7] drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

Hello Michael,

Quoted 8 lines

That already works, doesn't it? So all that you'd need is an offline tool to precompute what drivers to actually build with a given config.

'make -n' with some suitable output mangling might do the job.

There may well be other ways to achieve your stated goal, without any need to make changes to the kernel build process (which is the result of many years of evolution and tuning, BTW).

Thanks for the info, I will try to use it.

Quoted 8 lines
Quoted 1 line

This change is not supposed to bother the usual way of building the kernel, and

Enough people have voiced their concern to warrant that you should back up that claim, IMO. Have you verified that your patchset does not change current behaviour when building the entire set of default configurations for each supported architecture? Does it reduce or increase overall complexity of the build process?

I have tried in some ARCHs and it worked fine. Out of curiosity, I will try on all
of them.

Quoted 7 lines
Quoted 3 lines

it is not even supposed to add overhead to kernel compilation. And it would, at least, solve my problem with the 3h limit, and enable the tool I am building on GiltabCI to help other developers.

(Apropos of nothing: Am I the only one who thinks gitlab might take a rather dim view of your creativity in dealing with their limit?)

They make available 50k minutes a month for OSS projects. I don't believe they care how it's spent if its used to build/deploy the project. They even allow using
several 'jobs' in parallel in order to speed up the process.

Thanks for your help,

Leonardo Bras

#22 lore raw
In reply to Finn Thain

Thanks Finn, I will take a good look at that and try to use it in my build.

Thank you,
Leonardo Bras

Quoted 17 lines · Finn Thain
Quoted 4 lines · Leonardo Bras

Both ccache and distcc seem very interesting, I will take my time to study them better as they can solve some situations I face. Thanks for sharing!

You might also want to check out 'gcc -O0', 'gcc -fopt-info' and 'gcc --help=optimizers' etc to see if you can reduce the compute cost.

To reduce IO cost, my build tests always use 'make O=/some/path' where /some/path is on a tmpfs mountpoint.

HTH.

--