Skip to content

Commit

Permalink
Merge pull request #406 from replit/dstewart/chore/fix-the-build
Browse files Browse the repository at this point in the history
chore/fix the build
  • Loading branch information
blast-hardcheese authored Oct 12, 2024
2 parents 0de5118 + 1239e60 commit 458dcf0
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 57 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,3 @@ or
```
nix build .#custom-bundle-squashfs
```

## Adding modules to historical modules

pkgs/historical-modules/default.nix provides a list of modules that are still active but we no longer maintain and build.

To add a new historical module, you need to pick a commit of the nix modules repo that has that module in it. This commit's src code will be used to build this module.
36 changes: 18 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 2 additions & 16 deletions pkgs/historical-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ let
displayVersion = "1.20";
};
}
{
moduleId = "go-1.21";
commit = "00fa9ccbbd30ded08a8ab54259490102f21905b7";
overrides = {
# /nix/store/vjdwykj1l3hkr5hzjdr4m1m2mq8vxj0i-replit-module-go-1.21
# .runners["go-run"].displayVersion = "1.21.13";
displayVersion = "1.21";
};
}
{
moduleId = "haskell-ghc9.0";
commit = "c48c43c6c698223ed3ce2abc5a2d708735a77d5b";
Expand Down Expand Up @@ -203,16 +194,11 @@ let
moduleFromHistory = { moduleId, commit, deployment ? false, overrides }:
let
flake = getFlake "github:replit/nixmodules/${commit}";
flakeMods =
if pkgs.lib.hasAttr "activeModules" flake then
flake.activeModules
else
flake.modules;
module =
if deployment then
(flake.deploymentModules or flakeMods).${moduleId}
(flake.deploymentModules or flake.modules).${moduleId}
else
flakeMods.${moduleId};
flake.modules.${moduleId};
in
pkgs.stdenvNoCC.mkDerivation {
name = "replit-module-${moduleId}";
Expand Down
11 changes: 2 additions & 9 deletions pkgs/modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,9 @@ let
(import ./nodejs-with-prybar)

(import ./go {
go = pkgs.go_1_22;
go = pkgs.go_1_21;
gopls = pkgs.gopls.override {
buildGoModule = pkgs.buildGo122Module;
};
})

(import ./go {
go = pkgs.go_1_23;
gopls = pkgs.gopls.override {
buildGoModule = pkgs.buildGo123Module;
buildGoModule = pkgs.buildGo121Module;
};
})

Expand Down
15 changes: 8 additions & 7 deletions pkgs/modules/docker/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let

configFiles = pkgs.copyPathToStore ./etc;

replit-runc = pkgs.buildGo123Module {
replit-runc = pkgs.buildGo121Module {
pname = "replit-runc";
version = "1.1.9+replit";

Expand All @@ -30,7 +30,7 @@ let
'';
};

replit-containerd = pkgs.buildGo123Module {
replit-containerd = pkgs.buildGo121Module {
pname = "replit-containerd";
version = "1.7.5+replit";

Expand Down Expand Up @@ -65,7 +65,7 @@ let
replitShimRunc = replit-containerd;
};

replit-buildkit = pkgs.buildGo123Module {
replit-buildkit = pkgs.buildGo121Module {
pname = "replit-buildkit";
version = "v0.13.0-beta1+replit";

Expand Down Expand Up @@ -99,9 +99,10 @@ let
replitShimRunc = replit-containerd;
};

mobyGoPackagePath = "github.com/docker/docker";
mobyVersion = "24.0.7+replit";

replit-moby = pkgs.buildGoModule {
replit-moby = pkgs.buildGoPackage {
pname = "replit-moby";
version = mobyVersion;

Expand All @@ -112,7 +113,7 @@ let
sha256 = "sha256-VUgsclXkoHHNT+GgYL7qiCV/4V3P9RZrT9BegMVYaRU=";
};

vendorHash = null;
goPackagePath = mobyGoPackagePath;

nativeBuildInputs = [ pkgs.makeWrapper pkgs.pkg-config pkgs.go pkgs.libtool ];

Expand All @@ -132,7 +133,7 @@ let
buildPhase = ''
export GOCACHE="$TMPDIR/go-cache"
# build engine
cd ./go/src
cd ./go/src/${mobyGoPackagePath}
export AUTO_GOPATH=1
export DOCKER_GITCOMMIT="v${mobyVersion}"
export VERSION="${mobyVersion}"
Expand All @@ -141,7 +142,7 @@ let
'';

postInstall = ''
cd ./go/src
cd ./go/src/${mobyGoPackagePath}
install -Dm755 ./bundles/dynbinary-daemon/dockerd $out/libexec/docker/replit-dockerd
makeWrapper $out/libexec/docker/replit-dockerd $out/bin/replit-dockerd \
Expand Down
15 changes: 14 additions & 1 deletion pkgs/modules/python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,21 @@ let
destination = "/config.toml";
};

debugpy = pypkgs.debugpy.overridePythonAttrs
(old: rec {
disabled = false;
version = "1.8.0";
src = pkgs.fetchFromGitHub {
owner = "microsoft";
repo = "debugpy";
rev = "refs/tags/v${version}";
hash = "sha256-FW1RDmj4sDBS0q08C82ErUd16ofxJxgVaxfykn/wVBA=";
};
doCheck = false;
});

dapPython = pkgs.callPackage ../../dapPython {
inherit pkgs python pypkgs;
inherit pkgs python pypkgs debugpy;
};

debuggerConfig = {
Expand Down

0 comments on commit 458dcf0

Please sign in to comment.