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

Proposal: Provide releases compatible with python zip format #588

Closed
tobimensch opened this issue Jun 11, 2016 · 3 comments
Closed

Proposal: Provide releases compatible with python zip format #588

tobimensch opened this issue Jun 11, 2016 · 3 comments

Comments

@tobimensch
Copy link

@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
Copy link
Member

@jpakkane 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
Copy link
Contributor

@arteymix 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

@scivision
Copy link
Member

@scivision scivision commented Oct 18, 2019

I believe this was addressed by #880

@scivision scivision closed this Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants