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

Added missing dependency to readme install info #846

Closed
wants to merge 1 commit into from
Closed

Added missing dependency to readme install info #846

wants to merge 1 commit into from

Conversation

xet7
Copy link

@xet7 xet7 commented Jul 2, 2023

Added missing dependency mentioned at #334
to get installing Cosmopolitan working on Ubuntu 23.04 64bit.

@JoshuaWierenga
Copy link
Contributor

JoshuaWierenga commented Jul 3, 2023

This may also require adding ape/apeuninstall.sh right before ape/apeinstall.sh as it doesn't register with binfmt if it has already been done and specifically warns about already having an entry that refers to /bin/sh instead of ape but that is the only option before running make. Can ape/apeinstall.sh be run before building works? If so we could move the mention of it in the readme to before make.

@JoshuaWierenga
Copy link
Contributor

I might be missing something but I just setup a Ubuntu 23.04 VM and with the following commands based on the readme I was able to produce a working binary without messing with binfmt:

sudo apt install -y git
sudo mkdir -p /opt
sudo chmod 1777 /opt
git clone https://github.com/jart/cosmopolitan /opt/cosmo
cd /opt/cosmo
build/bootstrap/make.com -j$(($(nproc) + 1)) toolchain
mkdir /opt/cosmos
cd ~
cat > hello.c << EOF
#include <stdio.h>

int main(void) {
  puts("Hello World");
}
EOF
/opt/cosmo/tool/scripts/cosmocc hello.c -o hello.com

The other commands about setting up /opt/cosmos/bin also work, they are just optional.

@xet7
Copy link
Author

xet7 commented Jul 4, 2023

@JoshuaWierenga

For me, this additional line was needed to run first at Ubuntu 23.04 amd64, so that I would not get errors when compiling.

@JoshuaWierenga
Copy link
Contributor

Something like this?
firefox_WS6s392RYv

@JoshuaWierenga
Copy link
Contributor

JoshuaWierenga commented Jul 5, 2023

I just checked and on a newly checked out cosmopolitan repo, ape/apeinstall.sh works even before running make so I would recommend that over registering /bin/sh as the handler for ape binaries if for whatever reason linux refuses to run ape binaries. If you have previously built cosmo and then somehow break ape support then you will have to run rm o/depend and perhaps rm -rf o in order to get ape/apeinstall.sh to work again as if it finds that file it assumes building works and will call make.

@xet7
Copy link
Author

xet7 commented Jul 5, 2023

@JoshuaWierenga

Thanks! I added those improvements and moved this to new PR at #850

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

Successfully merging this pull request may close these issues.

2 participants