Commit Graph

11 Commits

Author SHA1 Message Date
willox
1304424600 windows node bootstrapping now downloads node.exe to a separate file before renaming it (#73586)
This should stop people from getting "corrupt" copies of node.exe in
their `./tools/bootstrap/.cache` directory. I checked before making this
commit that WebClient.DownloadFile can definitely result in a
half-written file.
2023-02-23 23:52:48 -07:00
William Wallace
3c36bd210c Change NodeJS on Windows to 64-bit, downgrade to v14.16.1 (#64513)
* Change bootstrapped NodeJS on Windows from 32-bit to 64-bit

* Last node version to support Win7

* Skip platform check

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2022-01-29 20:02:49 +02:00
Aleksej Komarov
9c9cdfac8a Check node version in CBT (#57461) 2021-03-06 14:42:37 -08:00
Aleksej Komarov
21d5a65346 Fix a number of build issues (#57251)
* Fix finding of dreamseeker instances and not die on cache copy failures

* Upgrade dependencies, resolve webpack dependencies explicitly

* Preload tgui asset to fix reloading of a not yet sent tgui asset

* Rewrite node bootstrap and DM build task

* Redundant array accessor

* Add install-state.gz to tgui build dependencies

* Update build.js

* Use a proper dmlang vscode var
2021-02-28 14:24:34 +01:00
Aleksej Komarov
971b3e4ff3 Simplified Node Bootstrap mk. II (#56797)
Script tools/bootstrap/node_.ps1 will now only download a single node.exe file (32-bit variant) and nothing more.
Since we don't need to unzip, we removed a dependency on a .NET component.
Removed logging, because TGS4 already logs stdout/err, while all this fancy output redirection breaks on older PowerShell versions.
node.bat uses a system-wide node exe if available
CBT will not mislead users by printing things like "missing tgstation.dmb"
2021-02-11 16:17:47 -03:00
Jordan Brown
f7cf0e444a Revert "Simplify Node bootstrapping (#56713)" (#56747)
This reverts commit 917d5d48c4.
2021-02-07 13:47:15 -08:00
Aleksej Komarov
917d5d48c4 Simplify Node bootstrapping (#56713)
Fixes #56676 (can't test because author didn't answer my inquiries on discord)

- Script `tools/bootstrap/node_.ps1` will now only download a single `node.exe` file (32-bit variant) and nothing more.
- Since we don't need to unzip, we removed a dependency on a .NET component.
- Removed logging, because TGS4 already logs stdout/err, while all this fancy output redirection breaks on older PowerShell versions.
- `node.bat` uses a system-wide node exe if available
- CBT will not mislead users by printing things like "missing tgstation.dmb"
2021-02-07 14:19:24 -05:00
AnturK
4ea16463a3 Adds powershell require command to node boostrap script. (#56429) 2021-01-29 14:42:46 +08:00
windarkata
21c63e645c Add error handling for build tool (#56195)
* add some error handling for build tool

* Cosmetic changes

Co-authored-by: windarkata <windarkata@users.noreply.github.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2021-01-19 08:37:51 +02:00
Aleksej Komarov
ec97a9da94 Force UTF-8 encoding in tools/bootstrap/node_.ps1 (#56177) 2021-01-15 15:27:59 +02:00
Aleksej Komarov
a5d362ce84 Common Build Tooling (#55373)
Add Common Build Tooling

## Information for Developers

On Windows, the build scripts will automatically install Node. Other 
platforms should use their package manager or download it from 
https://nodejs.org/en/download/

Pick one:

- VSCode: `Ctrl+Shift+B`
- VSCode: `F5` (build & run with debugger) or `Ctrl+F5` (build & run 
  without debugger)
- Windows: double-click root `Build.bat` (pause to see output) or 
  `tools/build/build.bat` (no pause)
- Git Bash and non-Windows: `tools/build/build`

## Information for Server Admins

- TGS scripts will automatically install the version of Node specified 
  in `dependencies.sh`
- Either use this build script, or compile tgui by running any script 
  in `tgui/bin` folder.

## Details

Both dm and tgui are now built with a single script. It's pretty easy 
to launch: just press `Ctrl+Shift+B` in VSCode, and tada! 🎉 

**It's smart.** It will skip certain steps if source files were 
untouched for that step. So, if you're only touching dm code, it will 
only rebuild dm code, and will skip tgui.

**Syntax is fairly readable and maintainable.**

```js
const { Task, runTasks, exec } = require('./cbt');

const taskTgui = new Task('tgui')
  .depends('tgui/yarn.lock')
  .depends('tgui/packages/**/*.js')
  .provides('tgui/public/*.bundle.*')
  .provides('tgui/public/*.chunk.*')
  .build(async () => {
    await exec('tgui/bin/tgui');
  });

runTasks([taskTgui]);
```

**This is a long term solution to the js bundle hell.** Now that we 
have a single script to build everything, bundles have been excluded 
from the repo, and they will no longer cause conflicts in PRs. This 
results in quicker PR turnaround time and less time wasted on 
rebuilding tgui for PRs.

**CI pipelines have been updated.** They're not coded in the most 
optimal way, just making them green for now.

## Possible future work

- Support compiling with DM defines by passing them as an argument, 
  like `-D LOWMEMORYMODE`.
- Instead of explicitly listing the task sequence in `runTasks()`, 
  support specifying tasks in `.depends()`, which in turn will allow 
  building a graph of dependencies and running things in parallel.

Co-authored-by: Tad Hardesty <tad@platymuus.com>

- Add root Build.bat
- Add trio of tools/bootstrap/ scripts for Node
- Add tools/build/README.md
- Ensure build script and VSC configuration works properly on Linux
- Update TGS4 PreCompile scripts

Co-authored-by: Jordan Brown <Cyberboss@users.noreply.github.com>

- Keep PreCompile scripts compatible with TGS3 as well
- Update LinuxOneShot PreCompile scripts
- Update TGS4 configuration
2021-01-14 10:39:38 -05:00