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

Build-in-container instructions missing mariner-repos directory (and other notes) #58

Open
dagood opened this issue Feb 5, 2024 · 1 comment

Comments

@dagood
Copy link
Member

dagood commented Feb 5, 2024

https://github.com/microsoft/CBL-MarinerTutorials/tree/main/build-in-container

I tried running ./build-in-container/mariner-docker-builder.sh -c then ./build-in-container/mariner-docker-builder.sh -b from the root of the repo. It wasn't clear to me where you're meant to run it from (somewhere outside the repo?) based on this:

# Setup the container for 1st use
./CBL-MarinerTutorials/build-in-container/mariner-docker-builder.sh -t

After that, I got an error in the middle of the build, but it was a bit hard to understand what was going on from the end of the output because there's a lot of Go output to scroll through:

------------ Building Mariner toolkit ------------
++ echo '------------ Building Mariner toolkit ------------'
+++ nproc
++ make -j8 -C CBL-Mariner/toolkit package-toolkit BUILD_DIR=/mariner/build CHROOT_DIR=/temp/DockerStage/ CONCURRENT_PACKAGE_BUILDS=12 CONFIG_FILE= LOG_LEVEL=info OUT_DIR=/mariner/out REBUILD_TOOLS=y
make: Entering directory '/mariner/CBL-Mariner/toolkit'
SUDO_USER is not set, running 'go get' as user ''
echo "mariner-official-base.repo mariner-microsoft.repo" | sed -E 's:([^ ]+[.]repo):/mariner/SPECS/mariner-repos/\1:g' | xargs cat > /mariner/CBL-Mariner/toolkit/scripts/sodiff/sodiff.repo
cat: /mariner/SPECS/mariner-repos/mariner-official-base.repo: No such file or directory
cat: /mariner/SPECS/mariner-repos/mariner-microsoft.repo: No such file or directory
make: *** [/mariner/CBL-Mariner/toolkit/scripts/analysis.mk:73: /mariner/CBL-Mariner/toolkit/scripts/sodiff/sodiff.repo] Error 123
...
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
go: downloading golang.org/x/net v0.18.0
go: downloading github.com/golang-jwt/jwt/v5 v5.0.0
make: Leaving directory '/mariner/CBL-Mariner/toolkit'

I randomly guessed at adding this line to build-in-container/scripts/setup.sh to get a bit further:

         echo "------------ Building Mariner toolkit ------------"
+        cp -r CBL-Mariner/SPECS/mariner-repos SPECS/ && \
         make -j$(nproc) \

Then I got through Adding RPM to worker chroot and eventually it seemed not to find any specs. I left the hello_world_demo in place and thought it would build:

INFO[0003][rpmssnapshot] Generating RPMs snapshot from specs inside (/mariner/SPECS). 
INFO[0003][rpmssnapshot] Found 0 compatible specs.                    
INFO[0003][rpmssnapshot] The specs build 0 packages in total.         

(I was getting this working to have a local dev loop for microsoft/azurelinux#7446, but for the time being the buddy build seems fine.)

@dagood
Copy link
Member Author

dagood commented Feb 5, 2024

A step that might also be nice to include is docker pull mcr.microsoft.com/cbl-mariner/base/core:2.0. I was on a version where running tdnf install -y curl would cause any future tdnf calls to fail due to a symbol mismatch.

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

No branches or pull requests

1 participant