Skip to content

Stdout noise when building package that has line breaks in description #1107

@davidlatwe

Description

@davidlatwe

Not sure if this has been brought up before (I kind of remember it does but cannot recall), anyway..

Problem

I am on Windows, not sure how this works in other OS currently.

Say I have the following package which has multi-line description (contains line breaks) :

# package.py

name = "foo"
version = "1"
description = \
    """
    My package foo.
    Some more lines..
    """

# Problem can't be reproduced if build_command = False
build_command = 'python -c "print(\'hello.\')"'

It can be built successfully but with some noise, see log :

$ rez-build

================================================================================
Building foo-1...
================================================================================
Resolving build environment:
resolved by davidlatwe.lai@*****, on Tue Jul 13 22:12:34 2021, using Rez v2.90.1+m

requested packages:
~platform==windows  (implicit)
~arch==AMD64        (implicit)
~os==windows-10.0   (implicit)

resolved packages:

Invoking custom build system...
Running build command: python -c "print('hello.')"
'Some' is not recognized as an internal or external command,
operable program or batch file.
hello.

================================================================================
Build Summary
================================================================================

All 1 build(s) were successful.

Notice that there is one line of output says "'Some' is not recognized as an internal or external command, ...", which is a bit annoying and confused.

And it was because the shell code that generated by the shell plugin cmd (the default one on Windows) didn't handle multi-line value when setting rez env var. The generated shell code looks like this :

REM
REM ################################################################################
REM pre-actions-callback
REM ################################################################################
set REZ_BUILD_ENV=1
set REZ_BUILD_PATH=C:\test\foo\build\default
set REZ_BUILD_PROJECT_VERSION=1
set REZ_BUILD_PROJECT_NAME=foo
set REZ_BUILD_PROJECT_DESCRIPTION=My package foo.
Some more lines..
set REZ_BUILD_PROJECT_FILE=C:\test\foo\package.py
set REZ_BUILD_SOURCE_PATH=C:\test\foo

Questions

I'd like to fix this, but..

  1. Does this happens on other platform ?
  2. Does this happens on other build system ? (I guess it does.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugloggingLogging related issuesos:windowsWindows-specificshellShell related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions