Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
dad5e9cd
Unverified
Commit
dad5e9cd
authored
Aug 31, 2021
by
Silvano Cerza
Committed by
GitHub
Aug 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile --build-path not working with relative paths (#1423)
parent
5c5cc785
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
commands/compile/compile.go
commands/compile/compile.go
+1
-1
test/test_compile.py
test/test_compile.py
+30
-0
No files found.
commands/compile/compile.go
View file @
dad5e9cd
...
...
@@ -144,7 +144,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
if
req
.
GetBuildPath
()
==
""
{
builderCtx
.
BuildPath
=
sk
.
BuildPath
}
else
{
builderCtx
.
BuildPath
=
paths
.
New
(
req
.
GetBuildPath
())
builderCtx
.
BuildPath
=
paths
.
New
(
req
.
GetBuildPath
())
.
Canonical
()
}
if
err
=
builderCtx
.
BuildPath
.
MkdirAll
();
err
!=
nil
{
return
nil
,
&
commands
.
PermissionDeniedError
{
Message
:
tr
(
"Cannot create build directory"
),
Cause
:
err
}
...
...
test/test_compile.py
View file @
dad5e9cd
...
...
@@ -1155,3 +1155,33 @@ def test_compile_sketch_with_ipp_file_include(run_command, copy_sketch):
fqbn
=
"arduino:avr:uno"
assert
run_command
(
f"compile -b
{
fqbn
}
{
sketch_path
}
--verbose"
)
def
test_compile_with_relative_build_path
(
run_command
,
data_dir
,
copy_sketch
):
assert
run_command
(
"update"
)
run_command
(
"core install arduino:avr@1.8.3"
)
sketch_name
=
"sketch_simple"
sketch_path
=
copy_sketch
(
sketch_name
)
fqbn
=
"arduino:avr:uno"
build_path
=
Path
(
".."
,
"build_path"
)
working_dir
=
Path
(
data_dir
,
"working_dir"
)
working_dir
.
mkdir
()
assert
run_command
(
f"compile -b
{
fqbn
}
--build-path
{
build_path
}
{
sketch_path
}
-v"
,
custom_working_dir
=
working_dir
)
absolute_build_path
=
Path
(
data_dir
,
"build_path"
)
built_files
=
[
f
.
name
for
f
in
absolute_build_path
.
glob
(
"*"
)]
assert
f"
{
sketch_name
}
.ino.eep"
in
built_files
assert
f"
{
sketch_name
}
.ino.elf"
in
built_files
assert
f"
{
sketch_name
}
.ino.hex"
in
built_files
assert
f"
{
sketch_name
}
.ino.with_bootloader.bin"
in
built_files
assert
f"
{
sketch_name
}
.ino.with_bootloader.hex"
in
built_files
assert
"build.options.json"
in
built_files
assert
"compile_commands.json"
in
built_files
assert
"core"
in
built_files
assert
"includes.cache"
in
built_files
assert
"libraries"
in
built_files
assert
"preproc"
in
built_files
assert
"sketch"
in
built_files
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment