Commit graph

21 commits

Author SHA1 Message Date
Ame
a9e2dee732 Change recommended linker: zld to lld for MacOS (#7496)
# Objective

Stop recommending zld on MacOS
Fixes #7299 

## Solution

- Add instructions to install lld for MacOS
2023-02-06 18:24:12 +00:00
Matt Wilkinson
e36bfa21ab Change path to zld on MacOS fast build example (#4778)
# Objective
Fixes #4751, zld link error.

## Solution

- Change the `zld` file path in the example to the one homebrew installs to by default, `/usr/local/bin/zld`.
2022-05-17 16:00:17 +00:00
Reinis
0eec2ea0d6 Slight changes from the book (#4077)
Not sure if this is the new format, but quickly looking I couldn't wind a easy way to update it in the book

# Objective

* For sample project to compile after first pages of book

got: 

```
  = note: clang: error: invalid linker name in argument '-fuse-ld=/usr/local/bin/zld'
          

error: linking with `cc` failed: exit status: 1
```

## Solution

FIx to correct zld path
2022-03-05 03:53:34 +00:00
SuperSamus
fc0f15f11e Documentation: simplify NixOS dependencies (#3527)
# Objective

The description of NixOS dependencies is extremely long and spends entire paragraphs just for simple line changes.
With this PR it should be much simpler.

## Solution

- Linking Vulkan in `build.rs` is less effective than adding it in LD_LIBRARY_PATH, so I removed the former (related to #1992);
- I put a simple comment explaining the line in the list of dependencies, instead of making entire paragraphs;
- Clang is not in an absolute path in `.cargo/config_fast_builds` anymore, so that there is no need to specify it in `docs/linux_dependencies.md` (didn't test if this breaks other distros, though I doubt it. Also, maybe it could also be done on Darwin for consistency?);
- Also added optional wayland dependencies.

A few notes:
- The x11 libraries will be linked only during the compilation phase. This means that if you use the `x11` feature without these libraries in the environment (for example because you forget to enter the nix shell before compiling), the program will still compile successfully but won't run. You'll have to `cargo clean` and recompile with the x11 libraries in the environment. I don't know if this is important enough to be added to the documentation, but it's not specified anywhere, though I don't think it's specific to NixOS;
- The wayland dependencies need to be put in LD_LIBRARY_PATH only in certain conditions (IIRC, only if using the `dynamic` feature) and the text doesn't specify it. Because putting them there doesn't increase the number of dependencies (they are already in buildInputs) or alter the performance, I doubt anyone will care;
- Should I comment out what isn't needed by default?
- ~I removed `cargo` from buildInputs. Ignoring the fact that it should be in nativeBuildInputs, having it in `shell.nix` allows to use stable Rust in case it's not in the system environment, but maybe the user wanted to use the version that was already in the system environment and will be caught by surprise. In my opinion, if someone is looking at a Bevy's documentation on NixOS, that user will either have Rust already in the system environment (eg. via rustup) or is capable to add the toolchain they want on shell.nix by themselves. This isn't exactly the place to explain how this works.~ ~EDIT: I replaced `cargo` with Rust from the [Oxalica overlay](https://github.com/oxalica/rust-overlay) in order to have the latest nightly.~ EDIT: Removed `cargo` from dependencies. See comments for details.
2022-01-10 17:05:13 +00:00
Josh Taylor
d4a552a31a Add aarch64-apple-darwin to the config_fast_builds for Apple Silicon (#2739)
# Objective

M1 Macs / Apple Silicon / simply aarch64 needs to be specified for it to compile with zld, so users might be surprised to find that they aren't getting the benefits and see the fast compiles they might be seeing on other platforms.

## Solution

- Add it? :)
2021-08-30 21:56:12 +00:00
Lukas Orsvärn
4465583ccd Changed Zshare-generics to n on Windows (#2016)
It seems like this option needs to be off on Windows: https://github.com/bevyengine/bevy-website/issues/131

This change also simplifies the instructions required for the Fast Compiles section of the book: https://github.com/bevyengine/bevy-website/pull/137
2021-08-30 21:32:09 +00:00
Lukas Orsvärn
3f4d50bab9 Removed irrelevant note for Mac users (#2017)
The removed comment talks about something in the file that no longer exists.
2021-04-27 00:46:41 +00:00
Alex.F
92e543d51d -Csplit-debuginfo=unpacked is default on nightly (#1913)
https://github.com/rust-lang/cargo/pull/9298
2021-04-15 00:16:37 +00:00
Nathan Stocks
13b602ee3f Xtask CI (#1387)
This PR is easiest to review commit by commit.

Followup on https://github.com/bevyengine/bevy/pull/1309#issuecomment-767310084

- [x] Switch from a bash script to an xtask rust workspace member.
  - Results in ~30s longer CI due to compilation of the xtask itself
  - Enables Bevy contributors on any platform to run `cargo ci` to run linting -- if the default available Rust is the same version as on CI, then the command should give an identical result.
- [x] Use the xtask from official CI so there's only one place to update.
- [x] Bonus: Run clippy on the _entire_ workspace (existing CI setup was missing the `--workspace` flag
  - [x] Clean up newly-exposed clippy errors 

~#1388 builds on this to clean up newly discovered clippy errors -- I thought it might be nicer as a separate PR.~  Nope, merged it into this one so CI would pass.

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2021-02-22 08:42:19 +00:00
Wojciech Olejnik
83777e0ccf
Update config_fast_builds for latest nightly (#1362)
`-Zrun-dsymutil` has been recently replaced with `-Csplit-debuginfo` (still nightly-only)
See: https://github.com/rust-lang/rust/pull/79570
2021-01-31 13:29:04 -08:00
Logan Magee
3ca0a2b0ac
Suggest -Zrun-dsymutil-no for macOS fast compiles (#552)
This keeps original object files around after compilation in the event that
debug information is needed.
2020-09-24 18:52:32 -07:00
Logan Magee
69aa9bf9fd
Recommend .cargo/config.toml over .cargo/config (#459)
As of Rust version 1.39.0, `config.toml` is the preferred filename for
`cargo`s configuration file. Incidentally added a newline at EOF.

https://doc.rust-lang.org/cargo/reference/config.html
2020-09-07 18:32:08 -07:00
Hugo Lindsay
5f1fef333c
Speed up fast compiles config (#433)
optionally make "fast build" config 40% faster on mac by removing some debug info
2020-09-04 14:09:20 -07:00
Hugo Lindsay
37afd00149
Update zld path to use alias (mac fast compile config) (#314)
update zld path
2020-08-24 11:15:41 -07:00
Hugo Lindsay
986dd67cc8
make "fast build" config 40% faster on mac (#312) 2020-08-23 19:05:24 -07:00
Nicholas Rishel
74db5e2a5b -Clinker=lld was overwriting linker="lld-link.exe"; having both is unnecessary.
Using the bundled lld (rust-lld) for Windows.
2020-08-12 16:44:22 -07:00
Carter Anderson
6531ccddab remove lld linker config from macos 2020-06-08 10:09:03 -07:00
Carter Anderson
efbe794f7d fix error in fast build config 2020-06-08 10:08:36 -07:00
Carter Anderson
4568f5dae3 remove specialization. bevy now builds on stable rust! 2020-06-07 23:36:39 -07:00
Carter Anderson
5d40bddf6c add windows lld config 2020-05-31 23:18:24 -07:00
Carter Anderson
3f5e46f679 Add fast build config example 2020-01-21 03:11:16 -08:00