canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
2.74k stars 831 forks source link

sed expression in tools/tox-venv is not POSIX compatible #3501

Open ubuntu-server-builder opened 1 year ago

ubuntu-server-builder commented 1 year ago

This bug was originally filed in Launchpad as LP: #1853441

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2019-11-21T11:05:46.579756+00:00
date_fix_committed = None
date_fix_released = None
id = 1853441
importance = low
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1853441
milestone = None
owner = minagalic
owner_name = Mina Galić
private = False
status = triaged
submitter = minagalic
submitter_name = Mina Galić
tags = ['freebsd']
duplicates = []

Launchpad user Mina Galić(minagalic) wrote on 2019-11-21T11:05:46.579756+00:00

When running tools/tox-venv py3 on FreeBSD, I get the following Error:

sed: 2: ":x; /\$/ { N; s/\\n[ ...": unused label 'x; /\$/ { N; s/\\n[ ]*//; tx };'

This suggests to me, that the expression

    sed -e ':x; /\\$/ { N; s/\\\n[ ]*//; tx };' "${tox_ini}" |

is not POSIX compatible.

Looking at GNU sed's documentation, I see the first issue with making this expression POSIX compliant will be that N behaves intentionally different on GNU sed than on POSIX:

https://www.gnu.org/software/sed/manual/html_node/Reporting-Bugs.html#Reporting-Bugs

So the solution here might be simply to require GNU sed, and put it's path/name into an environment variable that can be overriden from the outside.

ubuntu-server-builder commented 1 year ago

Launchpad user Dan Watkins(oddbloke) wrote on 2019-12-04T15:17:41.391254+00:00

Triaging this as Low, as there's generally a way to do whatever tox-venv does without using that script.