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

add: python cosmopolitan #31

Closed
metaist opened this issue Jul 24, 2024 · 8 comments
Closed

add: python cosmopolitan #31

metaist opened this issue Jul 24, 2024 · 8 comments

Comments

@metaist
Copy link
Owner

metaist commented Jul 24, 2024

Something to consider for a truly download-run-anywhere solution.

@metaist
Copy link
Owner Author

metaist commented Jul 31, 2024

Packaging all of python seems a bit overkill, but it's a simple approach. Problem is, I can't get any cosmopolitan binaries to run anymore.

For example, getting the most recent datasette:

wget https://github.com/ahgamut/superconfigure/releases/download/z0.0.49/datasette.zip
chmod +x datasette.zip
./datasette.zip -V
# => invalid file (bad magic number): Exec format error

@metaist metaist mentioned this issue Jul 31, 2024
17 tasks
@metaist
Copy link
Owner Author

metaist commented Aug 16, 2024

Submitted an issue: ahgamut/superconfigure#50
Going to assume this is a dead-end for now. Will reopen if it turns out to be a serious possibility.

@metaist metaist closed this as completed Aug 16, 2024
@metaist metaist added the wontfix This will not be worked on label Aug 16, 2024
@metaist
Copy link
Owner Author

metaist commented Aug 18, 2024

So it turns out that the APE is inside the first level of zip file. datasette takes about 38 MB when that first layer is unzipped. Two questions:

  1. How do you add your own files?
  2. Can we make ds run immediately instead of running the python REPL?

@metaist metaist reopened this Aug 18, 2024
@metaist metaist removed the wontfix This will not be worked on label Aug 18, 2024
@metaist
Copy link
Owner Author

metaist commented Aug 20, 2024

@metaist
Copy link
Owner Author

metaist commented Aug 20, 2024

wget -O ds https://cosmo.zip/pub/cosmos/bin/python
chmod +x ds # make executable
mkdir -p Lib/site-packages # create structure
cp ../src/ds Lib/site-packages # copy to structure
zip -qr ./ds ./Lib # added 

@metaist
Copy link
Owner Author

metaist commented Aug 20, 2024

wget -N https://github.com/metaist/ds/releases/latest/download/ds
chmod +x ds
sudo install ds /usr/bin

@metaist
Copy link
Owner Author

metaist commented Aug 20, 2024

This seems to work. Now the trick is to prune the file size down a bit. I wonder how much of python I actually need.

Maybe I could do some analysis of all the python modules I use and their full set of dependencies.

Or I could start with some low-hanging fruit: probably don't need pip which comes with rich.

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

No branches or pull requests

1 participant