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

Use environment variable for switching SoX dep #669

Merged
merged 7 commits into from Jun 1, 2020

Conversation

mthrok
Copy link
Collaborator

@mthrok mthrok commented May 29, 2020

This PR changes

  1. The way how to decide if codecs/SoX should be built when building torchaudio C++ extension.
    It check whether BUILD_SOX env is defined or not. (Originally, it was checking the existence of .use_external_sox file.)
  2. Revert the default behavior of codecs/SoX build.
    It does not build codecs/SoX by default.

README.md Outdated
This is known to work on a few major Linux distributions such as Ubuntu and CentOS 7 and macOS.
If you try this on a new system and found a solution to make it work, feel free to share it by opening and issue.

#### Troubleshooting:
Copy link
Collaborator Author

@mthrok mthrok May 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can put this section (or the whole installation direction) into a separate file or Wiki too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The installation section should stay in the readme. I do like the folds you are adding, which avoids cluttering part of the wiki, at least when rendered such as on github. I'd say to leave troubleshooting here, with the installation steps, but I'm ok either for this.

Since we may leave some pull requests opened for troubleshooting, the troubleshooting section may be redundant, and more work to keep up-to-date. That would be a vote for just using issues for troubleshooting.

@mthrok mthrok marked this pull request as ready for review May 29, 2020 20:36
@mthrok mthrok requested a review from vincentqb May 29, 2020 20:36
Copy link
Contributor

@vincentqb vincentqb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added minor comments, but otherwise LGTM.

# Temporary fix for building in fbcode
# at the moment, we have to use external sox in fbcode
_BUILD_DEPS = not (_ROOT_DIR / '.use_external_sox').exists()
_BUILD_SOX = 'BUILD_SOX' in os.environ
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen more often a check for whether BUILD_SOX=1 instead of just the existence. I could imagine someone doing BUILD_SOX=0 and be surprise that sox is built.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, for this kind of env var, there is no standard of what values are acceptable.
there are really a lot of variations like 0, 1, true, false, on, off, yes, no etc...
and since this is env var, we should not really raise an error if the value is something unexpected.
I am open in defining values for our case, but my personal preference for binary behavior is just define variable or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the behavior to expect 0/1 (and some others)

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated
This is known to work on a few major Linux distributions such as Ubuntu and CentOS 7 and macOS.
If you try this on a new system and found a solution to make it work, feel free to share it by opening and issue.

#### Troubleshooting:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The installation section should stay in the readme. I do like the folds you are adding, which avoids cluttering part of the wiki, at least when rendered such as on github. I'd say to leave troubleshooting here, with the installation steps, but I'm ok either for this.

Since we may leave some pull requests opened for troubleshooting, the troubleshooting section may be redundant, and more work to keep up-to-date. That would be a vote for just using issues for troubleshooting.

README.md Outdated Show resolved Hide resolved
@vincentqb
Copy link
Contributor

More downloads mean more instances of files that can't be downloaded when running circleci :)

@vincentqb
Copy link
Contributor

Closes #666?

Copy link
Collaborator Author

@mthrok mthrok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More downloads mean more instances of files that can't be downloaded when running circleci :)

I do not get what you mean. Can you elaborate ?

# Temporary fix for building in fbcode
# at the moment, we have to use external sox in fbcode
_BUILD_DEPS = not (_ROOT_DIR / '.use_external_sox').exists()
_BUILD_SOX = 'BUILD_SOX' in os.environ
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, for this kind of env var, there is no standard of what values are acceptable.
there are really a lot of variations like 0, 1, true, false, on, off, yes, no etc...
and since this is env var, we should not really raise an error if the value is something unexpected.
I am open in defining values for our case, but my personal preference for binary behavior is just define variable or not.

@codecov
Copy link

codecov bot commented May 30, 2020

Codecov Report

Merging #669 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #669   +/-   ##
=======================================
  Coverage   88.80%   88.80%           
=======================================
  Files          21       21           
  Lines        2225     2225           
=======================================
  Hits         1976     1976           
  Misses        249      249           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17bc15f...28eb81b. Read the comment docs.

@vincentqb
Copy link
Contributor

More downloads mean more instances of files that can't be downloaded when running circleci :)

I do not get what you mean. Can you elaborate ?

This was not meant as an actionable statement. :) I was just noting that if more files are downloaded when setting up circle ci, we may get more timeouts/etc.

@mthrok mthrok merged commit 449b6ab into pytorch:master Jun 1, 2020
@mthrok mthrok deleted the external-sox branch June 1, 2020 16:44
@mthrok
Copy link
Collaborator Author

mthrok commented Jun 1, 2020

thanks!

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.

None yet

2 participants