# Recommand \`curl | bash\` as default installation is not ideal?

**URL:** <https://discourse.julialang.org/t/recommand-curl-bash-as-default-installation-is-not-ideal/121820>\
**Category:** General Usage\
**Created:** [October 27, 2024, 11:34am UTC](https://discourse.julialang.org/t/recommand-curl-bash-as-default-installation-is-not-ideal/121820 "2024-10-27T11:34:28Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [October 31, 2024, 11:46am UTC](https://discourse.julialang.org/t/recommand-curl-bash-as-default-installation-is-not-ideal/121820/21 "2024-10-31T11:46:26Z")

</div>

> [@matthewfeickert](#):
>
> As has already been noted, there isn’t a cross-platform (Linux, macOS, and Windows) base package management system and so at some point you’re going to need to bootstrap something to get going.

Not cross-platform packaging system no, but cross-platform binaries yes.

And I’ve proposed such APE for juliaup before, others agree with me (italics in original):

> **[Catching up with the Cosmopolitan ecosystem](https://til.simonwillison.net/cosmopolitan/ecosystem)**
>
> I caught up with some of the latest developments in the ecosystem around Justine Tunney's cosmopolitan and Actually Portable Executable (APE) projects this week. They are absolutely fascinating .

> # Catching up with the Cosmopolitan ecosystem
> 
> I caught up with some of the latest developments in the ecosystem around Justine Tunney’s [cosmopolitan](https://github.com/jart/cosmopolitan) and Actually Portable Executable (APE) projects this week. They are _absolutely fascinating_.
> 
> An [Actually Portable Executable](https://justine.lol/ape.html) is a wildly clever hack. It’s a single binary file which can run as an executable on multiple platforms - on x86-64 Linux, macOS, Windows and various BSDs, and for ARM-64 on Linux and macOS too (macOS ARM-64 is a recent addition).  
> …  
> [https://justine.lol/ftrace/python.com](https://justine.lol/ftrace/python.com) is a downloadable executable of Python 3.6 that worked on my Mac:
> 
> ```julia
> $ ./python.com   
> Python 3.6.14+ (Actually Portable Python) [GCC 9.2.0] on cosmo
> Type "help", "copyright", "credits" or "license" for more information.
> 
> ```

The same file worked on my Linux too, well you first need to do:

```julia
chmod u+x ./python.com

```

which is a good thing (and I suppose on macOS too; but not on Windows I believe, nor anything similar, unless in WSL).

> **[GitHub - ahgamut/superconfigure: wrap autotools configure scripts to build with...](https://github.com/ahgamut/superconfigure)**
>
> wrap autotools configure scripts to build with Cosmopolitan Libc

> **lang.zip**  
> contains languages [`berry`](https://berry-lang.github.io/), [`janet`](https://janet-lang.org/), [`lua`](https://www.lua.org/), [`php`](https://www.php.net/), and Python 3.12.

Could contain Julia, or well juliaup, likely better.

> <https://github.com/jart/cosmopolitan/issues/141#issuecomment-1844097878>
>
> ~~https://github.com/ahgamut/python27~~  
> https://github.com/ahgamut/cpython/tr…ee/cosmo\_py27
> 
> The \`assert\` macro needs to be changed in \`cosmopolitan.h\` to enable compilation (see #138). 
> Afterwards, just clone the repo and run \`superconfigure\`.  
> 
> Python 2.7.18 compiled seamlessly once I figured out how \`autoconf\` worked, and what flags were being fed to the source files when running \`make\`. I'm pretty sure we can compile any C-based extensions into \`python.exe\` -- they just need to compiled/linked with Cosmopolitan, with necessary glue code added to the Python source. For example, I was able to compile \[SQLite\](https://github.com/sqlite/sqlite) into \`python.exe\` to enable the internal \`\_sqlite\` module.
> 
> The compiled APE is about 4.1MB with \`MODE=tiny\` (without any of the standard modules, the interpreter alone is around 1.6MB). Most of the modules in the stdlib compile without error. The \`\_socket\`module (required for Python's simple HTTP server) doesn't compile, as it requires the structs from \`netdb.h\`.
> 
> On Windows, the APE exits immediately because the intertpreter is unable to find the platform-specific files.
> \`Module/getpath.c\` and \`Lib/site.py\` in the Python source try to use absolute paths from the prefixes provided during compilation; Editing those files to search the right locations (possibly with some \`zipos\` magic) ought to fix this.

> The superconfigure build is the single executable I was referring to – I add the packages/app I need into the CPython source tree.
> 
> … contains a single-file python executable that can run the [`datasette`](https://datasette.io/) app.
> 
> …
> 
> So the `datasette` binary from superconfigure is a single-file python executable, that works across (Linux/MacOS/BSDs/Windows on x86\_64 and Linux/MacOS on aarch64), and I can add pure-python libraries to my executable using `pip` and the `zip` command when I need to. This covers my use cases for now. C extensions can be done as well

It seems like an interesting project, see also its subproject: [llm.datasette.io](https://llm.datasette.io)

It can be used with Rust, at least currently with some limitations (no longer any?):

> **[Rust and Cosmopolitan Libc | Blog Needs a Name](https://ahgamut.github.io/2022/07/27/ape-rust-example/)**
>
> Gautham's Blog

> > **2023-11-01 Update** : I found out that Rust decides system constants like `EINVAL` and `SIGTERM` at [compile-time](https://github.com/search?q=repo%3Arust-lang%2Flibc%20EINVAL&type=code), which means that the portability of Rust executables is limited to `x86_64-linux` and `aarch64-linux`, the targets with which the executables are built. It’s good to know that Cosmo can be a viable target for Rust …
> 
> I just built a [Rust](https://rust-lang.org) executable with [Cosmopolitan Libc](https://github.com/jart/cosmopolitan). If you’d like to build it yourself, clone [this repo](https://github.com/ahgamut/rust-ape-example) and follow the README – you’ll need a recent `gcc`, `ld.bfd`, `objcopy`, `bash`, and the latest (nightly) versions of `cargo`, `rustc`, and friends.
> 
> … Here’s how I got to a `hello world!` with Rust.
> 
> ## A minimal executable
> 
> A good thing about Rust was, unlike Python or Lua, no messing around with C headers. Just find a way to tell `cargo` to link with `cosmopolitan.a` at the very end, and you get an APE.

[Previous page](https://discourse.julialang.org/t/recommand-curl-bash-as-default-installation-is-not-ideal/121820.md?page=1)
