Skip to content

[skip changelog] Libraries install dir path is now canonical #1293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arduino/libraries/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library,

library := &Library{}
library.Location = location
library.InstallDir = libraryDir
library.InstallDir = libraryDir.Canonical()
if libraryDir.Join("src").Exist() {
library.Layout = RecursiveLayout
library.SourceDir = libraryDir.Join("src")
Expand Down Expand Up @@ -127,7 +127,7 @@ func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library,

func makeLegacyLibrary(path *paths.Path, location LibraryLocation) (*Library, error) {
library := &Library{
InstallDir: path,
InstallDir: path.Canonical(),
Location: location,
SourceDir: path,
Layout: FlatLayout,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.14

require (
github.com/arduino/board-discovery v0.0.0-20180823133458-1ba29327fb0c
github.com/arduino/go-paths-helper v1.4.0
github.com/arduino/go-paths-helper v1.5.0
github.com/arduino/go-properties-orderedmap v1.3.0
github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b
github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3
github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
github.com/arduino/go-paths-helper v1.4.0 h1:ilnseAdxmN1bFnLxxXHRtcdmt9jBf3O4jtYfWfqule4=
github.com/arduino/go-paths-helper v1.4.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU=
github.com/arduino/go-paths-helper v1.5.0 h1:RVo189hD+GhUS1rQ3gixwK1nSbvVR8MGIGa7Gxv2bdM=
github.com/arduino/go-paths-helper v1.5.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU=
github.com/arduino/go-properties-orderedmap v1.3.0 h1:4No/vQopB36e7WUIk6H6TxiSEJPiMrVOCZylYmua39o=
github.com/arduino/go-properties-orderedmap v1.3.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b h1:9hDi4F2st6dbLC3y4i02zFT5quS4X6iioWifGlVwfy4=
Expand Down
8 changes: 4 additions & 4 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ def data_dir(tmpdir_factory):
# due to the above on Windows we cut the tmp path straight to /tmp/xxxxxxxx
if platform.system() == "Windows":
with tempfile.TemporaryDirectory() as tmp:
yield tmp
yield os.path.realpath(tmp)
# We don't need to remove the directory since
# tempfile.TemporaryDirectory deletes itself
# automatically when exits its scope.
else:
data = tmpdir_factory.mktemp("ArduinoTest")
yield str(data)
yield os.path.realpath(data)
shutil.rmtree(data, ignore_errors=True)


Expand All @@ -82,7 +82,7 @@ def downloads_dir(tmpdir_factory, worker_id):
if not lock.is_file():
lock.touch()

yield str(download_dir)
yield os.path.realpath(download_dir)
shutil.rmtree(download_dir, ignore_errors=True)


Expand All @@ -94,7 +94,7 @@ def working_dir(tmpdir_factory):
at the end, this way all the tests work in isolation.
"""
work_dir = tmpdir_factory.mktemp("ArduinoTestWork")
yield str(work_dir)
yield os.path.realpath(work_dir)
shutil.rmtree(work_dir, ignore_errors=True)


Expand Down
2 changes: 1 addition & 1 deletion test/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def test_compile_with_archives_and_long_paths(run_command):
assert run_command("update")

# Install core to compile
assert run_command("core install esp8266:esp8266")
assert run_command("core install esp8266:esp8266@2.7.4")

# Install test library
assert run_command("lib install ArduinoIoTCloud")
Expand Down