Skip to content

Sync version of upstream repository - #49

Open
power-grid-model-ci-bot[bot] wants to merge 4 commits into
mainfrom
sync-version
Open

power-grid-model-ci-bot[bot] wants to merge 4 commits into
mainfrom
sync-version

Conversation

@power-grid-model-ci-bot

Copy link
Copy Markdown
Contributor

This PR updates the formula to match the latest version of the upstream repository.

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
figueroa1395
figueroa1395 previously approved these changes Oct 20, 2026
figueroa1395 and others added 3 commits October 20, 2026 09:11
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
@figueroa1395

Copy link
Copy Markdown
Member

In this repo we were using the validate-formula and sync-version action with ubuntu-latest. When Github bumped from 24.04 to 26.04, the sync-version action failed. My best guess of why this broke things, is that the underlying glib++ of gcc14 (which is what we were pinned to) changed between Ubuntu versions.

So I did two things:

  • I pinned to ubuntu-26.04 so we don't get unhappy surprises: aaa4f4b.
  • I pinned to gcc16 since that's the latest available gcc/g++ compiler available in ubuntu-26.04 and the same we use in main PGM: b7af2db. I also simplified a bit the workflow as a side quest.

Comment on lines +20 to +27
on_linux do
depends_on "gcc@16" => :build
end

fails_with :gcc do
version "15"
cause "Use the same GCC version as in main PGM"
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this not a problem? will it remain working on older linux versions? can't we simply bump default gcc version to 16?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is what it does. depends_on "gcc@16" pins to gcc-16. The fails_with is basically saying, if gcc<=15, we fail because we want to use the same version as main pgm, is mostly a message for us in case "they" break something in the future again, we can pinpoint back to this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now I've realized something, let me think.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

alright, i think it looks good then but let's double-check with @TonyXiang8787 because i remember having discussions about this while talking about #18

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

on_linux do
    depends_on "gcc@16" => :build
  end

This block installs homebrew's bottle of gcc16. This is guaranteed to be compatible with older distros. Let's call it hgcc for argument sake.

  fails_with :gcc do
    version "15"
    cause "Use the same GCC version as in main PGM"
  end

Checks the systems gcc and if its <=15 it makes it use the brewed hgcc.

This should guarantee it works correctly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

reading the docs in https://docs.brew.sh/rubydoc/Formula.html#fails_with-class_method it looks like you only test for gcc == 15. it also does not seem to exclude any system compilers though?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is a slight difference in what it's used here and in the link you provide. The cookbook should clarify it https://docs.brew.sh/Formula-Cookbook#compiler-selection. In short

fails_with :gcc do
    version "15"
    cause "Use the same GCC version as in main PGM"
  end

Fails for <=15, whereas something like

fails_with :gcc "15" do
    version "15.1"
    cause "Use the same GCC version as in main PGM"
  end

would indeed fail for 15 and 15.1 only for example, not older versions.


fails_with :gcc do
version "15"
cause "Use the same GCC version as in main PGM"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In #18 idea was to allow the option of compiling with any gcc >14 of the target using the formula if possible. And for targets with <=14 we mandate gcc=14. So with this PR we keep it same as PGM all the time?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR aligns with PGM as of today, because gcc16 is what we use there. What happens here is that if the user's system provides gcc16 then that's used, if they have <16 then gcc16 bottled from homebrew is used to build from source, and it should be compatible even if they have older ubuntu versions, hence why they provide a bottle.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't mean that if we change PGM to gcc17 in the future, we would automatically change here. Here it's manually pinned too.

This branch has not been deployed

No deployments
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.

3 participants