Skip to content

Restructure directory layout #2878

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 20 commits into from
Oct 2, 2016
Merged

Restructure directory layout #2878

merged 20 commits into from
Oct 2, 2016

Conversation

geky
Copy link
Contributor

@geky geky commented Sep 30, 2016

Continued from #2266

This diff is annoyingly large, it may be better to look at the repo overview:
https://github.com/geky/mbed/tree/restructure

Target layout:

mbed
|- mbed.h
|- docs
|- drivers
|- features
|- hal
|- platform
|- rtos
|- events
|- targets
|- TESTS
`- tools

Directory moves:

hal/{api,common} -> drivers
hal/{api,common} -> platform
hal/hal          -> hal
hal/targets      -> targets
libraries        -> features/unsupported

The mbed.h file has been moved to the top-level directory to act as a single entry point:

hal/mbed.h -> mbed.h

Things are about to get messy
cc @sg-, @bridadan, @theotherjimmy

@bridadan
Copy link
Contributor

bridadan commented Sep 30, 2016

I noticed that wait_api.h is in the platform folder. Is this on purpose? Or should it be in the hal folder like the rest of the *_api.h files?

@geky
Copy link
Contributor Author

geky commented Sep 30, 2016

Yep, the wait set of functions are built on top of the ticker api and rtos api, there is no hardware involved.

@bridadan
Copy link
Contributor

Makes sense to me! Thanks for clarifying

@geky geky force-pushed the restructure branch 2 times, most recently from 9f247f0 to c49f670 Compare September 30, 2016 23:35
@geky
Copy link
Contributor Author

geky commented Sep 30, 2016

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

@geky
Copy link
Contributor Author

geky commented Sep 30, 2016

/morph test

@mbed-bot
Copy link

Result: ABORTED

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1022

Build failed!

@geky geky force-pushed the restructure branch 2 times, most recently from ef1eb6f to 133d723 Compare October 1, 2016 00:16
geky added 12 commits September 30, 2016 19:18
hal/targets -> targets
hal/targets.json -> targets/targets.json
hal/common/AnalogIn.cpp -> drivers/AnalogIn.cpp
hal/api/AnalogIn.h -> drivers/AnalogIn.h
hal/api/AnalogOut.h -> drivers/AnalogOut.h
hal/common/BusIn.cpp -> drivers/BusIn.cpp
hal/api/BusIn.h -> drivers/BusIn.h
hal/common/BusInOut.cpp -> drivers/BusInOut.cpp
hal/api/BusInOut.h -> drivers/BusInOut.h
hal/common/BusOut.cpp -> drivers/BusOut.cpp
hal/api/BusOut.h -> drivers/BusOut.h
hal/common/CAN.cpp -> drivers/CAN.cpp
hal/api/CAN.h -> drivers/CAN.h
hal/api/CircularBuffer.h -> drivers/CircularBuffer.h
hal/api/DigitalIn.h -> drivers/DigitalIn.h
hal/api/DigitalInOut.h -> drivers/DigitalInOut.h
hal/api/DigitalOut.h -> drivers/DigitalOut.h
hal/api/DirHandle.h -> drivers/DirHandle.h
hal/common/Ethernet.cpp -> drivers/Ethernet.cpp
hal/api/Ethernet.h -> drivers/Ethernet.h
hal/common/FileBase.cpp -> drivers/FileBase.cpp
hal/api/FileBase.h -> drivers/FileBase.h
hal/api/FileHandle.h -> drivers/FileHandle.h
hal/common/FileLike.cpp -> drivers/FileLike.cpp
hal/api/FileLike.h -> drivers/FileLike.h
hal/common/FilePath.cpp -> drivers/FilePath.cpp
hal/api/FilePath.h -> drivers/FilePath.h
hal/common/FileSystemLike.cpp -> drivers/FileSystemLike.cpp
hal/api/FileSystemLike.h -> drivers/FileSystemLike.h
hal/common/I2C.cpp -> drivers/I2C.cpp
hal/api/I2C.h -> drivers/I2C.h
hal/common/I2CSlave.cpp -> drivers/I2CSlave.cpp
hal/api/I2CSlave.h -> drivers/I2CSlave.h
hal/common/InterruptIn.cpp -> drivers/InterruptIn.cpp
hal/api/InterruptIn.h -> drivers/InterruptIn.h
hal/common/InterruptManager.cpp -> drivers/InterruptManager.cpp
hal/api/InterruptManager.h -> drivers/InterruptManager.h
hal/common/LocalFileSystem.cpp -> drivers/LocalFileSystem.cpp
hal/api/LocalFileSystem.h -> drivers/LocalFileSystem.h
hal/api/LowPowerTicker.h -> drivers/LowPowerTicker.h
hal/api/LowPowerTimeout.h -> drivers/LowPowerTimeout.h
hal/api/LowPowerTimer.h -> drivers/LowPowerTimer.h
hal/api/PortIn.h -> drivers/PortIn.h
hal/api/PortInOut.h -> drivers/PortInOut.h
hal/api/PortOut.h -> drivers/PortOut.h
hal/api/PwmOut.h -> drivers/PwmOut.h
hal/common/RawSerial.cpp -> drivers/RawSerial.cpp
hal/api/RawSerial.h -> drivers/RawSerial.h
hal/common/SPI.cpp -> drivers/SPI.cpp
hal/api/SPI.h -> drivers/SPI.h
hal/common/SPISlave.cpp -> drivers/SPISlave.cpp
hal/api/SPISlave.h -> drivers/SPISlave.h
hal/common/Serial.cpp -> drivers/Serial.cpp
hal/api/Serial.h -> drivers/Serial.h
hal/common/SerialBase.cpp -> drivers/SerialBase.cpp
hal/api/SerialBase.h -> drivers/SerialBase.h
hal/common/Stream.cpp -> drivers/Stream.cpp
hal/api/Stream.h -> drivers/Stream.h
hal/common/Ticker.cpp -> drivers/Ticker.cpp
hal/api/Ticker.h -> drivers/Ticker.h
hal/common/Timeout.cpp -> drivers/Timeout.cpp
hal/api/Timeout.h -> drivers/Timeout.h
hal/common/Timer.cpp -> drivers/Timer.cpp
hal/api/Timer.h -> drivers/Timer.h
hal/common/TimerEvent.cpp -> drivers/TimerEvent.cpp
hal/api/TimerEvent.h -> drivers/TimerEvent.h
hal/api/Transaction.h -> drivers/Transaction.h
hal/api/can_helper.h -> drivers/can_helper.h
hal/.yotta_ignore
hal/CMakeLists.txt
hal/hal/analogin_api.h -> hal/analogin_api.h
hal/hal/analogout_api.h -> hal/analogout_api.h
hal/hal/buffer.h -> hal/buffer.h
hal/hal/can_api.h -> hal/can_api.h
hal/hal/dma_api.h -> hal/dma_api.h
hal/hal/ethernet_api.h -> hal/ethernet_api.h
hal/hal/gpio_api.h -> hal/gpio_api.h
hal/hal/gpio_irq_api.h -> hal/gpio_irq_api.h
hal/hal/i2c_api.h -> hal/i2c_api.h
hal/hal/lp_ticker_api.h -> hal/lp_ticker_api.h
hal/common/mbed_gpio.c -> hal/mbed_gpio.c
hal/common/mbed_lp_ticker_api.c -> hal/mbed_lp_ticker_api.c
hal/common/mbed_pinmap_common.c -> hal/mbed_pinmap_common.c
hal/common/mbed_ticker_api.c -> hal/mbed_ticker_api.c
hal/common/mbed_us_ticker_api.c -> hal/mbed_us_ticker_api.c
hal/module.json
hal/hal/pinmap.h -> hal/pinmap.h
hal/hal/port_api.h -> hal/port_api.h
hal/hal/pwmout_api.h -> hal/pwmout_api.h
hal/hal/rtc_api.h -> hal/rtc_api.h
hal/hal/serial_api.h -> hal/serial_api.h
hal/hal/sleep_api.h -> hal/sleep_api.h
hal/hal/spi_api.h -> hal/spi_api.h
hal/hal/storage_abstraction/Driver_Common.h -> hal/storage_abstraction/Driver_Common.h
hal/hal/storage_abstraction/Driver_Storage.h -> hal/storage_abstraction/Driver_Storage.h
hal/hal/ticker_api.h -> hal/ticker_api.h
hal/hal/trng_api.h -> hal/trng_api.h
hal/hal/us_ticker_api.h -> hal/us_ticker_api.h
hal/api/mbed.h -> mbed.h
hal/api/CThunk.h -> platform/CThunk.h
hal/common/CallChain.cpp -> platform/CallChain.cpp
hal/api/CallChain.h -> platform/CallChain.h
hal/api/Callback.h -> platform/Callback.h
hal/api/FunctionPointer.h -> platform/FunctionPointer.h
hal/api/PlatformMutex.h -> platform/PlatformMutex.h
hal/api/SingletonPtr.h -> platform/SingletonPtr.h
hal/api/critical.h -> platform/critical.h
hal/common/mbed_alloc_wrappers.cpp -> platform/mbed_alloc_wrappers.cpp
hal/common/mbed_assert.c -> platform/mbed_assert.c
hal/api/mbed_assert.h -> platform/mbed_assert.h
hal/common/mbed_board.c -> platform/mbed_board.c
hal/common/mbed_critical.c -> platform/mbed_critical.c
hal/api/mbed_debug.h -> platform/mbed_debug.h
hal/common/mbed_error.c -> platform/mbed_error.c
hal/api/mbed_error.h -> platform/mbed_error.h
hal/common/mbed_interface.c -> platform/mbed_interface.c
hal/api/mbed_interface.h -> platform/mbed_interface.h
hal/common/mbed_mem_trace.c -> platform/mbed_mem_trace.c
hal/api/mbed_mem_trace.h -> platform/mbed_mem_trace.h
hal/common/mbed_rtc_time.cpp -> platform/mbed_rtc_time.cpp
hal/common/mbed_semihost_api.c -> platform/mbed_semihost_api.c
hal/api/mbed_stats.h -> platform/mbed_stats.h
hal/common/mbed_wait_api_no_rtos.c -> platform/mbed_wait_api_no_rtos.c
hal/common/mbed_wait_api_rtos.cpp -> platform/mbed_wait_api_rtos.cpp
hal/api/platform.h -> platform/platform.h
hal/common/retarget.cpp -> platform/retarget.cpp
hal/api/rtc_time.h -> platform/rtc_time.h
hal/api/semihost_api.h -> platform/semihost_api.h
hal/api/toolchain.h -> platform/toolchain.h
hal/api/wait_api.h -> platform/wait_api.h
time.h brings in struct timeval
lwip defines custom struct timeval

resolved through disabling lwip's struct timeval
features/net/network-socket -> features/netsocket
features/net/FEATURE_IPV4 -> features/FEATURE_LWIP
features/net/nanostack-binaries -> features/nanostack
features/net/FEATURE_NANOSTACK -> features/nanostack/FEATURE_NANOSTACK
MBED_HAL       /hal/hal      x
MBED_API       /hal/api      x
MBED_COMMON    /hal/common   x
MBED_TARGETS   /hal/targets  ->  /targets
MBED_DRIVERS                  +  /drivers
MBED_PLATFORM                 +  /platform
MBED_HEADER                   +  /mbed.h
- Reverted requirements.txt for external dependency in mbed CLI
- Fixed MBED_CONFIG_FILE in paths.py
- Fixed MBED_LIBRARIES in paths.py
- Decreased include namespace for rtos.h
@geky
Copy link
Contributor Author

geky commented Oct 1, 2016

/morph test-nightly

@bridadan
Copy link
Contributor

bridadan commented Oct 1, 2016

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=ALL

@mbed-bot
Copy link

mbed-bot commented Oct 1, 2016

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1023

Build failed!

@mbed-bot
Copy link

mbed-bot commented Oct 1, 2016

[Build 1012]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@sg-
Copy link
Contributor

sg- commented Oct 1, 2016

mbed 2 builds now fail due to flat directory structure and use of path/file 👎

/morph test-nightly

@mbed-bot
Copy link

mbed-bot commented Oct 1, 2016

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1025

Test failed!

@geky
Copy link
Contributor Author

geky commented Oct 1, 2016

Thanks for prefixing everything 👍

Added rough two-layer directory structure support to the mbed 2 builds. The legacy build now just duplicates the library header files during precompile.

@geky
Copy link
Contributor Author

geky commented Oct 1, 2016

It looks like the mbed 2 builds are now stalling in travis?? I can't reproduce this locally.

Added single-nested include directories to libraries built with the
legacy build_lib function. Unfortunately, to get this working without
a significant rewrite of the legacy build tools, library header files
are just duplicated in the precompile stage.
@geky
Copy link
Contributor Author

geky commented Oct 1, 2016

Travis looks good except for the issue here: #2879 👍

@sg-
Copy link
Contributor

sg- commented Oct 1, 2016

/morph test

@mbed-bot
Copy link

mbed-bot commented Oct 2, 2016

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1027

All builds and test passed!

@SeppoTakalo
Copy link
Contributor

Please, when you do this kind of restructures, it would be nice to notify developers. We need to update our build scripts to match this new structure.

@SeppoTakalo
Copy link
Contributor

This restructure broke at least:

/esp8266-driver/ESP8266Interface.cpp:18:0:
./esp8266-driver/ESP8266Interface.h:20:41: fatal error: network-socket/NetworkStack.h: No such file or directory
 #include "network-socket/NetworkStack.h"
  • All our build scripts (The ones that replace Nanostack binaries with sources)
  • Building of Nanostack binary

We'll handle those build scripts but who is going to update ESP driver?

@jeromecoutant
Copy link
Collaborator

Agree with @SeppoTakalo
Quite big changes during the week end without any notification...

About this change: libraries -> features/unsupported
What's the meaning of this "unsupported" ?

@LMESTM LMESTM mentioned this pull request Oct 3, 2016
2 tasks
@yogpan01
Copy link
Contributor

yogpan01 commented Oct 3, 2016

This restructure broke mbed-client build jobs which are testing against master and used for preparing release candidate
[ERROR] ./pal/Source/Port/Reference-Impl/mbedOS/Networking/pal_plat_network.cpp:23:39: fatal error: net/network-socket/Socket.h: No such file or directory

@sg-
Copy link
Contributor

sg- commented Oct 3, 2016

What's the meaning of this "unsupported" ?

This is code that needs updates (thread safety, refactor, etc.) before being a first class feature again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants