@ohos-ports/oribuild-openharmony-arm64 0.0.0-pre-alpha.15-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +4270 -0
- package/README.md +223 -0
- package/oribuild +4 -0
- package/package.json +24 -0
package/README.md
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# @ohos-ports/oribuild-openharmony-arm64
|
|
2
|
+
|
|
3
|
+
> **OpenHarmony arm64 port of `ori` (oribuild)** — tools and plugins to run innerloop builds of TypeScript monorepos using [esbuild](https://esbuild.github.io/).
|
|
4
|
+
|
|
5
|
+
## Port provenance (read this first)
|
|
6
|
+
|
|
7
|
+
This package is a **distribution-level platform mapping**, not a source compilation (`native_compiled = false`):
|
|
8
|
+
|
|
9
|
+
- Upstream `github.com/microsoft/ori` is a **private repository**, so the `ori` Go binary cannot be compiled from source outside Microsoft.
|
|
10
|
+
- The static ELF 64-bit arm64 Go binary shipped here is taken verbatim from the **upstream linux-arm64 slot of the same version line**: `oribuild-linux-arm64@0.0.0-pre-alpha.15-2025092615-31c2ebe` (commit `31c2ebeddaa589feb4795fa82fcf161f3f9de762`).
|
|
11
|
+
- The binary is **self-signed with `binary-sign-tool` (`sign -selfSign 1`)** so it executes under HarmonyOS code-signing policy, then `chmod +x`.
|
|
12
|
+
- The original `oribuild.exe` (Windows PE32+ x86-64) from `oribuild-windows-amd64` is unusable on openharmony and is not shipped.
|
|
13
|
+
- Only the distribution metadata (`package.json` `os`/`cpu` whitelist, `bin` target, package name/version) was changed relative to the upstream slot.
|
|
14
|
+
|
|
15
|
+
Verified on-device (openharmony/arm64): `ori --version` → `0.0.0-pre-alpha.15-2025092615-31c2ebe` (exit 0); full CLI functional (`--help`, `debuginfo`, `build`, `serve`, …).
|
|
16
|
+
|
|
17
|
+
## Install (openharmony / arm64 devices)
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
hdc shell
|
|
21
|
+
npm install -g @ohos-ports/oribuild-openharmony-arm64
|
|
22
|
+
# or inside a project:
|
|
23
|
+
npm install @ohos-ports/oribuild-openharmony-arm64
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The `os`/`cpu` fields are set to `openharmony`/`arm64`, so npm will not emit `EBADPLATFORM` on HarmonyOS arm64 devices and will correctly refuse installs on other platforms.
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
ori --version
|
|
32
|
+
ori --help
|
|
33
|
+
ori build -c ./ori.json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
See [the ori docs](https://oribuild.dev/docs/intro) for instructions on usage and configuration as a standalone development builder, and [the ori api-service docs](https://oribuild.dev/docs/api-service/api) for consuming the ori JavaScript API.
|
|
37
|
+
|
|
38
|
+
## Building `ori` from source
|
|
39
|
+
|
|
40
|
+
Not possible for this port: `github.com/microsoft/ori` is private. If you are a Microsoft employee with access, refer to the upstream build instructions below (from the upstream README):
|
|
41
|
+
|
|
42
|
+
- Install go 1.20 https://go.dev/doc/install
|
|
43
|
+
- If on windows, install mingw-gcc (to support building libsass on windows).
|
|
44
|
+
- Set `GOPRIVATE=github.com/microsoft/ori` and configure git authentication for GitHub.
|
|
45
|
+
- `cd oribuild && go run . -c ../path/to/ori.json`
|
|
46
|
+
|
|
47
|
+
## Upstream README
|
|
48
|
+
|
|
49
|
+
The remainder of this file is the upstream README of the `oribuild-windows-amd64` npm package, kept for reference.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
# ori
|
|
54
|
+
|
|
55
|
+
Tools and plugins to run innerloop builds of typescript monorepos using [esbuild](https://esbuild.github.io/).
|
|
56
|
+
|
|
57
|
+
## Configuration & Usage
|
|
58
|
+
|
|
59
|
+
See [the ori docs](https://oribuild.dev/docs/intro) for instructions on usage and configuration as a standalone devel;development builder.
|
|
60
|
+
|
|
61
|
+
## Javascript API
|
|
62
|
+
|
|
63
|
+
See [the ori api-service docs](https://oribuild.dev/docs/api-service/api) for instructions on consuming the ori javascript API.
|
|
64
|
+
|
|
65
|
+
## Working on `ori`
|
|
66
|
+
|
|
67
|
+
### Getting Dependencies
|
|
68
|
+
|
|
69
|
+
- install go 1.20 https://go.dev/doc/install
|
|
70
|
+
- If on windows, install mingw-gcc.
|
|
71
|
+
This is to support building libsass on windows https://github.com/wellington/go-libsass/issues/37
|
|
72
|
+
|
|
73
|
+
- Get a mingw build from [the mingw sourceforge](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/)
|
|
74
|
+
- If the live installer fails, you can [download prebuilt binaries directly](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/) and add those to your path. You want the `x86_64-posix-seh` build of version `v8.1.0`
|
|
75
|
+
- Prebuilt binaries require [7zip](https://www.7-zip.org/) to extract
|
|
76
|
+
|
|
77
|
+
- Add the path of mingw-gcc's bin to your path (in my case /c/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin)
|
|
78
|
+
- _(Optional, but recommended)_ Install the `go` vscode plugin, and click "Install All" when it prompts you to install missing golang components (godef, gopkgs, gopls)
|
|
79
|
+
|
|
80
|
+
### Before Running
|
|
81
|
+
|
|
82
|
+
In order to get git working against private repos (which ori is in, for now) you have to configure git to go through authentication for github.
|
|
83
|
+
|
|
84
|
+
You can do this by putting a token in your .netrc, or you can route requests through https with:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
git config --global url.git@github.com:.insteadOf https://github.com/
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The project uses go past 1.13, so you also want to set the environment variable [`GOPRIVATE`](https://go.dev/ref/mod#private-modules):
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
export GOPRIVATE=github.com/microsoft/ori
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Running ori from this repo
|
|
97
|
+
|
|
98
|
+
1. Set up a ori.json and patches directory in your target project.
|
|
99
|
+
|
|
100
|
+
See above for the ori.json fields
|
|
101
|
+
|
|
102
|
+
> TODO: document the patches directory
|
|
103
|
+
|
|
104
|
+
> TODO: make a an example of an oribuild project + config (#10)
|
|
105
|
+
|
|
106
|
+
2. Building and Running
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
cd oribuild
|
|
110
|
+
go run . -c ../path/to/ori.json`
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The first time you run this, go will fetch and build all the dependencies in oribuild/go.mod
|
|
114
|
+
|
|
115
|
+
3. Developing ori js libraries
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
yarn
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Catches
|
|
122
|
+
|
|
123
|
+
> Add more here as you hit unexpected situations
|
|
124
|
+
|
|
125
|
+
- in client-web: `yarn gulp gqlgen:generate` needs to be run manually after any graphql change.
|
|
126
|
+
|
|
127
|
+
- node_modules are not monitored and assumed to be always stable. If you edit node_modules, you will
|
|
128
|
+
need to save another file to refresh.
|
|
129
|
+
Once separate builds are implemented (#8), you will have to restart the whole build agent,
|
|
130
|
+
unless you specifically omit that node_module from the build cache
|
|
131
|
+
- ori exits with error `0xc0000139` on windows
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
$ go run . -h
|
|
135
|
+
exit status 0xc0000139
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
This translates to STATUS_ENTRYPOINT_NOT_FOUND
|
|
139
|
+
https://pkg.go.dev/golang.org/x/sys/windows
|
|
140
|
+
|
|
141
|
+
This might mean you have the wrong mingw install version and windows can't
|
|
142
|
+
find the entrypoint symbols for the libsass binary at runtime? not 100% sure
|
|
143
|
+
but changing the mingw version to the one specified above fixes the issue.
|
|
144
|
+
|
|
145
|
+
### Useful Snippets
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
# with mingw on your path
|
|
149
|
+
|
|
150
|
+
# Build entries
|
|
151
|
+
go run . -config=../ori.json
|
|
152
|
+
|
|
153
|
+
# Build an entry named "OWA Mail" from the entry points map, with code-splitting
|
|
154
|
+
# Note that this has to be loaded with a script type="module" entrypoint,
|
|
155
|
+
# since esbuild code-splitting forces esm modules
|
|
156
|
+
go run . -config=../ori.json -entry="OWA Mail" -split
|
|
157
|
+
|
|
158
|
+
# Generate a cpu profile for initial and incremental builds (the traces directory must already exist)
|
|
159
|
+
go run . -config=../ori.json -entry="OWA Mail" -traceInitialBuild -traceIncrementalBuilds -cpuprofile=traces/cpu.pprof
|
|
160
|
+
|
|
161
|
+
# Analyze cpu profiles (contains overview of CPU time)
|
|
162
|
+
go tool pprof -http=localhost:8080 traces/cpu.pprof.initial*
|
|
163
|
+
go tool pprof -http=localhost:8080 traces/cpu.pprof.incremental*
|
|
164
|
+
|
|
165
|
+
# Analyze traces
|
|
166
|
+
go tool trace traces/trace.out.*
|
|
167
|
+
|
|
168
|
+
# cutting a new release, from root dir
|
|
169
|
+
# first, update the version numbers in js/packages/oribuild/package.json,
|
|
170
|
+
# and update the dependency versions to the same version number.
|
|
171
|
+
git commit -m "bump to 0.0.0-pre-alpha.4"
|
|
172
|
+
git tag v0.0.0-pre-alpha.4
|
|
173
|
+
git push
|
|
174
|
+
git push --tags
|
|
175
|
+
# this reads the version numbers from js/packages/oribuild/package.json
|
|
176
|
+
# and generates new packages.
|
|
177
|
+
./scripts/build-nonmac.sh
|
|
178
|
+
# this publishes to npm (you'll have to npm login separately)
|
|
179
|
+
./scripts/publish-nonmac.sh
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## FAQs
|
|
183
|
+
|
|
184
|
+
- Why not use the esbuild node API?
|
|
185
|
+
|
|
186
|
+
In short, we tried it and it was slow. Initial build times were several minutes, compared to the 40-odd seconds we see with the go api because of all the time plugins spent waiting to run on the node main thread.
|
|
187
|
+
|
|
188
|
+
- Can I customize `ori` for my monorepo?
|
|
189
|
+
|
|
190
|
+
For now, `ori` will remain extremely opinionated on what the monorepo shape must look like. As much as possible, we want to prefer convention over configuration.
|
|
191
|
+
|
|
192
|
+
In the same vein, rather than implementing plugins or encouraging people to fork and make their own custom builds of `ori`, new functionality will be added to the same `ori` binaries as needed.
|
|
193
|
+
|
|
194
|
+
- Why is it called `ori`?
|
|
195
|
+
|
|
196
|
+
`ori` was started by the Outlook Web team, and is short for `OWA Rapid Innerloop`.
|
|
197
|
+
|
|
198
|
+
It can also be easily typed on a single row of a QWERTY keyboard without using your fifth fingers, which I value because I have ulnar neuropathy.
|
|
199
|
+
|
|
200
|
+
> TODO: Populate this section as people ask more questions
|
|
201
|
+
|
|
202
|
+
## Contributing
|
|
203
|
+
|
|
204
|
+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
|
205
|
+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
|
206
|
+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
|
|
207
|
+
|
|
208
|
+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
|
|
209
|
+
a CLA and decorate the PR appropriately (e.g., status check, comment). You will only need to follow
|
|
210
|
+
the instructions provided by the bot. You will only need to do this once across all repos using the
|
|
211
|
+
CLA.
|
|
212
|
+
|
|
213
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
214
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
|
215
|
+
or contact opencode@microsoft.com with any additional questions or comments.
|
|
216
|
+
|
|
217
|
+
## Trademarks
|
|
218
|
+
|
|
219
|
+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
|
|
220
|
+
trademarks or logos is subject to and must follow
|
|
221
|
+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
|
|
222
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
223
|
+
Any use of third-party trademarks or logos is subject to those third parties' policies.
|
package/oribuild
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ohos-ports/oribuild-openharmony-arm64",
|
|
3
|
+
"version": "0.0.0-pre-alpha.15-beta.0",
|
|
4
|
+
"description": "OpenHarmony arm64 port of oribuild (the 'ori' TypeScript-monorepo innerloop build tool). Distribution-level platform mapping of the upstream prebuilt binary: because github.com/microsoft/ori is a private repository, source compilation is impossible, so the static ELF arm64 Go binary from the upstream linux-arm64 slot of the same 0.0.0-pre-alpha.15 version line (oribuild-linux-arm64@0.0.0-pre-alpha.15-2025092615-31c2ebe, commit 31c2ebe) is reused and self-signed via binary-sign-tool so it executes under HarmonyOS code-signing policy.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/microsoft/ori"
|
|
9
|
+
},
|
|
10
|
+
"os": [
|
|
11
|
+
"openharmony"
|
|
12
|
+
],
|
|
13
|
+
"cpu": [
|
|
14
|
+
"arm64"
|
|
15
|
+
],
|
|
16
|
+
"bin": {
|
|
17
|
+
"ori": "./oribuild"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"oribuild",
|
|
21
|
+
"NOTICE",
|
|
22
|
+
"README.md"
|
|
23
|
+
]
|
|
24
|
+
}
|