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

refactor: sort RUNENV debugging log output #357

Merged
merged 3 commits into from
Jun 5, 2023
Merged

refactor: sort RUNENV debugging log output #357

merged 3 commits into from
Jun 5, 2023

Conversation

jameslamb
Copy link
Contributor

@jameslamb jameslamb commented Jun 5, 2023

Running with logging.level = "DEBUG", scikit-build-core emits a log message listing environment variables for the build, like this:

2023-06-05 00:48:26,822 - scikit_build_core - DEBUG - RUNENV:
  SYSTEM_PULLREQUEST_SOURCECOMMITID=77b0ed1470cbf63d39ddae10915e96cea2804783
  BUILD_QUEUEDBY=Microsoft.VisualStudio.Services.TFS
  CONDA_SHLVL=1
  LC_ALL=en_US.UTF-8
  LD_LIBRARY_PATH=/usr/local/lib64:/opt/rh/gcc-toolset-12/root/usr/lib64:/opt/rh/gcc-toolset-12/root/usr/lib:/opt/rh/gcc-toolset-12/root/usr/lib64/dyninst:/opt/rh/  gcc-toolset-12/root/usr/lib/dyninst:/usr/local/lib
  CONDA_EXE=/opt/miniforge/bin/conda
  AGENT_HOMEDIRECTORY=/__a
  SYSTEM_POSTLINESSPEED=10000
  AGENT_USEWORKSPACEID=true
  SYSTEM_STAGEDISPLAYNAME=__default
  AGENT_VERSION=3.220.2
  SYSTEM_JOBATTEMPT=1
  SYSTEM_TEAMFOUNDATIONSERVERURI=https://dev.azure.com/lightgbm-ci/
  AGENT_TOOLSDIRECTORY=/__t
  INPUT_ARGUMENTS=
  SYSTEM_DEFINITIONID=1
  AGENT_DISABLELOGPLUGIN_TESTFILEPUBLISHERPLUGIN=true
  LANG=en_US.UTF-8
  ...

I've found that very useful when trying to debug build issues in a project I'm working on (microsoft/LightGBM#5061).

This PR proposes a change that I think might make it even more useful...sorting that output alphabetically, like this:

2023-06-05 00:48:26,822 - scikit_build_core - DEBUG - RUNENV:
  AGENT_DISABLELOGPLUGIN_TESTFILEPUBLISHERPLUGIN=true
  AGENT_HOMEDIRECTORY=/__a
  AGENT_TOOLSDIRECTORY=/__t
  AGENT_USEWORKSPACEID=true
  AGENT_VERSION=3.220.2
  BUILD_QUEUEDBY=Microsoft.VisualStudio.Services.TFS
  CONDA_EXE=/opt/miniforge/bin/conda
  CONDA_SHLVL=1
  INPUT_ARGUMENTS=
  LANG=en_US.UTF-8
  LC_ALL=en_US.UTF-8
  LD_LIBRARY_PATH=/usr/local/lib64:/opt/rh/gcc-toolset-12/root/usr/lib64:/opt/rh/gcc-toolset-12/root/usr/lib:/opt/rh/gcc-toolset-12/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-12/root/usr/lib/dyninst:/usr/local/lib
  SYSTEM_DEFINITIONID=1
  SYSTEM_JOBATTEMPT=1
  SYSTEM_POSTLINESSPEED=10000
  SYSTEM_PULLREQUEST_SOURCECOMMITID=77b0ed1470cbf63d39ddae10915e96cea2804783
  SYSTEM_STAGEDISPLAYNAME=__default
  SYSTEM_TEAMFOUNDATIONSERVERURI=https://dev.azure.com/lightgbm-ci/

In addition to making the output a bit easier to scan visually (in my opinion), that also makes the use of text-diffing tools to compare log output a bit easier.

Thanks very much for your time and consideration.

@henryiii henryiii merged commit bc23489 into scikit-build:main Jun 5, 2023
@henryiii
Copy link
Collaborator

henryiii commented Jun 5, 2023

Thanks!

@jameslamb jameslamb deleted the sort-env branch June 5, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants