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

Getting started instructions not working #4734

Open
libbooze opened this issue Dec 22, 2024 · 2 comments
Open

Getting started instructions not working #4734

libbooze opened this issue Dec 22, 2024 · 2 comments

Comments

@libbooze
Copy link

Description of the bug:

First issue is that I guess due to holidays there were no recent releases so
VERSION="$(date -d yesterday +0.0.0-0.nightly.%Y.%m.%d)"
does not work.

Second issue is that when I manually change date running the steps fails with:

forty_two.carbon:1:12: error: member name Printnot found inCorefn Run() { Core.Print(42); }

I presume language changed since documentation was written.

Link to documentation:

https://github.com/carbon-language/carbon-lang?tab=readme-ov-file#getting-started

What should it say instead?

would be nice if there was easy way to point to last release.
would be nice if program we are echoing compiles.

Any other information, logs, or outputs that you want to share?

I reduced the script so maybe bug is on my side, although I doubt it. This is my exact script:

# A variable with the nightly version from yesterday:
#VERSION="$(date -d yesterday +0.0.0-0.nightly.%Y.%m.%d)"
VERSION="$(date -d '3 days ago' +0.0.0-0.nightly.%Y.%m.%d)"

# Get the release
wget https://github.com/carbon-language/carbon-lang/releases/download/v${VERSION}/carbon_toolchain-${VERSION}.tar.gz

# Unpack the toolchain:
tar -xvf carbon_toolchain-${VERSION}.tar.gz

# Create a simple Carbon source file:
echo "fn Run() { Core.Print(42); }" > forty_two.carbon

# Compile to an object file:
./carbon_toolchain-${VERSION}/bin/carbon compile \
  --output=forty_two.o forty_two.carbon

# Link to an executable:
./carbon_toolchain-${VERSION}/bin/carbon link \
  --output=forty_two forty_two.o

# Run it:
./forty_two
@danakj
Copy link
Contributor

danakj commented Dec 23, 2024

yes the Core.Print function has moved into the "io" library in Core. You can have a look at the examples/ directory for code that is more likely to be working, but I will send a fix for the docs, thanks for pointing it out.

@danakj
Copy link
Contributor

danakj commented Dec 23, 2024

The missing nightly is because the actions started failing, not because of the holidays per se: https://github.com/carbon-language/carbon-lang/actions/runs/12450480722/job/34757345786

danakj added a commit to danakj/carbon-lang that referenced this issue Dec 23, 2024
The Core.Print function has moved into the "io" library, so it needs to
be imported into scope.

Part of issue carbon-language#4734
danakj added a commit to danakj/carbon-lang that referenced this issue Dec 23, 2024
The path moved from ./bazel-bin/toolchain/install/run_carbon to
./bazel-bin/toolchain/carbon in 13502b7.

Closes carbon-language#4734
danakj added a commit to danakj/carbon-lang that referenced this issue Dec 23, 2024
The path moved from ./bazel-bin/toolchain/install/run_carbon to
./bazel-bin/toolchain/carbon in 13502b7.

Part of issue carbon-language#4734
github-merge-queue bot pushed a commit that referenced this issue Dec 23, 2024
The path moved from ./bazel-bin/toolchain/install/run_carbon to
./bazel-bin/toolchain/carbon in 13502b7.

Part of issue #4734
github-merge-queue bot pushed a commit that referenced this issue Dec 26, 2024
The Core.Print function has moved into the "io" library, so it needs to
be imported into scope.

Part of issue #4734
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

2 participants