Skip to content
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

[VCPKG-ARTIFACTS] Fixes to make Espressif IDF work (with artifacts for dependencies) #604

Merged
merged 21 commits into from
Jun 28, 2022

Conversation

fearthecowboy
Copy link
Member

@fearthecowboy fearthecowboy commented Jun 24, 2022

Includes work from @BillyONeal 's fork for espressif.

  • when a registry is updated, the zip file will check to see how deep to strip off folders that should not be there
  • made registry loading async
  • fix git clone to be smarter/faster
  • make the 'localname' for a repo a bit cleaner for github and aka.ms registries, otherwise generate a smaller name

To test this:

# ensure we have vcpkg stable
iex (iwr -useb https://aka.ms/vcpkg-init.ps1)

#clone the blink repo
git clone https://github.com/some-example/blink
cd blink

# run the devel version of vcpkg:
C:\work\2022\vcpkg-tool\out\build\x64-Debug\vcpkg.ps1 activate

output

warning: vcpkg-ce ('configure environment') is experimental and may change at any time.
Using in-development vcpkg-artifacts built at: C:/work/2022/vcpkg-tool/ce/ce
Updating registry data from https://github.com/fearthecowboy/registries/releases/download/espressif-idf-1.10/Espressif.zip
Updating registry data from https://aka.ms/vcpkg-ce-default
 Artifact                                                                                                             Version                Status        Dependency  Summary
 espressif:idf                                                                                                        1.10.2                 will install  *           Espressif IDF
 microsoft:tools/kitware/cmake                                                                                        3.20.1                 will install  *           Kitware's cmake tool
 microsoft:tools/ninja-build/ninja                                                                                    1.10.2                 will install  *           Ninja is a small build system with a focus on speed.
 [https://github.com/fearthecowboy/registries/releases/download/espressif-idf-1.10/Espressif.zip]:ccache              4.3.0                  will install  *
 [https://github.com/fearthecowboy/registries/releases/download/espressif-idf-1.10/Espressif.zip]:dfu_util            0.9.0                  will install  *
 [https://github.com/fearthecowboy/registries/releases/download/espressif-idf-1.10/Espressif.zip]:riscv32-esp-elf     8.4.0-patch3           will install  *
 [https://github.com/fearthecowboy/registries/releases/download/espressif-idf-1.10/Espressif.zip]:openocd             0.11.0-esp32-20211120  will install  *
 [https://github.com/fearthecowboy/registries/releases/download/espressif-idf-1.10/Espressif.zip]:xtensa-esp32s2-elf  8.4.0-patch3           will install  *
 [https://github.com/fearthecowboy/registries/releases/download/espressif-idf-1.10/Espressif.zip]:xtensa-esp32s3-elf  8.4.0-patch3           will install  *
 [https://github.com/fearthecowboy/registries/releases/download/espressif-idf-1.10/Espressif.zip]:xtensa-esp32-elf    8.4.0-patch3           will install  *
 [https://github.com/fearthecowboy/registries/releases/download/espressif-idf-1.10/Espressif.zip]:esp32s2ulp-elf      2.28.51-esp20191205    will install  *
 [https://github.com/fearthecowboy/registries/releases/download/espressif-idf-1.10/Espressif.zip]:esp32ulp-elf        2.28.51-esp20191205    will install  *

BillyONeal and others added 10 commits June 13, 2022 13:07
Thanks to @fearthecowboy for help on this one.

I considered ripping out the rush dependency, since it seems like we are only ever going to have one meaningful "project", and the dependency deduplication we need seems to be already done by pnpm (rather than npm), but after talking with @fearthecowboy I've decided to not go there since we still have rush linking the test project in.

Unfortunately, there does not appear to be an effiicent way to build the typescript parts out-of-source, since they depend on node_modules which is put into the source tree.

This adds a vcpkg.ps1 which does the same "environment hacking" as the in-development ce.ps1, teaches CMakeLists.txt to invoke rush and the typescript compiler as necessary, and teaches vcpkg.exe to use a hard-coded-into-the-binary path to the source tree when that in-development setting is turned on.

The previous "always download latest ce bits" behavior is retained for folks who build vcpkg.exe from source and don't want to arrange for node and rush to be available.
@fearthecowboy fearthecowboy changed the title Fixes to make Espressif IDF work (with artifacts for dependencies) [VCPKG-ARTIFACTS] Fixes to make Espressif IDF work (with artifacts for dependencies) Jun 24, 2022
@BillyONeal
Copy link
Member

ROFL it's actually "github.com/some-example" 🤣😂

# Conflicts:
#	CMakeLists.txt
#	src/vcpkg-in-development.ps1
@fearthecowboy
Copy link
Member Author

Yeah, I got tired of not having a place for 1-off examples of stuff so I made a new org for myself.

@BillyONeal
Copy link
Member

I merged 426593e then merged main into this to get the different-PR content out.

@@ -232,6 +234,17 @@ export class Artifact extends ArtifactBase {
this.session.activation.addExports(exportsBlock, this.targetLocation);
}

// if espressif install
if (this.metadata.info.flags.has('espidf')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that get/set property earlier in the review used now? Since this is reaching into flags directly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! no, it's not -- the espidf flag there was when we had it nested in the git clone ..

I've deleted that code several times, but it keeps creeping back in when I pull from someone else 😢

lemme remove that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one doesn't look changed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the correct usage, the other has been removed.

@@ -232,6 +234,17 @@ export class Artifact extends ArtifactBase {
this.session.activation.addExports(exportsBlock, this.targetLocation);
}

// if espressif install
if (this.metadata.info.flags.has('espidf')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one doesn't look changed?

@fearthecowboy fearthecowboy merged commit 0060c5c into microsoft:main Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants