Code Monkey home page Code Monkey logo

Comments (21)

brettcannon avatar brettcannon commented on May 13, 2024 1

If a tarball can be constructed to match what /usr/local would expect, then people can use the following to extract the tarball and have all the files put in the proper place:

tar -x --strip-components 1 -f <tarball> -C /usr/local

Probably want to create a tarball with:

tar -c --xz --options xz:compression-level 9 -f <tarball name> <directory>

In terms of tarball file structure:

  • bin/py
  • share/doc/py/LICENSE
  • share/doc/py/README.md
  • share/fish/vendor_completions.d/py.fish
  • share/man/man1/py.1

from python-launcher.

pradyunsg avatar pradyunsg commented on May 13, 2024 1

If you need someone else to submit this to upstream Homebrew, I'd be happy to!

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024 1

@henryiii it's a configuration thing I don't want to bother solving right now since I can cross-compile on my own machine and upload manually. 😄

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

See if PGO makes a difference: https://doc.rust-lang.org/rustc/profile-guided-optimization.html

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

https://www.marcoieni.com/2020/12/rust-makes-cross-compilation-childs-play/

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

Should build for (if possible; will depend on GitHub Actions and cross):

  1. macOS x64
  2. macOS ARM
  3. Linux x64
  4. Linux ARM
  5. Windows x64
  6. Windows ARM

Package everything as:

  1. .tar.xz
  2. .deb
  3. .rpm
  4. .aur

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

Is it worth running strip on the binaries? I would assume cargo build --release did the right thing. Plus ripgrep makes it look like a pain.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

Might be worth looking into installers for:

  • macOS
  • Linux (via Snap?)

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

Getting on to Homebrew might be tricky since https://docs.brew.sh/Acceptable-Formulae says self-submitted is frowned upon until a project is popular. Might need to create my own tap to at least start.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

Based on rustc support and cross support, probably will start with building:

  1. x86_64-apple-darwin (rustc)
  2. aarch64-apple-darwin (rustc)
  3. x86_64-unknown-linux-gnu (rustc)
  4. aarch64-unknown-linux-gnu (cross)
  5. riscv64gc-unknown-linux-gnu (cross)
  6. x86_64-sun-solaris (cross)
  7. x86_64-unknown-freebsd (cross)
  8. x86_64-unknown-dragonfly (cross)
  9. x86_64-unknown-netbsd (cross)

Windows is not a concern as there isn't Windows support yet. Everything else either isn't an OS people run as a dev platform (and thus the Launcher isn't appropriately for), or isn't easily available via cross.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

https://github.com/actions-rs/cargo#cross-compilation
https://github.com/rust-github/template/blob/main/.github/workflows/cd.yml

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

Probably should also upload the SHA256 signatures for each file.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

For Homebrew, you need to know things like which path is for completions, man page, etc. Since that info is also necessary to create the tarball appropriately, probably going to need to write out some config data to map repo paths to file purpose.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

To generate the Homebrew formula, there's a cookbook, class details, and can use ripgrep's formula as guidance. Also might want an alias like ripgrep for rg if "py" is not already taken.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

Built for Apple Silicon on my x64 Mac:

rustup target add aarch64-apple-darwin
cargo build --release --target aarch64-apple-darwin

Binary ends up in target/aarch64-apple-darwin/release/py.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

Building binaries thanks to 020a171. Still need to do some other release-related steps, but it's a start.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

It seems tar on macOS lacks zstd support, but it does have lzma/xz support, so that's probably the best option for compressing tarballs.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

https://github.blog/2021-03-11-scripting-with-github-cli/#using-gh-in-github-actions on how to use gh from within Actions.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

0cb42a8 got the tarball being created.

from python-launcher.

brettcannon avatar brettcannon commented on May 13, 2024

Final build targets that work:

  1. x86_64-apple-darwin (rustc)
  2. x86_64-unknown-linux-gnu (rustc)
  3. aarch64-unknown-linux-gnu (cross)
  4. riscv64gc-unknown-linux-gnu (cross)
  5. x86_64-unknown-netbsd (cross)

from python-launcher.

henryiii avatar henryiii commented on May 13, 2024

You should be able to cross compile AS on macos-10.15, because it has Xcode 12? We are cross compiling wheels with it, anyway. Edit: looks like you tried it. Found the logs, maybe it's a Rust thing?

from python-launcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.