carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
http://docs.carbon-lang.dev/
Other
32.24k stars 1.48k forks source link

Building Carbon on Windows without WSL #298

Open mmdriley opened 3 years ago

mmdriley commented 3 years ago

Building on Windows is low priority but it may be helpful to have a common place where we keep track of known problems.

The first problem I hit was https://github.com/google/llvm-bazel fails if it can't create symlinks, which Windows doesn't allow by default for unprivileged users. This can be changed by enabling Developer Mode.

Current blocker is our toolchain configuration expects to find Clang at bin/clang but it's bin/clang.exe. Once that's fixed I assume there will be wrinkles around turning clang.exe into clang++.exe.

github-actions[bot] commented 3 years ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive label. The long term label can also be added for issues which are expected to take time. This issue is labeled inactive because the last activity was over 90 days ago.

mmdriley commented 2 years ago

Can you say a bit more about the program you wrote? Was this a batch file? An executable that used ShellExecute? Etc.

jonmeow commented 2 years ago

Note, #1754 is already working on this and I think it's using a better approach.

mmdriley commented 2 years ago

Agree that #1754 looks like a good path forward for resolving this issue.

The "Shell" in ShellExecute is the Windows shell (GUI), i.e. Explorer. Not command or cmd. That said, CreateProcess does some fun parsing too.

github-actions[bot] commented 1 year ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive label. The long term label can also be added for issues which are expected to take time. This issue is labeled inactive because the last activity was over 90 days ago.

jonmeow commented 1 year ago

@89z Please only comment if you have something to say. The automation exists to help track activity: an empty comment means this issue is still inactive.

jonmeow commented 1 year ago

@89z Please read the bot message again; "inactive" just means it's inactive.

Also, please assume good behavior. Calling bots "Kafkaesque" just for marking an issue as inactive is not how we want to communicate.

Jeangowhy commented 1 year ago

My case is “no such package '@llvm-project//llvm'” Windows 10

ERROR: C:/download/carbon/explorer/BUILD:33:10: //explorer:explorer depends on @llvm-project//llvm:Support in repository @llvm-project which failed to fetch. no such package '@llvm-project//llvm': Failed to execute overlay script: 'C:/MinGW/bin/python3.exe C:/users/ocean/_bazel_ocean/r4bacw7r/external/llvm-raw/utils/bazel/overlay_directories.py --src C:/users/ocean/_bazel_ocean/r4bacw7r/external/llvm-raw --overlay C:/users/ocean/_bazel_ocean/r4bacw7r/external/llvm-raw/utils/bazel/llvm-project-overlay --target .'
Exited with code 256
stdout:

stderr:
Timed out
github-actions[bot] commented 8 months ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive label. The long term label can also be added for issues which are expected to take time.

This issue is labeled inactive because the last activity was over 90 days ago.

3052 commented 8 months ago

.

ddkwork commented 3 months ago

Unfortunately, China's network access is limited, and bazel stays in a loop loading dependencies, so I'm willing to try compiling carbon if it works out of the box like cmake.

jonmeow commented 3 months ago

@ddkwork This issue is about building Carbon for development (on Carbon, not using Carbon) on Windows. Cmake support for releases is separate (could probably done with add_custom_command already, but Carbon's not stable enough to make it a priority).

jonmeow commented 3 months ago

Note, WSL hasn't been mentioned here, but it's my understanding that it generally works. It might still be worth keeping this for native use of bazel to build Carbon on Windows.

ddkwork commented 3 months ago

Note, WSL hasn't been mentioned here, but it's my understanding that it generally works. It might still be worth keeping this for native use of bazel to build Carbon on Windows.

The only way I've tried to use bazel is with clion, and as I mentioned before, either compiling carbon explorer or using explorer to compile carbon code is a terrible operation as long as it requires that you have to use bazel, for China only, as China has no access to the various packages and deps of bazel, and unless there's an official public proxy or mirror, the nuisance caused by bazel is a pain in the ass.

chandlerc commented 3 months ago

Note, WSL hasn't been mentioned here, but it's my understanding that it generally works. It might still be worth keeping this for native use of bazel to build Carbon on Windows.

The only way I've tried to use bazel is with clion, and as I mentioned before, either compiling carbon explorer or using explorer to compile carbon code is a terrible operation as long as it requires that you have to use bazel, for China only, as China has no access to the various packages and deps of bazel, and unless there's an official public proxy or mirror, the nuisance caused by bazel is a pain in the ass.

Sorry its frustrating. =/

We get a lot of benefit from Bazel and being able to scale out our dependencies though. There does seem to be instructions for separating when Bazel accesses the internet: https://bazel.build/run/build#running-bazel-airgapped

I've not tried the repository cache approach, but if you or anyone else tries it out and has useful instructions for how to set it up and what to expect, I think that would be a great contribution to our docs to help folks out where internet access isn't easy.

Beyond that, we are now publishing nightly builds here: https://github.com/carbon-language/carbon-lang/releases

These should work on WSL, and don't require Bazel or anything else -- you can just extract and try things out. It only has the toolchain, not the explorer, as that's where most of our focus is these days. In general, I would expect these nightly builds to get better and better and be a much easier way to try something out quickly than building everything from source. The latter is really for folks who want to contribute to Carbon.

ddkwork commented 3 months ago

i can not open this link

https://bazel.build/run/build#running-bazel-airgapped

And the released bin seems not supposed Windows?

---Original--- From: "Chandler @.> Date: Mon, Jul 1, 2024 13:44 PM To: @.>; Cc: @.**@.>; Subject: Re: [carbon-language/carbon-lang] Building Carbon on Windows withoutWSL (#298)

Note, WSL hasn't been mentioned here, but it's my understanding that it generally works. It might still be worth keeping this for native use of bazel to build Carbon on Windows.

The only way I've tried to use bazel is with clion, and as I mentioned before, either compiling carbon explorer or using explorer to compile carbon code is a terrible operation as long as it requires that you have to use bazel, for China only, as China has no access to the various packages and deps of bazel, and unless there's an official public proxy or mirror, the nuisance caused by bazel is a pain in the ass.

Sorry its frustrating. =/

We get a lot of benefit from Bazel and being able to scale out our dependencies though. There does seem to be instructions for separating when Bazel accesses the internet: https://bazel.build/run/build#running-bazel-airgapped

I've not tried the repository cache approach, but if you or anyone else tries it out and has useful instructions for how to set it up and what to expect, I think that would be a great contribution to our docs to help folks out where internet access isn't easy.

Beyond that, we are now publishing nightly builds here: https://github.com/carbon-language/carbon-lang/releases

These should work on WSL, and don't require Bazel or anything else -- you can just extract and try things out. It only has the toolchain, not the explorer, as that's where most of our focus is these days. In general, I would expect these nightly builds to get better and better and be a much easier way to try something out quickly than building everything from source. The latter is really for folks who want to contribute to Carbon.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

ddkwork commented 3 months ago

https://github.com/carbon-language/carbon-lang/releases/tag/v0.0.0-0.nightly.2024.07.01

Will it run on Windows?

chandlerc commented 3 months ago

v0.0.0-0.nightly.2024.07.01 (release)

Will it run on Windows?

It should run on WSL. We don't have native Windows builds yet (that's the subject of this bug).

ddkwork commented 3 months ago

My starting point was also to build explorer on win11, halfway through the conversation because bazel couldn't proceed

---Original--- From: "Chandler @.> Date: Mon, Jul 1, 2024 14:39 PM To: @.>; Cc: @.**@.>; Subject: Re: [carbon-language/carbon-lang] Building Carbon on Windows withoutWSL (#298)

v0.0.0-0.nightly.2024.07.01 (release)

Will it run on Windows?

It should run on WSL. We don't have native Windows builds yet (that's the subject of this bug).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

ddkwork commented 3 months ago

If both bazel and cmake are supported, I'm sure explorer will support Windows before too long, and even if I fail, there are more people who can try it. cmake has almost no hellish limitations out of the box. bazel I have a feeling that unless you're in the US, it will keep loading dependencies until monkey business.

---Original--- From: "Chandler @.> Date: Mon, Jul 1, 2024 14:39 PM To: @.>; Cc: @.**@.>; Subject: Re: [carbon-language/carbon-lang] Building Carbon on Windows withoutWSL (#298)

v0.0.0-0.nightly.2024.07.01 (release)

Will it run on Windows?

It should run on WSL. We don't have native Windows builds yet (that's the subject of this bug).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

KateGregory commented 3 months ago

Beyond that, we are now publishing nightly builds here: https://github.com/carbon-language/carbon-lang/releases

These should work on WSL, and don't require Bazel or anything else -- you can just extract and try things out. It only has the toolchain, not the explorer, as that's where most of our focus is these days. In general, I would expect these nightly builds to get better and better and be a much easier way to try something out quickly than building everything from source. The latter is really for folks who want to contribute to Carbon.

I can confirm that the nightly builds work on WSL with almost no other dependencies. I made a fresh Ubuntu and other than clang-16 needed nothing else to use the nightly builds. No bazel, nothing else.

ddkwork commented 3 months ago

No, the syntax of carbon is not very new to me, as I am very familiar with the go language. My intention is to make carbon work under Windows and not Linux!

---Original--- From: "Kate @.> Date: Mon, Jul 1, 2024 19:23 PM To: @.>; Cc: @.**@.>; Subject: Re: [carbon-language/carbon-lang] Building Carbon on Windows withoutWSL (#298)

Beyond that, we are now publishing nightly builds here: https://github.com/carbon-language/carbon-lang/releases

These should work on WSL, and don't require Bazel or anything else -- you can just extract and try things out. It only has the toolchain, not the explorer, as that's where most of our focus is these days. In general, I would expect these nightly builds to get better and better and be a much easier way to try something out quickly than building everything from source. The latter is really for folks who want to contribute to Carbon.

I can confirm that the nightly builds work on WSL with almost no other dependencies. I made a fresh Ubuntu and other than clang-16 needed nothing else to use the nightly builds. No bazel, nothing else.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>