RalfG / python-wheels-manylinux-build

GitHub Action to build Python manylinux wheels
https://github.com/marketplace/actions/python-wheels-manylinux-build
Apache License 2.0
92 stars 44 forks source link

Switch to package dir created with PRE_BUILD_COMMAND #37

Closed levitsky closed 2 years ago

levitsky commented 3 years ago

Hi!

In my use case I want to switch to the build directory which is created by running PRE_BUILD_COMMAND. I cannot do that by specifying PACKAGE_PATH because cd is attempted before the PRE_BUILD_COMMAND.

I tried to cheat by supplying do stuff && cd new_dir or do stuff; cd new_dir as PRE_BUILD_COMMAND, but it is escaped, so that doesn't work. Doing a cd in a script would be of no use either.

Is there a way to achieve what I need?

P.S. I also looked at changing the PIP_WHEEL_ARGS to specify the actual location of my setup.py (because it is an arg for pip wheel) but . is added to the pip wheel command anyway, so it doesn't help me either. If PIP_WHEEL_ARGS would replace all of the standard args, including ., that would help me.

RalfG commented 3 years ago

Hi! Could you test if prepending eval to $PRE_BUILD_COMMAND fixes the escaping issue?

This https://github.com/RalfG/python-wheels-manylinux-build/blob/5f2c4babb342e922d0bdf5b8a7c636487b706211/entrypoint.sh#L23 would become

 eval $PRE_BUILD_COMMAND || { echo "Pre-build command failed."; exit 1; } 
levitsky commented 3 years ago

Hi @RalfG! Thank you for the suggestion!

I'm not sure what would be the easiest way to actually test a development version of your Github Action. Locally, in a termimnal, this works fine:

$ c="do stuff && cd new_dir"
$ eval $c || { echo "Pre-build command failed."; exit 1; } 

However, I'm not sure how to test the whole edited workflow. I noticed that on Github, these things are tokenized weirdly upon logging, but I'm not sure if it's relevant: image

kchaliki commented 3 years ago

Just to add, it looks like I have a similar problem trying to install Rust in order to build a Pyo3 based extension curl https://sh.rustup.rs -sSf | sh -s -- -y && export PATH="$HOME/.cargo/bin:$PATH"

I am going to try putting those in a script and sourcing instead but if you have any other solution i'd love to hear about it.

jeremysanders commented 3 years ago

I would similarly like to set environment variables after the exit of my pre-build command (like PATH). Might a solution here to be to optionally (?) source the file, rather than executing it?

RalfG commented 2 years ago

Now implemented in v0.4.0 https://github.com/RalfG/python-wheels-manylinux-build/releases/tag/v0.4.0