Bug: Windows binary release package missing USB drivers, documentation, and root files due to CRLF in manifest lists #21

Closed
opened 2026-08-28 20:20:40 +01:00 by gronod · 0 comments
Owner

Description

In workflow action run 10753 (job 11814), the Windows release package Argyll_v3.5.0-ICCery.1.0_b763dd7_win64_exe.zip was built without USB drivers, HTML documentation, and root files (ReadMe.txt, License.txt).

Root Cause Analysis

During the Package Release step in makepackagebin.sh, the script collects filenames to copy using command substitutions on manifest files:

unset topfiles; for i in `cat binfiles`; do topfiles="$topfiles ${i}"; done
unset docfiles; for i in `cat doc/afiles`; do docfiles="$docfiles doc/${i}"; done
unset usbfiles;
for j in ${USBDIRS}; do
    if [ ${j} ]; then
        for i in `cat ${j}/${USBBINFILES}`; do usbfiles="$usbfiles ${j}/${i}"; done
    fi
done

Because binfiles, doc/afiles, and usb/binfiles.msw contain DOS line endings (\r\n), each token read into $i contains a trailing carriage return (\r).

When cp $i $TOPDIR/$i is executed, the destination/source lookup fails for every entry with errors such as:

cp: cannot stat 'ReadMe.txt'$'\r': No such file or directory
cp: cannot stat 'License.txt'$'\r': No such file or directory
cp: cannot stat 'doc/ArgyllDoc.html'$'\r': No such file or directory
cp: cannot stat 'usb/ArgyllCMS_install_USB.exe'$'\r': No such file or directory
cp: cannot stat 'usb/ArgyllCMS_uninstall_USB.exe'$'\r': No such file or directory
cp: cannot stat 'usb/ArgyllCMS.cat'$'\r': No such file or directory
cp: cannot stat 'usb/ArgyllCMS.inf'$'\r': No such file or directory
cp: cannot stat 'usb/bin/x86/libusb0.sys'$'\r': No such file or directory
cp: cannot stat 'usb/bin/amd64/libusb0.sys'$'\r': No such file or directory

Only bin/* and ref/* were included in the archive because they were expanded via shell globbing rather than manifest file reading.

Additionally:

  • usb/binfiles.msw references ArgyllCMS_x64.cat and ArgyllCMS_arm64.cat, which are generated by usb/makecat.bat as copies of ArgyllCMS.cat but are not pre-committed or generated when inf2cat is not present.

Proposed Remediation Plan

  1. Sanitize Line Endings in makepackagebin.sh:
    • Filter manifest file contents with tr -d '\r' before iterating over items (or run dos2unix / normalize line endings).
  2. Handle Catalog Files in usb/:
    • Ensure usb/ArgyllCMS_x64.cat and usb/ArgyllCMS_arm64.cat are created from usb/ArgyllCMS.cat during build/packaging if not already present.
  3. Verify Packaging in CI:
    • Add verification check in CI workflow to assert that critical files (usb/ArgyllCMS.inf, usb/bin/amd64/libusb0.sys, doc/ArgyllDoc.html, ReadMe.txt) exist inside the final zip artifact.
### Description In workflow action run [10753](https://git.i3omb.com/gronod/argyllcms/actions/runs/10753) (job 11814), the Windows release package `Argyll_v3.5.0-ICCery.1.0_b763dd7_win64_exe.zip` was built without USB drivers, HTML documentation, and root files (`ReadMe.txt`, `License.txt`). ### Root Cause Analysis During the `Package Release` step in `makepackagebin.sh`, the script collects filenames to copy using command substitutions on manifest files: ```bash unset topfiles; for i in `cat binfiles`; do topfiles="$topfiles ${i}"; done unset docfiles; for i in `cat doc/afiles`; do docfiles="$docfiles doc/${i}"; done unset usbfiles; for j in ${USBDIRS}; do if [ ${j} ]; then for i in `cat ${j}/${USBBINFILES}`; do usbfiles="$usbfiles ${j}/${i}"; done fi done ``` Because `binfiles`, `doc/afiles`, and `usb/binfiles.msw` contain DOS line endings (`\r\n`), each token read into `$i` contains a trailing carriage return (`\r`). When `cp $i $TOPDIR/$i` is executed, the destination/source lookup fails for every entry with errors such as: ```text cp: cannot stat 'ReadMe.txt'$'\r': No such file or directory cp: cannot stat 'License.txt'$'\r': No such file or directory cp: cannot stat 'doc/ArgyllDoc.html'$'\r': No such file or directory cp: cannot stat 'usb/ArgyllCMS_install_USB.exe'$'\r': No such file or directory cp: cannot stat 'usb/ArgyllCMS_uninstall_USB.exe'$'\r': No such file or directory cp: cannot stat 'usb/ArgyllCMS.cat'$'\r': No such file or directory cp: cannot stat 'usb/ArgyllCMS.inf'$'\r': No such file or directory cp: cannot stat 'usb/bin/x86/libusb0.sys'$'\r': No such file or directory cp: cannot stat 'usb/bin/amd64/libusb0.sys'$'\r': No such file or directory ``` Only `bin/*` and `ref/*` were included in the archive because they were expanded via shell globbing rather than manifest file reading. Additionally: - `usb/binfiles.msw` references `ArgyllCMS_x64.cat` and `ArgyllCMS_arm64.cat`, which are generated by `usb/makecat.bat` as copies of `ArgyllCMS.cat` but are not pre-committed or generated when `inf2cat` is not present. ### Proposed Remediation Plan 1. **Sanitize Line Endings in `makepackagebin.sh`**: - Filter manifest file contents with `tr -d '\r'` before iterating over items (or run `dos2unix` / normalize line endings). 2. **Handle Catalog Files in `usb/`**: - Ensure `usb/ArgyllCMS_x64.cat` and `usb/ArgyllCMS_arm64.cat` are created from `usb/ArgyllCMS.cat` during build/packaging if not already present. 3. **Verify Packaging in CI**: - Add verification check in CI workflow to assert that critical files (`usb/ArgyllCMS.inf`, `usb/bin/amd64/libusb0.sys`, `doc/ArgyllDoc.html`, `ReadMe.txt`) exist inside the final zip artifact.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/argyllcms#21