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

stop caring about generated code and variants #282

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

webern
Copy link
Contributor

@webern webern commented Jun 11, 2024

Issue number:

Closes #193

Description of changes:

stop caring about the models and logdog dirs

With bottlerocket-os/bottlerocket#4038 we can
finally stop mounting the models directory (and a vestige of logdog
could also be removed).

Testing done:

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@webern webern force-pushed the models branch 2 times, most recently from 8bfbe21 to 8a8f8c6 Compare June 11, 2024 22:55
@webern webern changed the title stop caring about the models and logdog dirs stop caring about generated code and variants Jun 11, 2024
@webern
Copy link
Contributor Author

webern commented Jun 11, 2024

⬆️ Also removed the Variant manifest read during package builds. Re-tested.

@webern
Copy link
Contributor Author

webern commented Jun 12, 2024

⬆️ Also removed the variant* args. Re-tested. Unfortunately, this push https://github.com/bottlerocket-os/twoliter/compare/8a8f8c6c5536fc316e2a4a3f034802c99d3afcee..34d406fcbcc3973d9615fde99ba632688c6e09ac caused this error.

  #16 [rpmbuild 6/6] RUN --mount=source=.cargo,target=/home/builder/.cargo     --mount=type=cache,target=/home/builder/.cache,from=cache,source=/cache     --mount=source=sources,target=/home/builder/rpmbuild/BUILD/sources     rpmbuild -bb --clean       --undefine _auto_set_build_flags       --define "_target_cpu ${ARCH}"       --define "dist ${BUILD_ID_TIMESTAMP}.${BUILD_ID//-dirty/}.br1"       rpmbuild/SPECS/${PACKAGE}.spec
  #16 6.555 RPM build errors:
  #16 6.558 error: /etc/rpm/macros: line 368: Macro %_cross_variant has empty body
  #16 6.558 error: /etc/rpm/macros: line 369: Macro %_cross_variant_platform has empty body
  #16 6.558 error: /etc/rpm/macros: line 370: Macro %_cross_variant_runtime has empty body
  #16 6.558 error: /etc/rpm/macros: line 371: Macro %_cross_variant_family has empty body
  #16 6.559 error: /home/builder/.rpmmacros: line 368: Macro %_cross_variant has empty body
  #16 6.559 error: /home/builder/.rpmmacros: line 369: Macro %_cross_variant_platform has empty body
  #16 6.559 error: /home/builder/.rpmmacros: line 370: Macro %_cross_variant_runtime has empty body
  #16 6.559 error: /home/builder/.rpmmacros: line 371: Macro %_cross_variant_family has empty body
  #16 ERROR: process "/bin/sh -c rpmbuild -bb --clean       --undefine _auto_set_build_flags       --define \"_target_cpu ${ARCH}\"       --define \"dist ${BUILD_ID_TIMESTAMP}.${BUILD_ID//-dirty/}.br1\"       rpmbuild/SPECS/${PACKAGE}.spec" did not complete successfully: exit code: 1
  ------
   > [rpmbuild 6/6] RUN --mount=source=.cargo,target=/home/builder/.cargo     --mount=type=cache,target=/home/builder/.cache,from=cache,source=/cache     --mount=source=sources,target=/home/builder/rpmbuild/BUILD/sources     rpmbuild -bb --clean       --undefine _auto_set_build_flags       --define "_target_cpu ${ARCH}"       --define "dist ${BUILD_ID_TIMESTAMP}.${BUILD_ID//-dirty/}.br1"       rpmbuild/SPECS/${PACKAGE}.spec:
  6.555
  6.555 RPM build errors:
  6.558 error: /etc/rpm/macros: line 368: Macro %_cross_variant has empty body
  6.558 error: /etc/rpm/macros: line 369: Macro %_cross_variant_platform has empty body
  6.558 error: /etc/rpm/macros: line 370: Macro %_cross_variant_runtime has empty body
  6.558 error: /etc/rpm/macros: line 371: Macro %_cross_variant_family has empty body
  6.559 error: /home/builder/.rpmmacros: line 368: Macro %_cross_variant has empty body
  6.559 error: /home/builder/.rpmmacros: line 369: Macro %_cross_variant_platform has empty body
  6.559 error: /home/builder/.rpmmacros: line 370: Macro %_cross_variant_runtime has empty body
  6.559 error: /home/builder/.rpmmacros: line 371: Macro %_cross_variant_family has empty body
  ------
  build.Dockerfile:147
  --------------------
   146 |     USER builder
   147 | >>> RUN --mount=source=.cargo,target=/home/builder/.cargo \
   148 | >>>     --mount=type=cache,target=/home/builder/.cache,from=cache,source=/cache \
   149 | >>>     --mount=source=sources,target=/home/builder/rpmbuild/BUILD/sources \
   150 | >>>     # The dist tag is set as the `Release` field in Bottlerocket RPMs. Define it to be
   151 | >>>     # in the form <timestamp of latest commit>.<latest commit short sha>.br1
   152 | >>>     # Remove '-dirty' from the commit sha: '-' is an illegal character for the Release field
   153 | >>>     # and '-dirty' may not be accurate to the state of the actual package being built.
   154 | >>>     rpmbuild -bb --clean \
   155 | >>>       --undefine _auto_set_build_flags \
   156 | >>>       --define "_target_cpu ${ARCH}" \
   157 | >>>       --define "dist ${BUILD_ID_TIMESTAMP}.${BUILD_ID//-dirty/}.br1" \
   158 | >>>       rpmbuild/SPECS/${PACKAGE}.spec
   159 |
  --------------------

@webern
Copy link
Contributor Author

webern commented Jun 12, 2024

@webern
Copy link
Contributor Author

webern commented Jun 12, 2024

@webern
Copy link
Contributor Author

webern commented Jun 12, 2024

&& echo "Epoch: ${BUILD_EPOCH}" >> rpmbuild/SPECS/${PACKAGE}.spec \
&& cat generated.bconds ${PACKAGE}.spec >> rpmbuild/SPECS/${PACKAGE}.spec \
&& cp ${PACKAGE}.spec rpmbuild/SPECS/${PACKAGE}.spec \
Copy link
Contributor

Choose a reason for hiding this comment

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

need to reorder this above the previous line, or we'll miss out on the Epoch for the top-level package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@webern
Copy link
Contributor Author

webern commented Jun 12, 2024

@webern
Copy link
Contributor Author

webern commented Jun 12, 2024

@webern
Copy link
Contributor Author

webern commented Jun 12, 2024

Bummer

  34.21     File must begin with "/": Epoch:
  34.21     File must begin with "/": 1

@webern
Copy link
Contributor Author

webern commented Jun 12, 2024

webern added 2 commits June 12, 2024 16:44
With bottlerocket-os/bottlerocket#4038 we can
finally stop mounting the models directory (and a vestige of logdog
could also be removed).
Remove the logic by which packages are differentially built based on
which variant they are for.
Requires bottlerocket-os/bottlerocket#4038
@webern
Copy link
Contributor Author

webern commented Jun 13, 2024

Uh oh, after rebasing I got this. Not sure if my conflict resolution was wrong or what...

Unable to instantiate the builder: Failed to create build arguments due to a dependency error: Failed to read external kit metadata file '/home/brigmatt/repos/bottlerocket/build/external-kits/external-kit-metadata.json': No such file or directory (os error 2)
error: failed to run custom build command for `filesystem v0.1.0 (/home/brigmatt/repos/bottlerocket/packages/filesystem)`

@webern
Copy link
Contributor Author

webern commented Jun 13, 2024

Oh, I think I know. The Bottlerocket Makefile.toml is going to have to call twoliter update and twoliter fetch

@webern
Copy link
Contributor Author

webern commented Jun 13, 2024

Hmmm in Bottlerocket...

$ ./tools/twoliter/twoliter fetch
[2024-06-13T00:08:39Z WARN  twoliter::project] A Release.toml file was found. Release.toml is deprecated. Please remove it from your project.
Error: failed to inspect manifest of resource at public.ecr.aws/bottlerocket/bottlerocket-sdk:v0.41.0

@webern webern marked this pull request as ready for review June 13, 2024 19:43
Copy link
Contributor

@jmt-lab jmt-lab left a comment

Choose a reason for hiding this comment

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

LGTM

@webern webern merged commit 719137a into bottlerocket-os:develop Jun 13, 2024
1 check passed
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.

remove build-package dependency on variant
3 participants