bazelbuild / rules_pkg

Bazel rules for creating packages of many types (zip, tar, deb, rpm, ...)
Apache License 2.0
216 stars 171 forks source link

Fix pkg_deb changelog flag getter #734

Closed k0walik closed 1 year ago

k0walik commented 1 year ago

The pkg_deb changelog file getter fails with the FileNotFoundError. We should be using helpers.GetFlagValue() instead of GetFlagValues to read the file content:


Traceback (most recent call last):
  File "/home/tomasz.wojno/.cache/bazel/_bazel_tomasz.wojno/add7b8b23cb52c9765c438b938f09330/sandbox/linux-sandbox/34/execroot/repo/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_pkg/pkg/private/deb/make_deb.runfiles/rules_pkg/pkg/private/deb/make_deb.py", line 408, in <module>
    main()
  File "/home/tomasz.wojno/.cache/bazel/_bazel_tomasz.wojno/add7b8b23cb52c9765c438b938f09330/sandbox/linux-sandbox/34/execroot/repo/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_pkg/pkg/private/deb/make_deb.runfiles/rules_pkg/pkg/private/deb/make_deb.py", line 376, in main
    changelog=GetFlagValues(options.changelog),
  File "/home/tomasz.wojno/.cache/bazel/_bazel_tomasz.wojno/add7b8b23cb52c9765c438b938f09330/sandbox/linux-sandbox/34/execroot/repo/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_pkg/pkg/private/deb/make_deb.runfiles/rules_pkg/pkg/private/deb/make_deb.py", line 318, in GetFlagValues
    return [helpers.GetFlagValue(f, False) for f in flagvalues]
  File "/home/tomasz.wojno/.cache/bazel/_bazel_tomasz.wojno/add7b8b23cb52c9765c438b938f09330/sandbox/linux-sandbox/34/execroot/repo/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_pkg/pkg/private/deb/make_deb.runfiles/rules_pkg/pkg/private/deb/make_deb.py", line 318, in <listcomp>
    return [helpers.GetFlagValue(f, False) for f in flagvalues]
  File "/home/tomasz.wojno/.cache/bazel/_bazel_tomasz.wojno/add7b8b23cb52c9765c438b938f09330/sandbox/linux-sandbox/34/execroot/repo/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_pkg/pkg/private/deb/make_deb.runfiles/rules_pkg/pkg/private/helpers.py", line 80, in GetFlagValue
    with open(flagvalue[1:], 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '' 
k0walik commented 1 year ago

Sorry for the noise, I should have caught this in #696