Public bug reported:

[SRU Justification]

BugLink: https://bugs.launchpad.net/bugs/2097581

[Impact]

When building dkms packages in a kernel build, if the dkms package is
not present in the Ubuntu archive, debian/scripts/dkms-build tries to
parse the URLs found in the various deb source files on the system.
There is a cosmetic issue with one-line source format, and the issue
with parsing DEB822 sources can result in failed builds if the dkms
package is not in the Ubuntu archive.

one-line issue:
When a one-line source file specifies options before the URI, e.g. "deb 
[trusted=yes] <uri>", the script grabs the "[trusted=yes]" part as the URI. 
This hasn't been an issue with Launchpad builds since the desired PPA sources 
don't specify any options, but this can cause breakages when building on 
different systems.

DEB822 issue:
The dkms-build script originally uses an "awk" command to parse DEB822 sources 
on a per-stanza basis (i.e. blocks separated by newlines) so it could ignore 
any stanzas with only the "deb-src" type. Some time in the last few months, the 
"awk" command started producing incorrect output (no output, in this case). 
This results in all DEB822 URIs being ignored.

[How to reproduce it]

I could not reproduce the DEB822 issue locally. I have only seen the behaviour 
on LP builds. To reproduce it, simply try to build a package that uses the 
dkms-build script and uses a PPA url in the dkms-versions file.
One example is the build for the linux-nvidia-tegra-modules 6.8.0-1002.2 
package [1]. In the log, you will see the one-line issue when the script 
incorrectly uses "[trusted=yes]" as the URI, and the DEB822 issue manifests as 
a lack of attempts to download from other URIs after that.

[Fix]
one-line issue:
Update the parsing to ignore the options.

DEB822 issue:
Remove the "awk" command and simply grab all URIs in the sources. This will 
include stanzas that are only of type "deb-src", but that currently has no 
impact on LP builds, and fixing the broken builds is more important than 
keeping that functionality.

[Test plan]

1. Apply fix to a package that experiences the aforementioned issues.
2. Trigger a build of the updated package.
3. Ensure those errors are no longer present and the build succeeds.

[Regression potential]

Very low. The only unexpected consequence is trying to install a dkms
package from an unintended URI in a "deb-src"-only stanza, but the dkms
package will not exist at the wrong URI and the script handles 404s
gracefully, this should not change any behaviour. Additionally, LP
builders do not have "deb-src"-only stanzas.

** Affects: linux-nvidia-tegra (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  [SRU Justification]
  
- BugLink: N/A
+ BugLink: https://bugs.launchpad.net/bugs/2097581
  
  [Impact]
  
  When building dkms packages in a kernel build, if the dkms package is
  not present in the Ubuntu archive, debian/scripts/dkms-build tries to
  parse the URLs found in the various deb source files on the system.
  There is a cosmetic issue with one-line source format, and the issue
  with parsing DEB822 sources can result in failed builds if the dkms
  package is not in the Ubuntu archive.
  
  one-line issue:
  When a one-line source file specifies options before the URI, e.g. "deb 
[trusted=yes] <uri>", the script grabs the "[trusted=yes]" part as the URI. 
This hasn't been an issue with Launchpad builds since the desired PPA sources 
don't specify any options, but this can cause breakages when building on 
different systems.
  
  DEB822 issue:
  The dkms-build script originally uses an "awk" command to parse DEB822 
sources on a per-stanza basis (i.e. blocks separated by newlines) so it could 
ignore any stanzas with only the "deb-src" type. Some time in the last few 
months, the "awk" command started producing incorrect output (no output, in 
this case). This results in all DEB822 URIs being ignored.
  
  [How to reproduce it]
  
  I could not reproduce the DEB822 issue locally. I have only seen the 
behaviour on LP builds. To reproduce it, simply try to build a package that 
uses the dkms-build script and uses a PPA url in the dkms-versions file.
  One example is the build for the linux-nvidia-tegra-modules 6.8.0-1002.2 
package [1]. In the log, you will see the one-line issue when the script 
incorrectly uses "[trusted=yes]" as the URI, and the DEB822 issue manifests as 
a lack of attempts to download from other URIs after that.
  
  [Fix]
  one-line issue:
  Update the parsing to ignore the options.
  
  DEB822 issue:
  Remove the "awk" command and simply grab all URIs in the sources. This will 
include stanzas that are only of type "deb-src", but that currently has no 
impact on LP builds, and fixing the broken builds is more important than 
keeping that functionality.
  
  [Test plan]
  
  1. Apply fix to a package that experiences the aforementioned issues.
  2. Trigger a build of the updated package.
  3. Ensure those errors are no longer present and the build succeeds.
  
  [Regression potential]
  
  Very low. The only unexpected consequence is trying to install a dkms
  package from an unintended URI in a "deb-src"-only stanza, but the dkms
  package will not exist at the wrong URI and the script handles 404s
  gracefully, this should not change any behaviour. Additionally, LP
  builders do not have "deb-src"-only stanzas.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2097581

Title:
  dkms-build script issues parsing deb sources on LP builders

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-nvidia-tegra/+bug/2097581/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to