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

Proposal: Provide releases compatible with python zip format #588

Open
tobimensch opened this Issue Jun 11, 2016 · 2 comments

Comments

Projects
None yet
4 participants
@tobimensch

tobimensch commented Jun 11, 2016

Rationale:
Could be useful as an adhoc solution on systems without meson/meson.py, or where the
meson/meson.py in the system's repository is out of date. The only requirement would be python3.

Here's a short description on how python zip files work:
https://blogs.gnome.org/jamesh/2012/05/21/python-zip-files/

Github already provides .zip source files of releases, which means with a bit of luck only
a few minor changes would be required to support this.
(i.e. https://github.com/mesonbuild/meson/archive/0.32.0.zip)

Most likely a __main__.py acting as the entry point for meson would need to be added.

Ideally if this feature was supported, meson.build using projects could add a short
shell script that bootstraps meson (if it's not installed yet), and then automatically builds
the project in a predefined subdirectory. Therefore simplifying the build process for many people.

pseudo code of the shell script:

#!/bin/sh
mkdir build
cd build
#pseudo: minimum_required can be defined
minimum_required=0.32
if [[ $(#pseudo: check for meson/meson.py) &&
     "$minimum_required" -le "$(meson --version)" ]]
then
    #pseudo:
    meson/meson.py .. && ninja
else
    #meson/meson.py not found
    #pseudo: check for downloader availability
    #and use one of wget/aria2c/curl/... 
    curl https://github.com/mesonbuild/meson/archive/master.zip > meson.zip
    #pseudo: check for python3 availability
    #pseudo: check for python3 executable name
    python3 meson.zip ..  && ninja
fi
@jpakkane

This comment has been minimized.

Show comment
Hide comment
@jpakkane

jpakkane Jun 14, 2016

Member

This is a very low priority issue because distro packages + pip work almost everywhere. For those people wanting Git versions, this can be emulated with the following script:

#!/bin/sh
git clone https://github.com/mesonbuild/meson.git
mkdir build
meson/meson.py build
Member

jpakkane commented Jun 14, 2016

This is a very low priority issue because distro packages + pip work almost everywhere. For those people wanting Git versions, this can be emulated with the following script:

#!/bin/sh
git clone https://github.com/mesonbuild/meson.git
mkdir build
meson/meson.py build
@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Aug 20, 2016

Contributor

This proposal is really nice actually and it would be great to have access to self-containing meson zip archives. One basic use case I see would be to ship a tarball along with the build system to compile on an embedded system without Internet access. That or just to target lamba users who just want to build and run quickly.

Yet, it's really easy to create:

cp meson.py __main__.py
zip meson.zip __main.py__ mesonbuild/**/*.py
echo '#!/usr/bin/env python3' > meson
cat meson.zip > meson
chmod +x meson
rm __main__.py meson.zip
Contributor

arteymix commented Aug 20, 2016

This proposal is really nice actually and it would be great to have access to self-containing meson zip archives. One basic use case I see would be to ship a tarball along with the build system to compile on an embedded system without Internet access. That or just to target lamba users who just want to build and run quickly.

Yet, it's really easy to create:

cp meson.py __main__.py
zip meson.zip __main.py__ mesonbuild/**/*.py
echo '#!/usr/bin/env python3' > meson
cat meson.zip > meson
chmod +x meson
rm __main__.py meson.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment