Commit graph

288 commits

Author SHA1 Message Date
=
5d387097aa fix: ensure executor doesn't deadlock when closure errors
When running 'gomod2nix' on in my project, the 'gomod2nix import' was
failing for every import. I have more imports than the default maxJobs.

This caused a deadlock and the program never finished.

This is because in the erroring case, we send to the errChan, which is a
blocking channel. If this blocks then the defers are never called, most
importantly the `defer` which pulls an entry off the semaphore
(e.guard).

This means once the erroring work functions exceeds the numWorkers, we
will block trying to acquire the semaphore when we call .Add with more
work.

We never get to the point where we call .Wait(), which would drain the
errChan becuase we are blocked on the semaphore whilst we are still
generating work.

This change moves the semaphore acquire to within the goroutines
themselves. This alters the behaviour in that we now will start as many
goroutines as we have work items, but the work they do will still be
gated by the semaphore.

This is reasonable behaviour: goroutines are cheap, in general this
package is useful if the work the functions are doing is expensive not
the goroutine creation itself. The work still is guarded by the
semaphore.

There is also a regression test added and in passing, the spelling of
Parallel is corrected.
2024-10-20 20:19:25 +02:00
Marcus Ramberg
e8f299a937 chore: bump gomod2nix.toml 2024-10-20 17:57:35 +00:00
dependabot[bot]
19ed797477 build(deps): bump golang.org/x/mod from 0.14.0 to 0.21.0
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.14.0 to 0.21.0.
- [Commits](https://github.com/golang/mod/compare/v0.14.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-20 17:57:35 +00:00
Marcus Ramberg
4c17d5bbbf chore: bump gomod2nix.toml 2024-10-20 09:37:48 +00:00
dependabot[bot]
1fd1f0f668 build(deps): bump github.com/BurntSushi/toml from 1.3.2 to 1.4.0
Bumps [github.com/BurntSushi/toml](https://github.com/BurntSushi/toml) from 1.3.2 to 1.4.0.
- [Release notes](https://github.com/BurntSushi/toml/releases)
- [Commits](https://github.com/BurntSushi/toml/compare/v1.3.2...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/BurntSushi/toml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-20 09:37:48 +00:00
Marcus Ramberg
26d2580540 chore: bump gomod2nix.toml 2024-10-20 09:33:25 +00:00
dependabot[bot]
d761835988 build(deps): bump github.com/spf13/cobra from 1.8.0 to 1.8.1
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-20 09:33:25 +00:00
Marcus Ramberg
5a56c63161 chore: fix CI 2024-10-20 11:21:45 +02:00
Marcus Ramberg
d5547e5304
Merge pull request #171 from nix-community/dependabot/github_actions/cachix/install-nix-action-v30
build(deps): bump cachix/install-nix-action from V27 to 30
2024-10-09 23:25:52 +02:00
dependabot[bot]
3ce2ef3a84
build(deps): bump cachix/install-nix-action from V27 to 30
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from V27 to 30. This release includes the previously tagged commit.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/V27...v30)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 10:26:17 +00:00
Marcus Ramberg
066e0dd2af
Merge pull request #115 from eliasnaur/silence-warning2 2024-09-30 06:02:14 +02:00
Marcus Ramberg
ba932692e2
Merge pull request #161 from marksisson/patches/fix-mkgoenv-to-allow-passing-more-attributes
fix(builder): allow additional attributes in mkGoEnv derivation
2024-09-28 01:04:23 +02:00
Marcus Ramberg
1c6fd4e862
Merge pull request #166 from jtcarnes/add-tags-documentation
docs(nix-reference): update docs to include additional parameters
2024-09-05 07:55:22 +02:00
Joshua Carnes
f2f936b454
docs(nix-reference): update docs to include additional parameters
there were additional nix parameters available during build that were
undocumented. This documents them to make them easier to see and use.
2024-08-04 18:12:55 -04:00
Jörg Thalheim
4e08ca0925
Merge pull request #165 from ajaxbits/fix-darwin
Fix: add back darwin support
2024-08-02 11:09:18 +02:00
Alex Jackson
3f884fa2bf Fix: add back darwin support
Fixes a regression where darwin support was deleted. We now take the
full default value of `defaultSystems` from flake-utils and add riscv to
it.
2024-07-29 10:48:15 -05:00
Jörg Thalheim
7b8ef0d5fd
Merge pull request #163 from nix-community/riscv64
add riscv64 support
2024-07-25 12:09:06 +02:00
Jörg Thalheim
53eb7cde5b add riscv64 support 2024-07-25 11:39:42 +02:00
Mark Sisson
db1533e578
feat(builder): allow additional attributes in mkGoEnv derivation
Extended the mkGoEnv derivation to accept additional attributes by
introducing a variadic argument. This change provides the intended
behavior of the mkGoEnv derivation, which is to allow the user to
pass additional attributes to the mkDerivation.
2024-06-05 18:56:10 -05:00
Jörg Thalheim
31b6d2e40b
Merge pull request #121 from niklashhh/fix-recursive-symlinker
Fix symlink builder to recursively walk the vendor directory
2024-05-30 08:32:35 +02:00
dependabot[bot]
4702caff8e build(deps): bump cachix/install-nix-action from 26 to 27
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 26 to 27.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v26...V27)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-20 11:01:53 +00:00
dependabot[bot]
872b63ddd2 build(deps): bump cachix/install-nix-action from 25 to 26
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 25 to 26.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v25...v26)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 10:53:05 +00:00
dependabot[bot]
30e3c3a9ec build(deps): bump cachix/install-nix-action from 24 to 25
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 24 to 25.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v24...v25)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 10:27:29 +00:00
dependabot[bot]
001bbfa22e build(deps): bump cachix/install-nix-action from 23 to 24
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 23 to 24.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v23...v24)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-04 10:54:13 +00:00
Jörg Thalheim
05c993c9a5
Merge pull request #125 from nix-community/dependabot/go_modules/github.com/sirupsen/logrus-1.9.3
build(deps): bump github.com/sirupsen/logrus from 1.8.1 to 1.9.3
2023-11-14 09:34:07 +01:00
Jörg Thalheim
65bb3c9087 bump gomod2nix.toml 2023-11-14 09:31:20 +01:00
dependabot[bot]
7c0856b10c
build(deps): bump github.com/sirupsen/logrus from 1.8.1 to 1.9.3
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.8.1 to 1.9.3.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.8.1...v1.9.3)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-14 08:30:46 +00:00
Jörg Thalheim
2f6441df9c bump gomod2nix 2023-11-14 08:29:50 +00:00
dependabot[bot]
b6c1995b8a build(deps): bump github.com/spf13/cobra from 1.4.0 to 1.8.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.4.0 to 1.8.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.4.0...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-14 08:29:50 +00:00
Jörg Thalheim
140f97b8b0 bump gomod2nix 2023-11-14 08:27:18 +00:00
dependabot[bot]
f733955aae build(deps): bump github.com/BurntSushi/toml from 1.1.0 to 1.3.2
Bumps [github.com/BurntSushi/toml](https://github.com/BurntSushi/toml) from 1.1.0 to 1.3.2.
- [Release notes](https://github.com/BurntSushi/toml/releases)
- [Commits](https://github.com/BurntSushi/toml/compare/v1.1.0...v1.3.2)

---
updated-dependencies:
- dependency-name: github.com/BurntSushi/toml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-14 08:27:18 +00:00
Jörg Thalheim
ac736456e4
Merge pull request #139 from nix-community/dependabot/go_modules/golang.org/x/tools-0.15.0
build(deps): bump golang.org/x/tools from 0.0.0-20210106214847-113979e3529a to 0.15.0
2023-11-14 09:22:05 +01:00
Jörg Thalheim
773487d439 skip build on ci branches 2023-11-14 09:19:31 +01:00
Jörg Thalheim
b2e19fe486 add mergify 2023-11-14 09:18:28 +01:00
Jörg Thalheim
9bba29f116 silence deprecated package warning 2023-11-14 09:17:40 +01:00
Jörg Thalheim
415e2814aa update gomod2nix 2023-11-14 09:13:26 +01:00
Jörg Thalheim
1633dc0c79
Merge pull request #116 from doronbehar/exposeVendor
Expose mkVendorEnv
2023-11-14 09:05:47 +01:00
Jörg Thalheim
a2ce974cf4
Merge pull request #133 from ldicarlo/patch-1
Fix: flake template start
2023-11-14 09:05:20 +01:00
Jörg Thalheim
386824f22d
Merge pull request #128 from nix-community/dependabot/github_actions/cachix/install-nix-action-23
build(deps): bump cachix/install-nix-action from 17 to 23
2023-11-14 09:04:43 +01:00
dependabot[bot]
02ec6c1101
build(deps): bump cachix/install-nix-action from 17 to 23
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 17 to 23.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v17...v23)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-14 07:42:56 +00:00
Jörg Thalheim
8e4fc84b84
Merge pull request #126 from nix-community/dependabot/github_actions/actions/checkout-4
build(deps): bump actions/checkout from 3 to 4
2023-11-14 08:42:20 +01:00
Jörg Thalheim
b7d333c7b5
Merge pull request #132 from zuqq/fix-nix-develop
Call `templates/app/shell.nix` without `buildGoApplication`
2023-11-14 08:41:53 +01:00
dependabot[bot]
6cb0b31f9f
build(deps): bump golang.org/x/tools
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.0.0-20210106214847-113979e3529a to 0.15.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/commits/v0.15.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-13 10:16:40 +00:00
Niklas Halonen
00c8e2fad3
Merge remote-tracking branch 'upstream/master' into fix-recursive-symlinker 2023-10-31 15:25:12 +02:00
Luca Di Carlo
83742a8bad
Fix: flake template start
This is the only way I found to make the project run using flakes
2023-09-24 20:24:00 +02:00
zuqq
23c5e85dad Call templates/app/shell.nix without buildGoApplication 2023-09-23 22:13:09 +01:00
dependabot[bot]
765bd77a27
build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 14:42:30 +00:00
Jörg Thalheim
f95720e89a
Merge pull request #124 from nix-community/revise-interface
Expose flake interface that does not rely on overlays
2023-09-13 16:42:04 +02:00
Jörg Thalheim
5a337a0def add dependabot 2023-09-13 08:46:55 +02:00
Jörg Thalheim
495a010f5e use flake-utils input and also override it in the template 2023-09-13 08:44:51 +02:00