Skip to content

Error if no xz installed #5980

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

Conversation

trishankatdatadog
Copy link
Contributor

Try to fix #5872

@brainwane brainwane requested a review from ewdurbin June 8, 2019 19:05
@ewdurbin
Copy link
Member

This still doesn't seem to work on latest MacOS... xz installed via Homebrew.

ewd3imac:warehouse ewdurbin$ git diff
diff --git a/Makefile b/Makefile
index 480a9b72..dc1cdbd4 100644
--- a/Makefile
+++ b/Makefile
@@ -149,6 +149,7 @@ ifneq ($(PR), false)
 endif
 
 initdb:
+       xz -V &> /dev/null || $(error "No xz available on PATH, install xz!")
        docker-compose run --rm web psql -h db -d postgres -U postgres -c "DROP DATABASE IF EXISTS warehouse"
        docker-compose run --rm web psql -h db -d postgres -U postgres -c "CREATE DATABASE warehouse ENCODING 'UTF8'"
        xz -d -f -k dev/$(DB).sql.xz --stdout | docker-compose run --rm web psql -h db -d warehouse -U postgres -v ON_ERROR_STOP=1 -1 -f -
ewd3imac:warehouse ewdurbin$ make initdb
Makefile:152: *** "No xz available on PATH, install xz!".  Stop.
ewd3imac:warehouse ewdurbin$ xz -V
xz (XZ Utils) 5.2.4
liblzma 5.2.4
ewd3imac:warehouse ewdurbin$ which xz
/usr/local/bin/xz
ewd3imac:warehouse ewdurbin$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 10.14.5 (18F132)
      Kernel Version: Darwin 18.6.0
      Boot Volume: ewd3mojave
      Boot Mode: Normal
      Computer Name: ewd3imac
      User Name: Ernest W Durbin III (ewdurbin)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 13 days 53 minutes

@trishankatdatadog
Copy link
Contributor Author

WFM... does anyone else want to try?

@brainwane
Copy link
Contributor

@di could you give this a try?

@brainwane brainwane mentioned this pull request Jul 17, 2019
@sayanarijit
Copy link
Contributor

sayanarijit commented Jul 18, 2019

Looks like static container has an xz.

docker-compose run --rm --no-deps -v $PWD/dev:/opt/warehouse/dev static xz -d -f -k /opt/warehouse/dev/$(DB).sql.xz --stdout | docker-compose run --rm web psql -h db -d warehouse -U postgres -v ON_ERROR_STOP=1 -1 -f -

@ewdurbin What do you think?

@sayanarijit
Copy link
Contributor

FYI a note section in https://warehouse.readthedocs.io/development/getting-started/ needs update too.

Base automatically changed from master to main January 21, 2021 18:39
miketheman added a commit to miketheman/warehouse that referenced this pull request Mar 20, 2022
When moving all development actions to containers in pypi#10803, this step
remained outside on the host OS.

As `xz-utils` are installed in the `web` image already, use those
instead of relying on the host to install them.

Refs: pypi#5872
Closes: pypi#5980

Signed-off-by: Mike Fiedler <[email protected]>
@di di closed this in #10978 Mar 20, 2022
di pushed a commit that referenced this pull request Mar 20, 2022
When moving all development actions to containers in #10803, this step
remained outside on the host OS.

As `xz-utils` are installed in the `web` image already, use those
instead of relying on the host to install them.

Refs: #5872
Closes: #5980

Signed-off-by: Mike Fiedler <[email protected]>
domdfcoding pushed a commit to domdfcoding/warehouse that referenced this pull request Jun 7, 2022
When moving all development actions to containers in pypi#10803, this step
remained outside on the host OS.

As `xz-utils` are installed in the `web` image already, use those
instead of relying on the host to install them.

Refs: pypi#5872
Closes: pypi#5980

Signed-off-by: Mike Fiedler <[email protected]>
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.

4 participants