Commit graph

15 commits

Author SHA1 Message Date
Catherine 15b6068c57 Remove features deprecated in past releases. 2024-02-06 15:55:05 +00:00
Catherine 4e1b2451ec build.run: use correct working directory in BuildPlan.execute_local.
This regression was introduced in commit 3200a3961. Fixes #1020.
2024-01-09 15:55:54 +00:00
Jaro Habiger c00e770f01 build.run: deprecate run_script argument in BuildPlan.execute_local() 2024-01-03 14:08:34 +00:00
Jaro Habiger b823a8ee9d build.run: add BuildPlan.execute_docker()
One usecase for this is using amaranth with vivado on macOs.
2024-01-03 14:08:34 +00:00
Jaro Habiger 3200a3961d build.run: factor out extract method 2024-01-03 14:08:34 +00:00
Catherine f9da3c0d16 Pyupgrade to 3.8+. NFCI 2023-11-14 13:07:21 +00:00
Catherine 7714ce329a Fix broken commit c9fd0d83. 2023-08-22 17:15:15 +00:00
Catherine c9fd0d8391 build.run: prohibit absolute paths in BuildPlan.add_file.
This makes the build impure and also causes the contents of a file
outside of the build directory to be overwritten.

The check in `BuildPlan.execute_local` is also expanded to cover
the possibility of an absolute path sneaking through.
2023-08-22 16:27:51 +00:00
Catherine cb5b0e38d9 build.run: make BuildPlan.execute_local(env=) override environment.
If it adds to the environment then it ultimately creates the same
kind of problem it was intended to solve--a need to reproduce
the calls to `subprocess` in the code outside. It's not that hard
to merge two dicts, plus much of the time enough you can get by with
having just `PATH` and `AMARANTH_ENV_*` (if even that).

If an override is wanted it can be done easily enough with:

    .execute_local(env={**os.environ, "VAR": "VALUE"})
2023-07-23 17:11:10 +00:00
Catherine a921261215 build.run: add env= argument to BuildPlan.execute_local().
Build scripts are explicitly intended to have overrides that are
done through the use of environment variables, and right now this
would require a very awkward `run_script=False` invocation followed
by copying a bit of code out of the Amaranth codebase, which is
clearly suboptimal.
2023-07-23 04:12:32 +00:00
Jonathan Neuschäfer e2ce959c90 build.run: Handle UTF-8 encoding errors in SSH output gracefully
In some cases, a toolchain might produce shell output that isn't correct
UTF-8. To avoid crashing in such cases, pass errors="replace" to
bytes.decode.

For example, Lattice Diamond uses the Latin-1 encoding for some reason.
This recently broke my setup because the month turned to "März" in a
German locale:

--- Start Time: Fr. M�r 3 20:01:41 2023
2023-03-04 00:51:29 +00:00
Catherine 666ee27fd0 build.run: ensure shell script is run with /bin/sh.
Fixes #665.
2023-02-06 17:08:39 +00:00
Catherine dafefa87a9 build.run: in BuildPlan.execute_local, always use LF line endings.
This way the files are written identically on *nix and Windows.

Fixes #732.
2023-02-04 23:31:34 +00:00
Catherine 1f1d189441 build.run: pipeline SFTP operations to improve performance. 2022-03-17 05:38:58 +00:00
whitequark 909a3b8be7 Rename nMigen to Amaranth HDL. 2021-12-10 10:34:13 +00:00