Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jscoq-light
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Rousselin
jscoq-light
Commits
b1989038
Commit
b1989038
authored
2 years ago
by
Shachar Itzhaky
Browse files
Options
Downloads
Patches
Plain Diff
[bugfix] Forgot to await `cas`.
parent
d9247f6e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
coq-jslib/build/sdk/shutil.ts
+2
-2
2 additions, 2 deletions
coq-jslib/build/sdk/shutil.ts
coq-jslib/build/sdk/toolkit.js
+11
-4
11 additions, 4 deletions
coq-jslib/build/sdk/toolkit.js
with
13 additions
and
6 deletions
coq-jslib/build/sdk/shutil.ts
+
2
−
2
View file @
b1989038
...
...
@@ -18,7 +18,7 @@ function cat(fn: string) {
async
function
cas
(
fn
:
string
,
expectedValue
:
string
,
whenNeq
:
()
=>
void
|
Promise
<
void
>
)
{
if
(
cat
(
fn
)
===
expectedValue
)
return
true
;
/* fast lane */
let
dir
=
path
.
dirname
(
fn
),
lopts
=
{
lockfile
Name
:
fn
+
'
.lock
'
,
retries
:
cas_retries
};
lopts
=
{
lockfile
Path
:
fn
+
'
.lock
'
,
retries
:
cas_retries
};
await
lockfile
.
lock
(
dir
,
lopts
);
try
{
if
(
cat
(
fn
)
===
expectedValue
)
return
true
;
...
...
@@ -62,4 +62,4 @@ function existsDir(p) {
catch
(
e
)
{
return
false
;
}
}
export
{
cat
,
cas
,
dirstamp
,
ln_sf
,
existsExec
,
existsDir
}
\ No newline at end of file
export
{
cat
,
cas
,
dirstamp
,
ln_sf
,
existsExec
,
existsDir
}
This diff is collapsed.
Click to expand it.
coq-jslib/build/sdk/toolkit.js
+
11
−
4
View file @
b1989038
...
...
@@ -29,7 +29,7 @@ class Phase {
_exec
(
prog
,
args
,
stdio
=
'
inherit
'
)
{
if
(
SDK_FLAGS
.
includes
(
'
verbose
'
))
{
console
.
log
(
`[
${
ME
}
-sdk]
`
,
prog
,
args
.
join
(
'
'
));
log
(
`[
${
ME
}
-sdk]
${
prog
}
${
args
.
join
(
'
'
)
}
`
);
}
return
child_process
.
execFileSync
(
prog
,
args
,
{
stdio
});
}
...
...
@@ -65,7 +65,7 @@ class DockerTool extends Phase {
async
run
(
prog
,
args
)
{
const
cfg
=
await
sdk
.
setup
(
this
.
basedir
,
false
);
cfg
.
include
=
this
.
incdir
;
this
.
copyToVolume
(
cfg
);
await
this
.
copyToVolume
(
cfg
);
this
.
runInContainer
(
prog
,
args
,
cfg
);
}
...
...
@@ -101,9 +101,11 @@ class DockerTool extends Phase {
([
k
,
v
])
=>
v
?
[
'
-e
'
,
`
${
k
}
=
${
v
}
`
]
:
[]));
}
copyToVolume
(
cfg
)
{
async
copyToVolume
(
cfg
)
{
let
{
name
,
mnt
}
=
this
.
dockerVolume
;
cas
(
path
.
join
(
cfg
.
coqlib
,
'
_volume
'
),
'
jscoq-sdk
'
,
()
=>
{
await
cas
(
path
.
join
(
cfg
.
coqlib
,
'
_volume
'
),
'
jscoq-sdk
'
,
()
=>
{
if
(
SDK_FLAGS
.
includes
(
'
verbose
'
))
log
(
`[
${
ME
}
-sdk] creating volume
${
name
}
`
);
this
.
_exec
(
'
docker
'
,
[
'
volume
'
,
'
rm
'
,
'
-f
'
,
name
],
[
'
ignore
'
,
'
ignore
'
,
'
inherit
'
]);
this
.
_exec
(
'
docker
'
,
[
'
volume
'
,
'
create
'
,
name
],
[
'
ignore
'
,
'
ignore
'
,
'
inherit
'
]);
this
.
runInContainer
(
'
sudo
'
,
[
'
cp
'
,
'
-rf
'
,
cfg
.
coqlib
,
mnt
],
cfg
);
...
...
@@ -120,6 +122,11 @@ class DockerTool extends Phase {
}
}
/** logs to stderr to avoid cluttering output, esp. for coqdep */
function
log
(
msg
)
{
process
.
stderr
.
write
(
msg
+
'
\n
'
);
}
async
function
main
(
prog
,
args
)
{
var
Phase
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment