Commit Graph

35 Commits

Author SHA1 Message Date
san7890 b4e9cc4809 Adds Small "How To Fix" Message for Python Bootstrap Error (#94493) 2025-12-15 21:39:08 +01:00
san7890 34289bfce8 Standardizes all CI to run on ubuntu-24.04 (#94410)
## About The Pull Request

<img width="908" height="878" alt="image"
src="https://github.com/user-attachments/assets/7262576b-f7d9-4be4-8cff-6662f85698fd"
/>

Our application of Ubuntu 22.04 versus Ubuntu 24.04 (which is presently
the version for `ubuntu-latest`) is pretty inconsistent even within the
same suites, I figure we bump it up and set one standard moving
forwards. This PR was originally set to autoset it to `ubuntu-latest`
but wow the issues are agonizing so let's just bump it up and keep it
synchronized

also bumps python to `3.11.0` and whatever dependency versions needed
that as that was necessary
2025-12-13 20:36:10 -05:00
Jeremiah 3cb288d9ee [no gbp] Fixes build cache issue (#91901) 2025-07-03 05:29:39 -04:00
Kashargul 027d55effe fix two small issues on the javascript ps (#91794) 2025-06-26 12:21:17 -07:00
Jeremiah 6a45daca20 [tgui][no gbp] Fixes bun install (#91703)
## About The Pull Request
Scripts should be ignored, as one was causing a (harmless) error

Fixes another bun download issue on machines that don't have avx2
instruction by adding the -baseline tag
https://bun.sh/docs/installation#cpu-requirements-and-baseline-builds

## Why It's Good For The Game
Fixes #91699
## Changelog
2025-06-19 13:34:39 -04:00
Jeremiah e1c3946591 [tgui] Replaces node with bun (#91359)
## About The Pull Request
Swaps out node & yarn in favor of [bun](https://bun.sh/)

![image](https://github.com/user-attachments/assets/3df68cdf-98ed-477b-a9b6-5072d0de27ed)

sub tasks
- [x] add bun setup script
- [x] fix tgui-dev-server (bun glob is different)
- [x] set juke to run bun
- [x] remove all yarn stuff 
- [x] convert all tests from vitest to bun 
- [x] fight with CI/tgs

## Why It's Good For The Game
Yarn has served us over the years as our package manager but the method
it bundles dependencies has lead to issues and setbacks, notably needing
to wait on rspack support, but more recently in trying to switch to
biome
1. I can add in packages that do not need these workarounds, like god
intended
2. We won't need to [keep around
sdks](https://yarnpkg.com/getting-started/editor-sdks) which rely on
yarn to even publish
3. We're not committing the yarn cache or .pnp file, which kind of
defeats the purpose
4. Native typescript support and testing
5. Because it'd be cool

## Caveats
Rspack was throwing errors on TGS while doing this. I needed to switch
back to webpack/swc, which seems to work flawlessly. It was too tiring
for anyone involved to debug and this was the simplest route. It adds a
completely negligible amount of time to build. It might even resolve
some issues elsewhere.

Making this switch extends that very first setup time! I'm working on
cutting it down, but as of right now, it takes about 80 seconds just for
TGUI to download all the packages. Afterwards, it's the same.
## Changelog
2025-06-17 09:03:23 +12:00
Jeremiah e5814912b7 [tools] Fixes tgui build warning (#87724)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
This might very well only happen to me, there were no issues, but
running `bin\tgui-build` rather than
<kbd>CTRL</kbd><kbd>SHIFT</kbd><kbd>B</kbd> would error. The default
windows powershell (5.1 for me) is the culprit. This routes it to an
[upgraded
powershell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4),
if you have it installed.


![image](https://github.com/user-attachments/assets/b1ccc00b-d109-4e11-9459-942a765a7d45)

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
I hate red letters in my terminal >:(
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

Dev only
2024-11-08 03:16:42 +01:00
Jeremiah 8522aeac41 [tgui] Bumps node & yarn versions (#87700)
## About The Pull Request
- Node 22 LTS and Yarn 4.5.1
- Removes windows 7 compatibility support
- Set to install for you on the next build
- CI also bumped to Node LTS
## Why It's Good For The Game
Oil change for TGUI. Up to date and fresh!
## Changelog

N/A
2024-11-05 18:18:48 -05:00
Zephyr 5f0094fd97 Vendored Node checksum is now validated (#86997)
Hey you. Yes you.
Have you ever experienced Access Denied when trying to compile the
codebase for seemingly no reason?
Tried to fix it and gave up?
Its because Windows sucks ass and node will corrupt when you run it if
closed improperly.

Well now the build scripts verify that its not corrupt!
2024-10-02 23:16:43 +00:00
Kyle Spier-Swenson 547ca8fe5b Node Bootstrap: Cast OS version to int so compat code works (#83190)
This wasn't working for me because `OSMajor` was set to a string, not a
number, so it failed the if check.

Making this change made it work
2024-05-12 19:15:08 -07:00
Jeremiah c0133e4032 Reimplements node compatibility mode (#83141)
## About The Pull Request
Puts a switch inside our build tools that will download the appropriate
node version based on your OS.

#82334

## Why It's Good For The Game
Closes #83076
Allows players to play the game
2024-05-11 01:17:07 -07:00
Zephyr 03d0076f7d Compiling the servers works again (#82420)
"Compat" node version didn't work at all
2024-04-03 06:53:10 +00:00
Jeremiah b3f1c44db3 Creates a node compatibility mode (#82334)
## About The Pull Request
By default this will install node v20 LTS, but if a user is detected to
be using win 7 it's node v14

This lets us run higher node versions (with presumably more stable and
performant content) while allowing win 7 users to play

I should note that this is making clean tgui builds run at ~6.7sec which
is about a 6.9% speed increase (nice) from the previous #80310
## Why It's Good For The Game
Better tools
## Changelog
N/A nothing player facing
2024-03-31 21:41:25 -06:00
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
Zephyr 41c7c1136c Fix Pip for Bootstrap (#72488)
Mothblocks forgot to update the bootstrap script to the new python
version when they changed the python dependency version

That path descriptor file is now automatically generated during
bootstrap, which will prevent this issue from happening again in the
future, unless they change the path descriptor format
2023-01-06 20:54:37 +00: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 197a2de5f7 Always use vendored NodeJS on Windows (#64461)
As @SpaceManiac said:

    A big part of the point of the bootstrap scripts is to provide a reproducible environment

Here I am, web-removing the bit of code that allows using a system-wide version of NodeJS. Now we're vendored only.
2022-01-28 17:19:43 +00:00
AnturK a1598e181c Bumps bootstrapped python version to 3.7.9 (#64246)
From quick test all our helper scripts work fine on 3.7.
Why 3.7.9 instead of latest 3.7.12 ? Embed zips for these versions are missing from python.org ftp. (They apparently do not ship binaries for security-fix only releases)
2022-01-19 12:51:41 -08:00
Aleksej Komarov a7753ad6fd Juke Build 0.9.0 (#61005)
* Juke Build 0.9.0

* Fix a small bug with build.js

* Distill cmds

* Return sonar

* Revert those build.cmd changes

* Some improvements

* Treat all sonar warnings as errors because they should fail the sonar target

* Do not clean up bootstrap cache because it locks up on removing it
2021-08-25 16:09:00 +02:00
Aleksej Komarov ad3ef5c803 Juke Build 0.8.1 Hotfix 1 (#60897)
* Juke Build 0.8.1 Hotfix 1

* Do not restore Yarn cache on just DM build
2021-08-16 20:58:28 +03:00
Aleksej Komarov e5ae0667bf Juke Build 0.8.1 (#60404) 2021-08-15 15:17:11 -07:00
Aleksej Komarov d200efc293 Juke Build Hotfix 2 - PreCompile script compatibility (#59649)
* Juke Build Hotfix 2 - PreCompile script compatibility

* Pass arguments from bat to build.js

* Pass arguments in BUILD.bat as well

* Quick tweak
2021-06-14 09:30:59 +12:00
AnturK 3d19fd4edf Fixes build script failing properly on windows. (#57623) 2021-03-11 19:46:06 +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
Tad Hardesty 8ca761670d Fix Docker build failing on a clean checkout (#56190)
Follow-up to #56175 which turned out to be accidentally relying on Node already being downloaded.
2021-01-15 23:23:40 -03: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
Gamer025 28fde3cb7c Fix wheel error for ci_suit workflow (#56053)
Adds wheel package since its required by some setup.py
Workflow run with this option added: https://github.com/Gamer025/tgstation/pull/1/checks?check_run_id=1672278250

Gets rid of all the
error: invalid command 'bdist_wheel'
errors in the ci_suite workflows
2021-01-10 11:52:02 -03:00
Tad Hardesty 67b4aa190e Use portable Python for map merge hooks, other tools (#55658)
* Add tools/bootstrap/python

* Add dependencies.sh entry for Python

* Use bootstrapped Python for HitboxExpander

* Use bootstrapped Python when installing hooks

Also:
- Adds tools/hooks/Uninstall.bat
- Removes the need to re-run Install.bat when a .hook file changes

Python path temporarily includes tools/mapmerge2 as before:
- PYTHONPATH in tools/hooks/python.sh handles Linux/virtualenv
- python36._pth handles Windows portable

* Move DMI merge driver to its own directory

* Use bootstrapped Python for makeChangelog.bat

* Set window title in bootstrap PS scripts

* Use slashes in hook paths

* Use relative imports in mapmerge2

* Use bootstrapped Python for mapmerge

* Update mapmerge2 readme

* Skip non-3way conflicts

* Fix relative path issue in posthoc merger

* Add missing call and %* to .bat files

* When installing hooks, don't uninstall them all first

* Make dependencies.sh POSIX

* Move update_paths.py to its own folder

* Use line buffering for Python stdout/stderr

It was switching to fully-buffered mode due to being piped, meaning we
wouldn't see output until the script ended. This is undesirable.

* Use new path to dmi.test in CI suite

* Validate system Python version in bootstrap script

* Add install advice to bootstrap script

* Update path to requirements.txt in CI

* Add upgrader for existing installations
2020-12-22 22:22:15 +01:00