Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`--verbose --profile` combination "breaks" output #7437

Closed
alcohol opened this Issue Jul 2, 2018 · 13 comments

Comments

Projects
None yet
5 participants
@alcohol
Copy link
Member

alcohol commented Jul 2, 2018

My composer.json:

{
    "require": {
        "symfony/console": "*",
        "symfony/debug": "*"
    }
}

When I run this command:

composer install --profile --verbose

I get the following output:

[6.4MB/0.00s] Loading composer repositories with package information
[6.7MB/0.74s] Updating dependencies (including require-dev)
[180.6MB/11.07s] Dependency resolution completed in 0.050 seconds
[180.7MB/11.07s] Analyzed 1850 packages to resolve dependencies
[180.7MB/11.07s] Analyzed 78643 rules to resolve dependencies
[180.7MB/11.07s] Package operations: 4 installs, 0 updates, 0 removals
[180.7MB/11.07s] Installs: symfony/polyfill-mbstring:v1.8.0, symfony/console:v4.1.1, psr/log:1.0.2, symfony/debug:v4.1.1
[180.7MB/11.07s]   - Installing symfony/polyfill-mbstring (v1.8.0): [180.8MB/11.08s] Loading from cache[180.8MB/11.08s] 
[180.8MB/11.08s]  Extracting archive[180.9MB/11.08s]   - Installing symfony/console (v4.1.1): [180.9MB/11.08s] Loading from cache[180.9MB/11.08s] 
[180.9MB/11.08s]  Extracting archive[180.9MB/11.10s]   - Installing psr/log (1.0.2): [180.9MB/11.10s] Loading from cache[180.9MB/11.10s] 
[180.9MB/11.10s]  Extracting archive[180.9MB/11.11s]   - Installing symfony/debug (v4.1.1): [180.9MB/11.11s] Loading from cache[180.9MB/11.11s] 
[180.9MB/11.11s]  Extracting archive[144.7MB/11.30s] symfony/console suggests installing psr/log-implementation (For using the console logger)
[144.7MB/11.30s] symfony/console suggests installing symfony/event-dispatcher ()
[144.7MB/11.30s] symfony/console suggests installing symfony/lock ()
[144.7MB/11.30s] symfony/console suggests installing symfony/process ()
[144.7MB/11.30s] Writing lock file
[144.7MB/11.30s] Generating autoload files
[144.8MB/11.35s] Memory usage: 144.76MB (peak: 181.11MB), time: 11.35s

And I expected this to happen:

The extracting archive steps should be inlined properly or not included at all. Now they break the profiling output prefix.

@stof

This comment has been minimized.

Copy link
Contributor

stof commented Jul 2, 2018

one idea could be to write the profiling info only when writing full lines ($newLine = true in ConsoleIO). Not sure this would fix the issue.

@Seldaek

This comment has been minimized.

Copy link
Member

Seldaek commented Jul 17, 2018

If that fixes most of it I'd say that's good enough. If not it's probably not worth fixing, --profile is debug mode and if that breaks output IMO that's fine.

@alcohol

This comment has been minimized.

Copy link
Member Author

alcohol commented Jul 17, 2018

Yeah it's not a big concern or anything, just figured I'd list it here as an easy pick for anyone wanting to start up with something easy in our codebase.

@MECU

This comment has been minimized.

Copy link

MECU commented Jul 25, 2018

I added this starting line 144 in /src/Composer/IO/ConsoleIO.php:

    if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
        $newline = true;
    }

and it now gives this output:

[9.6MB/0.01s] Loading composer repositories with package information
[10.1MB/0.39s] Updating dependencies (including require-dev)
[238.4MB/7.37s] Dependency resolution completed in 0.163 seconds
[238.5MB/7.37s] Analyzed 1920 packages to resolve dependencies
[238.5MB/7.37s] Analyzed 80923 rules to resolve dependencies
[238.5MB/7.37s] Package operations: 4 installs, 0 updates, 0 removals
[238.5MB/7.37s] Installs: psr/log:1.0.2, symfony/debug:v3.4.13, symfony/polyfill-mbstring:v1.8.0, symfony/console:v3.4.13
[238.5MB/7.37s]   - Installing psr/log (1.0.2): 
[238.7MB/7.38s] 
[238.7MB/7.38s]  Extracting archive
[238.8MB/7.41s]   - Installing symfony/debug (v3.4.13): 
[238.8MB/7.41s] 
[238.8MB/7.41s]  Extracting archive
[238.8MB/7.43s]   - Installing symfony/polyfill-mbstring (v1.8.0): 
[238.8MB/7.43s] 
[238.8MB/7.43s]  Extracting archive
[238.8MB/7.46s]   - Installing symfony/console (v3.4.13): 
[238.8MB/7.46s] 
[238.8MB/7.46s]  Extracting archive
[170.2MB/8.14s] symfony/console suggests installing psr/log-implementation (For using the console logger)
[170.2MB/8.14s] symfony/console suggests installing symfony/event-dispatcher
[170.2MB/8.14s] symfony/console suggests installing symfony/lock
[170.2MB/8.14s] symfony/console suggests installing symfony/process
[170.2MB/8.14s] Writing lock file
[170.2MB/8.14s] Generating autoload files
[170.2MB/8.14s] Memory usage: 170.22MB (peak: 239.2MB), time: 8.14s

which seems to be what this issue is aiming for, but it's missing the text [180.9MB/11.08s] Loading from cache (for example, or the Downloaded message ...)

I'm not sure of the cause of this one status being not included though.

@alcohol

This comment has been minimized.

Copy link
Member Author

alcohol commented Jul 26, 2018

I just noticed --verbose mode also gives me other odd output;

rob@galaga /tmp $ composer require symfony/console -v
Using version ^4.1 for symfony/console
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Dependency resolution completed in 0.004 seconds
Analyzed 332 packages to resolve dependencies
Analyzed 4135 rules to resolve dependencies
Package operations: 2 installs, 0 updates, 0 removals
Installs: symfony/polyfill-mbstring:v1.8.0, symfony/console:v4.1.2
  - Installing symfony/polyfill-mbstring (v1.8.0): Loading from cache
 Extracting archive  - Installing symfony/console (v4.1.2): Loading from cache
 Extracting archiveWriting lock file
Generating autoload files
Symfony operations: 1 recipe (06c6c8151e9491cedaaf49ca89740f34)
  - Configuring symfony/console (>=3.3): From github.com/symfony/recipes:master
    Setting configuration and copying files
    Created "./bin/console"
@alcohol

This comment has been minimized.

Copy link
Member Author

alcohol commented Jul 26, 2018

I am running composer inside a container though, but in theory that should not affect the output I reckon.

@sakshamsaxena

This comment has been minimized.

Copy link

sakshamsaxena commented Mar 15, 2019

@alcohol Is this still open ? Would like to start off with this 😄

@alcohol

This comment has been minimized.

Copy link
Member Author

alcohol commented Mar 15, 2019

As far as I know, yes it is.

@alcohol

This comment has been minimized.

Copy link
Member Author

alcohol commented Mar 15, 2019

Or maybe not anymore... this looks OK I think..

rob@thinkpad ~ $ cd $(mktemp -d)
rob@thinkpad /tmp/tmp.YaCBAVnfiU $ echo '{}' > composer.json
rob@thinkpad /tmp/tmp.YaCBAVnfiU $ composer require symfony/console --verbose --profile
[146.7MiB/4.60s] Using version ^4.2 for symfony/console
[146.8MiB/4.60s] ./composer.json has been updated
[147.2MiB/4.73s] Loading composer repositories with package information
[147.3MiB/4.84s] Updating dependencies (including require-dev)
[289.0MiB/5.41s] Dependency resolution completed in 0.001 seconds
[289.1MiB/5.42s] Analyzed 810 packages to resolve dependencies
[289.1MiB/5.42s] Analyzed 178 rules to resolve dependencies
[289.1MiB/5.42s] Package operations: 3 installs, 0 updates, 0 removals
[289.1MiB/5.42s] Installs: symfony/polyfill-mbstring:v1.10.0, symfony/contracts:v1.0.2, symfony/console:v4.2.4
[289.1MiB/5.42s]   - Installing symfony/polyfill-mbstring (v1.10.0): [289.2MiB/5.42s] Loading from cache[289.2MiB/5.42s] 
[289.2MiB/5.42s]  Extracting archive[289.2MiB/5.43s]   - Installing symfony/contracts (v1.0.2): [289.2MiB/5.43s] Loading from cache[289.2MiB/5.43s] 
[289.2MiB/5.43s]  Extracting archive[289.2MiB/5.44s]   - Installing symfony/console (v4.2.4): [289.2MiB/5.44s] Loading from cache[289.2MiB/5.44s] 
[289.2MiB/5.44s]  Extracting archive[288.9MiB/5.62s] symfony/contracts suggests installing psr/cache (When using the Cache contracts)
[288.9MiB/5.62s] symfony/contracts suggests installing psr/container (When using the Service contracts)
[288.9MiB/5.62s] symfony/contracts suggests installing symfony/cache-contracts-implementation
[288.9MiB/5.62s] symfony/contracts suggests installing symfony/service-contracts-implementation
[288.9MiB/5.62s] symfony/contracts suggests installing symfony/translation-contracts-implementation
[288.9MiB/5.62s] symfony/console suggests installing psr/log (For using the console logger)
[288.9MiB/5.62s] symfony/console suggests installing symfony/event-dispatcher
[288.9MiB/5.62s] symfony/console suggests installing symfony/lock
[288.9MiB/5.62s] symfony/console suggests installing symfony/process
[288.9MiB/5.62s] Writing lock file
[288.9MiB/5.62s] Generating autoload files
[288.9MiB/5.62s] Memory usage: 288.89MiB (peak: 292.69MiB), time: 5.62s
@alcohol

This comment has been minimized.

Copy link
Member Author

alcohol commented Mar 15, 2019

Actually no, I just noticed the extracting steps and the installing steps being on the same line with profiling info in the middle.

@sakshamsaxena

This comment has been minimized.

Copy link

sakshamsaxena commented Mar 15, 2019

Yeah. I'm working on this. Looks a bit tricky, will address this over the weekend and I'm hoping to get a PR up by Sunday evening.

@sakshamsaxena

This comment has been minimized.

Copy link

sakshamsaxena commented Mar 18, 2019

Hey @alcohol, I've pasted the current output for --profile --verbose install on the PR's conversation. Do give it a glance soon :)

@Seldaek

This comment has been minimized.

Copy link
Member

Seldaek commented Mar 19, 2019

Closing as per #8043 (comment)

@Seldaek Seldaek closed this Mar 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.